Fix flaky ConductorTest latch timeouts caused by ChaosTest starving the common ForkJoinPool#458
Open
maxdml wants to merge 2 commits into
Open
Fix flaky ConductorTest latch timeouts caused by ChaosTest starving the common ForkJoinPool#458maxdml wants to merge 2 commits into
maxdml wants to merge 2 commits into
Conversation
toxiProxyTest launched dbLossBetweenSteps via a bare CompletableFuture.supplyAsync, so the worker sat blocked in dbRetry for the whole 3s induced network partition. On small CI runners this stalled the entire common pool, starving concurrently running ConductorTests whose WebSocket callbacks dispatch there — causing flaky "message latch timed out" failures. Use a dedicated thread instead.
devhawk
reviewed
Jul 16, 2026
|
|
||
| // Scenario 1: proxy disabled — simulates a sustained network partition | ||
| proxy.disable(); | ||
| // Dedicated thread: this blocks in dbRetry while the proxy is down, and must |
Collaborator
There was a problem hiding this comment.
Should we run this test @isolated and/or @execution(ExecutionMode.SAME_THREAD)?
Contributor
Author
There was a problem hiding this comment.
Same thread would have supplyAsync run on the same coomon pool and isolated slows down test without really solving the problem
devhawk
approved these changes
Jul 24, 2026
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.
Problem
CI intermittently fails a random
ConductorTestwithmessage latch timed out(e.g.canGetWorkflowEventsThrows()[3]in run 79520581511, failing all 3 retries).Root cause:
ChaosTest.toxiProxyTestlauncheddbLossBetweenStepsvia a bareCompletableFuture.supplyAsync(...), which runs on the JVM-shared commonForkJoinPool. While the test's toxiproxy partition is active (~3s), that worker sits blocked insideSystemDatabase.dbRetrybackoff loops. On CI runners the common pool has only ~3 workers, and the run's logs show the pool fully stalled for 3.2s — with zero common-pool activity — exactly spanning all three retries of the failing test.The Conductor's WebSocket callbacks (
onOpen/onText) and message handlers also dispatch on the common pool, so during the stall the conductor client never completed its handshake: the test server sawonOpenand sent the request, but the client-side connect future was still pending whenConductor.stopcancelled it at teardown. Suite-wide, the test server saw 113 handshakes while the client completed only 106.The flake only reproduces when a ConductorTest happens to overlap one of ChaosTest's induced partitions, which is why it comes and goes.
Fix
Run the deliberately-blocked
startWorkflowon a dedicated thread instead of the common pool. A platform thread is used (not virtual) because the module targets--release 17.Testing
:transact:compileTestJavapassesCI=true ./gradlew :transact:test --tests dev.dbos.transact.database.ChaosTest.toxiProxyTest: all 5 repetitions pass (test isci-only-tagged)Note
This removes the known trigger, but the Conductor still depends on the common pool for its WebSocket callbacks and handlers (
Conductor.java:795+). Anything that saturates the common pool for >1s could reproduce the symptom, including in production. Giving the Conductor an explicit executor is a possible follow-up.