-
Notifications
You must be signed in to change notification settings - Fork 945
Description
HTLCs being in-flight are a normal part of operation and that state can persist for days; we cannot delay daemon shutdown until there are no in-flight HTLCs when in-flight HTLCs can persist for days at a time.
It is certainly true that daemon shutdown cannot be deferred until all HTLCs are cleared, but a significant improvement in Lightning UX could be achieved by implementing a graceful shutdown that would block the addition of new HTLCs and wait for up to a specified timeout for all HTLCs to clear.
Feature Request
- Add an optional
timeout
parameter to thestop
RPC to specify a graceful shutdown timeout. - When
stop
begins executing, begin refusing all requests to add HTLCs to channels (both from peers and from local commands). - When there are no in-flight HTLCs, terminate the daemon.
- When the timeout expires, terminate the daemon.
Implementing this feature would reduce the occurrence of slow payment attempts for users of the Lightning Network. Rebooting a C-Lightning server can take several minutes, during which time any users with in-flight HTLCs must wait. This is bad UX and is not helping Lightning adoption. We can't easily fix HTLCs that go out to lunch and never return, but we can avoid dropping fresh HTLCs on the floor while we go out to lunch.