Skip to content

xds: Fix shutdownNow() becoming a no-op after shutdown() - #12982

Merged
kannanjgithub merged 1 commit into
grpc:masterfrom
martinbaillie:xds/fix-shutdownnow-noop
Aug 14, 2026
Merged

xds: Fix shutdownNow() becoming a no-op after shutdown()#12982
kannanjgithub merged 1 commit into
grpc:masterfrom
martinbaillie:xds/fix-shutdownnow-noop

Conversation

@martinbaillie

Copy link
Copy Markdown
Contributor

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.

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>
@martinbaillie martinbaillie changed the title xds: Fix shutdownNow() becoming a no-op after shutdown()` xds: Fix shutdownNow() becoming a no-op after shutdown() Aug 11, 2026
@kannanjgithub kannanjgithub added the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Aug 13, 2026
@grpc-kokoro grpc-kokoro removed the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Aug 13, 2026
@kannanjgithub
kannanjgithub merged commit 3cb7007 into grpc:master Aug 14, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants