Commit d02fd57
pubsub: fix potential deadlock in startConnections (googleapis#1674)
If a subscriber connection fails, awaitRunning will throw
IllegalStateException.
We must make sure that we count down the latch in either case;
otherwise startup will deadlock.
Also move the call to addListener above startAsync.
Otherwise, the listener might not see the connection failing
if it fails too quickly.1 parent 827e519 commit d02fd57
File tree
1 file changed
+6
-3
lines changed- google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1
1 file changed
+6
-3
lines changedLines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
469 | | - | |
470 | | - | |
471 | 469 | | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
472 | 475 | | |
473 | 476 | | |
474 | 477 | | |
| |||
0 commit comments