fix: Ensure to display version_conflict ES error message as warn - EXO-74730 #233
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.
When we send analytics to ES, we firstly try to send it in a bulk. If an element of the bulk generates an error in ES, we resend each request of the bulk one by one. If the failed one is the i-st element, then request 1..i-1 will generated a version_conflict_engine_exception. In 6.5, this was seen as a warn, an not generates an error. In 7.0, it is seen as error, and then, like for each error, we try to resend it 5 times before dropping it, which could generate a log of logs.
This commit ensure to not raise an exception in this case :
If we have more than one entry, then we are in a bulk, and we cannot know which entry generated the version conflict, so we have to consider this as an error, and rerun each request separatly.
Resolves meesd-io/meeds#2487