Commit d3743bc
committed
Fix concurrent sendMessage race by retrying on FAIL_NON_SERIALIZED
Replace tryEmitNext (fail-fast) with emitNext + busyLooping(10ms)
in ManagedStdioClientTransport.sendMessage().
The unicast sink's SinkManySerialized wrapper returns FAIL_NON_SERIALIZED
when two threads call tryEmitNext concurrently. busyLooping retries the
CAS spin instead of immediately failing, making concurrent sends safe.
The contention window is microseconds (single CAS operation), so the
10ms duration is just a generous upper bound.
Before: 18/20 test repetitions fail
After: 20/20 pass1 parent fb3633e commit d3743bc
File tree
1 file changed
+9
-3
lines changed- src/main/java/org/sonarsource/sonarqube/mcp/client
1 file changed
+9
-3
lines changedLines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
144 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
145 | 151 | | |
146 | 152 | | |
147 | 153 | | |
| |||
0 commit comments