-
Notifications
You must be signed in to change notification settings - Fork 890
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
lightningd: make shutdown smoother and safer, PART II (again) #4959
lightningd: make shutdown smoother and safer, PART II (again) #4959
Conversation
The only thing that needs ld->wallet after this is destroy_invoices_waiter (off jsonrpc) Could not find any other destructors (destroy_*) that need wallet or db access after this. Any db access would now segfault.
CI failure not your fault:
I think that we shouldn't log broken if the error is -5. Did you want to patch it, or should I? |
@rustyrussell Sure go ahead! I guess |
Mh with the following error also available here is possible that the error is expected from c-lightning? and we just ignore the error -5? Not sure where we can ignore it, the idea is it ignores all the plugin error that returns -5, and print it as debug info. I'm missing some things? |
It looks that in Lines 4353 to 4356 in bad0988
The So we have a race between |
The (hopefully) last failing Running
or so:
Not sure what is happening there, will dig into it. |
Think I found the cause for flakeness, the lightning/tests/test_plugin.py Lines 1108 to 1113 in c2d2cc1
In retrospect, the HTLC-part of this test was mainly to demonstrate failure before this (and previous) PR because hooks where silently unregistered when a plugin was shutdown. Now if we can incorporate the |
into test_plugin_shutdown The fact that plugins are kept alive untill the very end also ensures their hooks are not silently unregistered.
b9ab287
to
7d29c70
Compare
I found the flake, but used the time to consolidate the tests. The |
After leaving the main event loop, the only path to destroy_plugin goes via shutdown_plugins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack 8132509
We could do a little test cleanup using wait_for_logs(), but I really want to apply this so I'm going to do that immediately (we're seeing some flakes in unrelated PRs).
Follow up of #4897, fixes the issues raised in that PR. (similar to #4947, but could not reopen it after force push)
db
in theshutdown_plugins
, this partially reverts 5f69674 (the part that touchedwallet
code).io_loop
inshutdown_plugins
test_htlc_accepted_hook_shutdown
, moved relevant parts intotest_plugin_shutdown
Some cleanup:
timer_expired()
had an obsolete parameter.BTW I found below comment inside
io_loop
confusing:lightning/ccan/ccan/io/poll.c
Lines 402 to 403 in 5a5cf8c
Maybe more descriptive would be:
/* Look for expired timers. */