apupier commented on PR #30786: URL: https://github.com/apache/camel/pull/30786#issuecomment-7163936183
Thanks for the review, @davsclaus. Pushed `ed3f45f28fcf` with the following changes: - `afterStopped()` now runs only when `awaitStopped()` reports the thread was left behind, so a normal stop does not write a second time. - The stop-time persist is guarded: a failure is logged at WARN and `stop()` still completes, so the executor shutdown is not skipped. - `MongoDbTailTrackingManager.lastVal` is `volatile`. - The Javadoc describes behavior, not the test. - The unit test waits on the stop latch, asserts no failure, and checks the written value (`lastTrackingValue=1`) instead of `any()`. It still fails without the hook. On the root cause, I agree the PR does not yet prove it explains the flake: - A normal stop cannot persist `299` after a routed `300`: the consumer thread is joined and its `finally` persists the current `lastVal`. - `299` can only be persisted when the batch that routed record 300 never reaches its `finally`. That is the left-behind case the stop-time persist now covers, but I have not reproduced that ordering, so I am not claiming the flake is fixed. - The `null` on an empty collection in `testPersistentTailTrackIncreasingDateField` is a different mechanism, and this PR does not address it. I will keep this PR scoped to the left-behind stop and open a follow-up for the mid-stream ordering if the Develocity runs keep failing after this merges. _Claude Code on behalf of Aurélien Pupier_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
