Closed sector-f closed 1 year ago
Should be fixed by 096a9bd546127235ae9175e6c6ebc901df9853f8, but I'm gonna leave this open for now just in case I'm wrong
Should still remain fixed in f49498d173bcae8712452f6efe918e64f4250c07 but with cleaner code
To elaborate on the issue: the code was reaching a point where a probe was trying to send over the stats channel when the main pinger thread was at a point where it was trying to send over a stop channel (and therefore neither action would ever succeed)
In other words: deadlock
Very rarely, pressing ^C seems to make the program hang indefinitely rather than quit properly. This indicates that there is probably some kind of race condition somewhere.
I could just work around this by adding a timeout that causes the program to call
os.Exit
if it hasn't shut down e.g. 3 seconds after SIGINT has been received, but I'd rather figure out the actual issue and fix that.