-
Notifications
You must be signed in to change notification settings - Fork 901
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
Add early abort in case of misconfigured plugins #4418
Conversation
We were reporting the failure immediately but still continuing with the startup. This could happen if an important plugin ends up in a race with another plugin (important or not) for a contended resource (CLI option or RPC method name). We would eventually notice that we were supposed to abort, but at that point we already processed a couple of blocks, loaded the entire state, etc. This just aborts early with a sane error message. Changelog-Added: plugin: If there is a misconfiguration with important plugins we now abort early with a more descriptive error message. Reported-by: PsySc0rpi0n Reported-by: Ján Sáreník <@jsarenik>
Thank you @cdecker! Currently it hangs which is pretty good because it would not infinitely restart on
UPDATE: NACK 7bafc57 (see below) |
What do others think? Would you prefer a hanging |
* effort in starting up. | ||
*/ | ||
if (ld->exit_code) | ||
fatal("Could not initialize the plugins, see above for details."); |
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.
@cdecker seemingly I never get here
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.
Apologies, I thought that important
flag is set in plugin details automatically. All good now. Thank you.
That's strange, it doesn't hang when I test it locally. Hanging is definitely the wrong thing to do here. |
Notice that we don't exit if a non-important plugin dies. Please use |
@cdecker Thanks for info.
ACK 7bafc57 |
* effort in starting up. | ||
*/ | ||
if (ld->exit_code) | ||
fatal("Could not initialize the plugins, see above for details."); |
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.
Apologies, I thought that important
flag is set in plugin details automatically. All good now. Thank you.
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 7bafc57
There are ways to misconfigure plugins that will cause us to shut
down. These include having an important plugin fight for a method name
with another plugin, e.g., by loading the same plugin twice. Until now
we would happily continue with the startup sequence only to later
realize that we were supposed to shutdown, but by then we'd have
buried the error message in the logs.
This PR just adds a check for misconfigurations before we even start
the normal
io_loop
, avoiding expensive initializations and nothiding the log entries about the cause. This works if we're just using
--help
as well, and produces a much clearer picture of what is goingon.
I also added the name of the plugin that was clashing with RPC methods.
Fixes #4415
Reported-by: PsySc0rpi0n
Reported-by: Ján Sáreník <@jsarenik>