Ignore and log errors during RPC cancel #4358

pull laanwj wants to merge 2 commits into bitcoin:master from laanwj:2014_06_rpc_cancel_errors changing 1 files +12 −3
  1. laanwj commented at 7:17 AM on June 17, 2014: member

    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.

  2. Diapolo commented at 8:54 AM on June 17, 2014: none

    The commit-message seems missleading, as you just log errors and don't avoid them.

  3. laanwj commented at 9:01 AM on June 17, 2014: member

    It avoids the errors getting out of hand. But sure I can change the commit message...

    Edit: done

  4. laanwj renamed this:
    Avoid errors during RPC cancel
    Ignore and log errors during RPC cancel
    on Jun 17, 2014
  5. theuni commented at 9:07 PM on June 17, 2014: member

    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?

  6. jgarzik commented at 9:23 PM on June 17, 2014: contributor

    ACK

  7. laanwj commented at 1:28 PM on June 18, 2014: member

    @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.

  8. rpc: Ignore and log errors during cancel
    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.
    33e5b42910
  9. rpc: Add acceptors only when listening succeeded 6afa49329d
  10. laanwj commented at 6:22 AM on June 19, 2014: member

    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.

  11. BitcoinPullTester commented at 6:41 AM on June 19, 2014: none

    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.

  12. laanwj merged this on Jun 19, 2014
  13. laanwj closed this on Jun 19, 2014

  14. laanwj referenced this in commit 7eb49c79f0 on Jun 19, 2014
  15. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me