Log non-fatal errors during service bootstrap phase under DEBUG instead of ERROR #4630
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.
This pull request updates the code to log non-fatal errors under
DEBUGlog level instead ofERROR.Previously we logged those under
ERRORwhich caused a lot of unnecessary confusion.Background, Context
During service bootstrap phase and when running register content script we register internal trigger types (among other things).
This operation is idempotent and as such, some of the possible errors (not unique and object already exists error) are non-fatal. An error represents a non-fatal race which just means that a particular trigger has already been registered by a different service / process.
NOTE: Adding tests for that would be hard. We would need to replicate the race which means spawning multiple processes (using multiple eventlets won't work here, we need real parallelism to replicate it) and ensure tests run on multi core / CPU server...
Resolves #3933.
Output
Before:
After (as you can see, the error is only logged under debug when
--verboseflag is used):TODO