Force besu to stop on plugin initialization errors#7662
Merged
Gabriel-Trintinalia merged 13 commits intobesu-eth:mainfrom Sep 24, 2024
Merged
Force besu to stop on plugin initialization errors#7662Gabriel-Trintinalia merged 13 commits intobesu-eth:mainfrom
Gabriel-Trintinalia merged 13 commits intobesu-eth:mainfrom
Conversation
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
fab-10
reviewed
Sep 23, 2024
Contributor
fab-10
left a comment
There was a problem hiding this comment.
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 <gabriel.trintinalia@consensys.net>
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Contributor
Author
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 <gabriel.trintinalia@consensys.net>
fab-10
reviewed
Sep 24, 2024
besu/src/main/java/org/hyperledger/besu/cli/DefaultCommandValues.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
fab-10
approved these changes
Sep 24, 2024
Wolmin
pushed a commit
to lukso-network/network-besu
that referenced
this pull request
Sep 27, 2024
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net> Signed-off-by: Wolmin <lamonos123@gmail.com>
This was referenced Oct 5, 2024
This was referenced Oct 18, 2024
Merged
Closed
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description
This PR changes the initialization behaviour of plugins in the
BesuPluginContextImplclass by introducing apluginContinueOnErrorflag. By default, Besu will not allow plugins to fail during registration and other startup lifecycle stages.Changes Made
pluginContinueOnError Flag:
--plugin-continue-on-errorCLI option (default to false).pluginContinueOnErrorflag to thePluginConfigurationclass.Lifecycle Methods:
registerPlugins,beforeExternalServices,startPlugins, andafterExternalServicesMainLoopmethods to check thepluginContinueOnErrorflag. 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 aRuntimeExceptionand 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-erroroption is set tofalse(default), Besu will throw aRuntimeExceptionand halt gracefully, ensuring that plugins cannot fail registration.