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

lnd: add interrupt handler to handle shutdown requests while syncing chain backend #1276

Merged

Conversation

wpaulino
Copy link
Contributor

Fixes #1265.

idx := len(interruptCallbacks) - 1 - i
callback := interruptCallbacks[idx]
// Execute the interrupt callbacks in FIFO order.
for _, callback := range interruptCallbacks {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rationale behind the change to FIFO order from LIFO?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that we can add and execute interrupt handlers as we go, making it work sort of like a defer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW defers are executed in LIFO order.

@Roasbeef Roasbeef added this to the 0.4.2-beta milestone May 23, 2018
Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🥁

Tested locally, and works as advertised.

@Roasbeef Roasbeef merged commit 6382215 into lightningnetwork:master May 23, 2018
@wpaulino wpaulino deleted the shutdown-while-chain-sync branch May 24, 2018 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants