Commit fa12854
committed
fix: use separate retryScheduler in DispatchingTransport to prevent deadlock
BulkIngester submits afterBulk callbacks to bulkScheduler via scheduler.submit().
Its single scheduler thread can block inside FnCondition.awaitUninterruptibly()
while waiting for a concurrency slot (requestsInFlightCount < maxConcurrentRequests).
When DispatchingTransport shared bulkScheduler for retry tasks (introduced in the
previous commit), that created a deadlock:
1. bulkScheduler thread blocks in sendRequestCondition.awaitUninterruptibly()
waiting for an in-flight slot to free up.
2. Freeing a slot requires result.completeExceptionally() to fire, which requires
the retry task to run.
3. The retry task is queued in bulkScheduler, but bulkScheduler is blocked.
4. Neither side can proceed — the connector task stays RUNNING indefinitely.
Fix: give DispatchingTransport its own dedicated single-threaded retryScheduler so
retry tasks are never blocked by BulkIngester's flush tasks.1 parent 65d1269 commit fa12854
1 file changed
Lines changed: 19 additions & 4 deletions
Lines changed: 19 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
162 | 178 | | |
163 | 179 | | |
164 | 180 | | |
165 | 181 | | |
166 | 182 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | 183 | | |
171 | 184 | | |
172 | 185 | | |
173 | | - | |
| 186 | + | |
174 | 187 | | |
175 | 188 | | |
176 | 189 | | |
| |||
211 | 224 | | |
212 | 225 | | |
213 | 226 | | |
| 227 | + | |
214 | 228 | | |
215 | 229 | | |
216 | 230 | | |
| |||
527 | 541 | | |
528 | 542 | | |
529 | 543 | | |
| 544 | + | |
530 | 545 | | |
531 | 546 | | |
532 | 547 | | |
| |||
0 commit comments