Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework ping logic, have channeld ping regularly. #4804

Merged
merged 8 commits into from
Oct 10, 2021

Commits on Oct 7, 2021

  1. common/read_peer_msg: handle pings in handle_peer_gossip_or_error().

    This is a noop for now, since gossipd handles them.  But that
    will change in the next patch.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Oct 7, 2021
    Configuration menu
    Copy the full SHA
    04e75f7 View commit details
    Browse the repository at this point in the history
  2. gossipd: remove ping/pong handling

    To minimize the diffs, we #if 0 the code.  We'll reenable it once
    channeld is ready.
    
    We also temporarily disable the ping tests.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Oct 7, 2021
    Configuration menu
    Copy the full SHA
    e185231 View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2021

  1. channeld: remove liveness logic pre-commitment.

    We're going to continuously ping, so this is redundant.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    100c029 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2021

  1. channeld: fix halting gossip when a timer is active.

    We would sleep until the next timer, even if that's long past when we would
    send gossip.  Normally we use very short timers, so we didn't notice, but
    we will in the next patch, where we use continuous timers for pings.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Oct 9, 2021
    Configuration menu
    Copy the full SHA
    5ab7b15 View commit details
    Browse the repository at this point in the history
  2. channeld: perform regular keepalive pings.

    Send a ping every 15-45 seconds.  If we try to send another one and we
    haven't got a reply, hang up.
    
    Signed-off-by: Rusty Russell <[email protected]>
    Changelog-Changed: Protocol: Send regular pings to detect dead connections (particularly for Tor).
    rustyrussell committed Oct 9, 2021
    Configuration menu
    Copy the full SHA
    43ffb6b View commit details
    Browse the repository at this point in the history
  3. channeld: restore ping command, but only for channeld.

    It's probably not worth fixing for the other daemons.
    
    Changelog-Changed: JSON-RPC: `ping` now only works if we have a channel with the peer.
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Oct 9, 2021
    Configuration menu
    Copy the full SHA
    054e182 View commit details
    Browse the repository at this point in the history
  4. pytest: fix flake when test reconnects by itself.

    If it reconnects by itself, it will get a warning message:
    
    ```
    lightningd-2: 2021-10-08T01:40:42.446Z DEBUG   0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-channeld-chan#3: billboard: Sent reestablish, waiting for theirs
    lightningd-2: 2021-10-08T01:40:42.446Z DEBUG   0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-channeld-chan#3: peer_in WIRE_ERROR
    lightningd-2: 2021-10-08T01:40:42.447Z DEBUG   0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-channeld-chan#3: billboard perm: Received error channel 0a6220a3e904d17e72b5c3499928dc8a65720063c6395c999a129a0ff0b06afb: Forcibly closed by `close` command timeout
    lightningd-2: 2021-10-08T01:40:42.448Z INFO    0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-chan#3: Peer transient failure in CHANNELD_NORMAL: channeld WARNING: error channel 0a6220a3e904d17e72b5c3499928dc8a65720063c6395c999a129a0ff0b06afb: Forcibly closed by `close` command timeout
    ```
    
    And this will make CI complain.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Oct 9, 2021
    Configuration menu
    Copy the full SHA
    05ff02f View commit details
    Browse the repository at this point in the history
  5. pytest: fix flake in test_upgrade_statickey_onchaind

    Reconnect manually, don't wait for automatic reconnect.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Oct 9, 2021
    Configuration menu
    Copy the full SHA
    e9551cf View commit details
    Browse the repository at this point in the history