Merged latest eclipse/main updates to downstream - #102
Merged
Merged
Conversation
The test reproduced a MaxSpeedCache race by letting a stale computeMaxSpeed(...) result get cached after invalidating GPS fixes had been added. It relied on a fixed Thread.sleep(1000) inside computeMaxSpeed to "hope" the three fix-adding threads had reached the point of contending for the cache's write lock. Under CI load this timing assumption broke and the test failed with a CyclicBarrier TimeoutException. Replace the sleep with an explicit CyclicBarrier (fixThreadsReadyToContend, parties=4): the first query's stale computation and all three fix-adding threads rendezvous on it, so the stale result only completes once the invalidations are guaranteed to be about to contend. Hoist the threads to named locals and join all of them, establishing happens-before between the invalidations and the second query before asserting the recomputed maximum speed. This removes the timing dependency and makes the ordering deterministic. Assisted-By: Claude Opus 4.8 (claude-opus-5-5)
The barrier-based synchronization introduced earlier let the second query's re-entry into computeMaxSpeed(...) await the auto-reset CyclicBarrier a second time. Only the three fix-adding threads plus the first query's stale computation ever reach the barrier, so on the second generation the number of arriving parties depended on how many times computeMaxSpeed(...) got re-entered via cacheLookup(...)'s recursive getMaxSpeed(entryTo, to) stitching after the cache was invalidated. That count varies with thread scheduling: locally it happened to reach the barrier's party count and returned fast, while in CI it did not, so await(20s) timed out and the write lock was reported held for more than 10s, failing the run consistently. Gate the barrier await with an AtomicBoolean so that exactly the first computeMaxSpeed(...) invocation waits on the barrier. Every later invocation (the second query and all its recursive sub-range computations) skips it, removing the scheduling-dependent second-generation rendezvous entirely. Assisted-By: Claude Opus 4.8 (claude-opus-4-8)
axeluhl
previously approved these changes
Oct 1, 2026
axeluhl
left a comment
Member
There was a problem hiding this comment.
Test stability and wiki improvements
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.
Automated merge of upstream
eclipse/main(and re-sync of downstream) intoSAP/sailing-analytics:main.Incoming commits (4)