Commit cdf43b8
committed
Fix back-pressure in Netty frame handler
A race condition can cause to see the channel as non-writable but end up
with a new count down latch, not the one that was present when the
writability flag was true. So the code waits on this new latch which
will be never counted down. This can happen when the writability flips
from false to true very fast.
This commit makes sure to get the latch first, then check the
writability a second time. In case we get an "old" latch, it is counted
down automatically, so the enqueuing code will not be blocked.1 parent 80d5504 commit cdf43b8
File tree
1 file changed
+20
-10
lines changed- src/main/java/com/rabbitmq/client/impl
1 file changed
+20
-10
lines changedLines changed: 20 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
329 | 341 | | |
330 | | - | |
331 | | - | |
332 | 342 | | |
333 | 343 | | |
334 | 344 | | |
| |||
0 commit comments