-
Notifications
You must be signed in to change notification settings - Fork 838
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
Force besu to stop on plugin initialization errors #7662
Force besu to stop on plugin initialization errors #7662
Conversation
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
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.
LGTM, just add a CHANGELOG entry and doc-change-required
label.
Then I am thinking, that even if it will be a breaking changes, to set the default to true
, at least to me it seems the normal behavior to fail in case a plugin has an issue. WDYT?
besu/src/main/java/org/hyperledger/besu/cli/options/stable/PluginsConfigurationOptions.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
I agree with stopping the startup when the plugin fails by default. That is probably the right behaviour in the majority of setups. |
--halt-on-plugin-error
CLI Option to ensure successful plugins registrationSigned-off-by: Gabriel-Trintinalia <[email protected]>
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.
LGTM, just a last rename
besu/src/main/java/org/hyperledger/besu/cli/DefaultCommandValues.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]> Signed-off-by: Wolmin <[email protected]>
PR Description
This PR changes the initialization behaviour of plugins in the
BesuPluginContextImpl
class by introducing apluginContinueOnError
flag. By default, Besu will not allow plugins to fail during registration and other startup lifecycle stages.Changes Made
pluginContinueOnError Flag:
--plugin-continue-on-error
CLI option (default to false).pluginContinueOnError
flag to thePluginConfiguration
class.Lifecycle Methods:
registerPlugins
,beforeExternalServices
,startPlugins
, andafterExternalServicesMainLoop
methods to check thepluginContinueOnError
flag. If a plugin fails and the flag is set to true, Besu will log the error and continue running. If the flag is set to false, Besu will throw aRuntimeException
and halt.Usage Example
In this example, if any plugin fails during registration, before external services, startup, or after external services post main loop, Besu will log the error and continue running. If the
--plugin-continue-on-error
option is set tofalse
(default), Besu will throw aRuntimeException
and halt gracefully, ensuring that plugins cannot fail registration.