Cancelling the RPC acceptors can sometimes result in an error about a bad file descriptor.
As this is the shutdown sequence we need to continue nevertheless, ignore these errors, log a warning and proceed.
As suggested by @theuni.
Fixes #4352.
The commit-message seems missleading, as you just log errors and don't avoid them.
It avoids the errors getting out of hand. But sure I can change the commit message...
Edit: done
ACK, exactly what I had in mind.
Once we get some logs of this happening, might be worth checking to see why we're seeing this in the first place. Could be that we should be checking acceptor status before canceling?
ACK
@theuni One reason I can think of would be that we're pushing acceptors to the list that have never been activated at all. For example if it couldn't listen on a port due to lack of IPv6 support etc. Or maybe they've been closed for another reason, but I can't think of one. Some kind of race condition.
boost::asio is frustrating.
Cancelling the RPC acceptors can sometimes result in an error about
a bad file descriptor.
As this is the shutdown sequence we need to continue nevertheless,
ignore these errors, log a warning and proceed.
Fixes #4352.
I added a commit that I believe fixes the underlying issue: acceptors were added to the list even when listening failed. I suppose in that case, cancelling them generates an error. I'll still keep the first commit as exceptions during shutdown shouldn't disrupt the shutdown process.
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/6afa49329de860c080cdfd9b1c65afe313a43860 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.