http: Fail initialization when any bind fails (0.17) #15050

pull laanwj wants to merge 1 commits into bitcoin:0.17 from laanwj:2018_12_http_bind_error_0_17 changing 1 files +23 −3
  1. laanwj commented at 10:01 am on December 28, 2018: member
    Backport of #14968 to 0.17 branch.
  2. http: Fail initialization when any bind fails
    Currently the HTTP server initialization (`HTTPBindAddresses`) fails
    only when *all* bindings fail. So if multiple binds are specified
    (`127.0.0.1` and `::1` by defeault) and one succeeds and the other
    fails, the latter is essentially ignored.
    
    This commit changes the error behavior to fail *if not all* binds could
    be performed, which I think is more in line with how software normally
    handles this and what users expect.
    6a48a4bdc8
  3. laanwj added the label RPC/REST/ZMQ on Dec 28, 2018
  4. laanwj added the label Backport on Dec 28, 2018
  5. laanwj added this to the milestone 0.17.2 on Dec 28, 2018
  6. laanwj commented at 10:02 am on December 28, 2018: member
    Let’s see if we can reproduce the problem w/ Travis test coverage on master @luke-jr mentions here #14968 (comment)
  7. laanwj commented at 10:42 am on December 28, 2018: member

    This is interesting, apparently the first test p2p_compactblocks fails, but not, say, creating the cache. This is a different problem than #14968 used to have.

    0 node0 2018-12-28T10:10:15.279652Z Allowing HTTP connections from: 127.0.0.0/8 ::1/128 
    1 node0 2018-12-28T10:10:15.279730Z Binding RPC on address ::1 port 16704 
    2 node0 2018-12-28T10:10:15.279807Z libevent: getaddrinfo: address family for nodename not supported 
    3 node0 2018-12-28T10:10:15.279830Z Binding RPC on address ::1 port 16704 failed (Error: Success (0)). 
    4 node0 2018-12-28T10:10:15.279842Z Binding RPC on address 127.0.0.1 port 16704 
    5 node0 2018-12-28T10:10:15.279913Z Unable to bind all endpoints for RPC server 
    6 node0 2018-12-28T10:10:15.279940Z Error: Unable to start HTTP server. See debug log for details. 
    

    What is different in the environment for 0.17 that could explain this? The libevent version? The test environment?

    I didn’t see any getaddrinfo: address family for nodename not supported on master. Looks like here, even the lookup of ::1 fails before it gets to binding!

  8. laanwj closed this on Dec 28, 2018

  9. DrahtBot locked this on Sep 8, 2021


laanwj

Labels
RPC/REST/ZMQ Backport

Milestone
0.17.2


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: 2024-10-18 10:12 UTC

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