Commit a36ad67
committed
xds: Fix shutdownNow()
This fixes `XdsServerWrapper.shutdownNow()` silently doing nothing once `shutdown()` had already
been called, permanently hanging threads blocked in `start()`. Previously they shared a single guard
flag, meaning whichever was called first made the other a complete no-op.
The fix gives `shutdownNow()`'s forceful-only work its own independent guard, following the same
two-guard pattern already used by `ManagedChannelImpl`/`ServerImpl` in grpc-java core, so it always
runs exactly once regardless of call order.
Includes a regression test that reproduces the hang against the old code and passes against the fix.
Signed-off-by: Martin Baillie <martin@baillie.id> becoming a no-op after shutdown()`1 parent d51ec50 commit a36ad67
2 files changed
Lines changed: 65 additions & 6 deletions
File tree
- xds/src
- main/java/io/grpc/xds
- test/java/io/grpc/xds
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
121 | 125 | | |
122 | 126 | | |
123 | 127 | | |
| |||
408 | 412 | | |
409 | 413 | | |
410 | 414 | | |
411 | | - | |
412 | | - | |
413 | | - | |
| 415 | + | |
414 | 416 | | |
415 | 417 | | |
416 | 418 | | |
417 | | - | |
418 | | - | |
| 419 | + | |
| 420 | + | |
419 | 421 | | |
420 | | - | |
| 422 | + | |
| 423 | + | |
421 | 424 | | |
422 | 425 | | |
423 | 426 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
490 | 546 | | |
491 | 547 | | |
492 | 548 | | |
| |||
0 commit comments