Tighten up exception handling around markItemAsDropped/markItemAsFailed #104931
Labels
>bug
:Data Management/Ingest Node
Execution or management of Ingest Pipelines including GeoIP
Team:Data Management
Meta label for data/management team
There's been a lot of issues with serialization of
IngestStats
, and having the stats themselves sometimes go negative (due to a bad code path double decrementing the 'ingestCurrent' count of theIngestStats.Stats
).See #52339, #62087, and #77973, as well as #52543, #69818, #81450, #90319 and #91439.
As far as I'm aware, at this point we've actually solved the serialization issue -- in the
IngestStats
itself we do not allow the current count to go negative, so even through some cases could still be double decrementing, we no longer have the problem of it causing various stats APIs to break. However, it's still possible to run into issues with this code, which would manifest as something like the following stack trace in the logs:Most recently I came across a situation where #36746 was resulting in an exception being thrown from inside the
markItemAsDropped
method of theTransportBulkAction.BulkRequestModifier
. It turns out that specific circumstance was a still-remaining cause of double-decrementing theIngestStats
. #104585 fixed the code in question so that it would no longer happen to throw an exception in that circumstance, but the overall shape of the issue still remains: if something causesmarkItemAsDropped
ormarkItemAsFailed
to throw an exception then it appears that we'll double-decrement theIngestStats
and log the above stack trace.We should tighten up the exception handling logic around those methods so that double decrementing will not occur even if those methods fail -- and we should log even more useful information for ourselves in the event that they fail.
The text was updated successfully, but these errors were encountered: