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

subd version messages #4471

Merged
merged 5 commits into from
Apr 24, 2021

Conversation

rustyrussell
Copy link
Contributor

This catches the "oops, per-peer daemons have been upgraded underneath me!" problem; it still logs a BROKEN message, but it tried to re-exec itself.

We still have the version check at startup, so we don't infinite loop if we have a half-installed setup somehow.

For this patch we simply abort if it's wrong.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
For channeld, we move status_setup_sync() to a more obvious place.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
You still shouldn't do this (you could get some transient failures),
but at least you have a decent chance if you reinstall over a running
daemon, instead of getting confusing internal errors if message
formats have changed.

Changelog-Added: lightningd: we now try to restart if subdaemons are upgraded underneath us.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Fixes: ElementsProject#4346
This was always a theoretical race, but with the next change we actually
hit it under valgrind.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This avoids subdaemons complaining about malformed messages from us,
or doing the completely wrong thing, if they are really the wrong
version.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Copy link
Member

@cdecker cdecker left a comment

Choose a reason for hiding this comment

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

Just a minor question about the ordering in channeld where we seem to happily process the channeld_init message before we send the version, which seems to contradict our intended goal.
Re-reading I see that it was me not seeing it the correct way around: this corrects the recv-then-init-subd logic we used before.

Also the exec logic is scary, but I can't see how it could fail.

ACK 92131a0

@rustyrussell rustyrussell merged commit f97a51c into ElementsProject:master Apr 24, 2021
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.

2 participants