Issue: previously, the monitor stopped accepting incoming connections after hours.
Cause: Still not 100% sure, but it seems to be caused by attempting to read tcp info from connections.
Previous implementation used functions that put file descriptors in blocking mode (https://github.com/golang/go/issues/22939). According to comments, this causes the SetDeadline methods to stop working, meaning every disconnecting connections could potentially hang waiting for Disconnect message to be sent indefinitely.
While both mss and rtt values are obtained through the same method, the issue only surfaced after including mss because mss was obtained during SetupConn and rtt was not.
Failed incoming connections probably never got out of SetupConn, held on to handshake tokens, and eventually got the listenLoop hanging.
Solution: Simply removing mss portion wouldn't root out the cause as rtt relies on the same approach. To get rid of the problematic functions, tcpinfo is replaced with https://github.com/mikioh/tcpinfo. Both rtt and mss are kept for now.
If this really was the issue with connections, then both node-finder and tx-sniper are affected. The fix will be applied to tx-sniper.
tcpinfo
package with https://github.com/mikioh/tcpinfo/SetDeadline
methods to stop working, meaning every disconnecting connections could potentially hang waiting forDisconnect
message to be sent indefinitely.SetupConn
and rtt was not.SetupConn
, held on to handshake tokens, and eventually got thelistenLoop
hanging.tcpinfo
is replaced with https://github.com/mikioh/tcpinfo. Both rtt and mss are kept for now.node-finder
andtx-sniper
are affected. The fix will be applied totx-sniper
.