No graceful way to stop a TcpRaftNode
DevSidious opened this issue · comments
Currently one has to call Dispose() on a TcpRaftNode to make it shut down (ungracefully) resulting in:
21.08.2018 15:39:57> [ERROR] [System.ObjectDisposedException: Cannot access a disposed object. Object name: 'System.Net.Sockets.Socket'. at System.Net.Sockets.Socket.EndAccept(Byte[]& buffer, Int32& bytesTransferred, IAsyncResult asyncResult) at System.Net.Sockets.TcpListener.EndAcceptTcpClient(IAsyncResult asyncResult) at System.Net.Sockets.TcpListener.<>c.<AcceptTcpClientAsync>b__28_1(IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory
1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action
1 endAction, Task1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at Raft.Transport.TcpRaftNode.StartTcpListener()] [] []
Will take a look
Ok, this you can call a graceful termination. Because await AcceptTcpClientAsync will be always terminated with exception (that is catched and logged), when you dispose the socket.