Skip to content

rpc,server: add DRPC server Stop() for graceful shutdown during drain#166526

Draft
cthumuluru-crdb wants to merge 1 commit intocockroachdb:masterfrom
cthumuluru-crdb:issue-165377
Draft

rpc,server: add DRPC server Stop() for graceful shutdown during drain#166526
cthumuluru-crdb wants to merge 1 commit intocockroachdb:masterfrom
cthumuluru-crdb:issue-165377

Conversation

@cthumuluru-crdb
Copy link
Copy Markdown
Contributor

@cthumuluru-crdb cthumuluru-crdb commented Mar 24, 2026

🚨 Stacked on top of cockroachdb/drpc#40.

Add a Stop() method to the DRPCServer interface that closes all tracked listeners and forcefully closes active connections, mirroring grpc.Server.Stop(). Call it during drain and register it as a stopper closer to ensure DRPC connections are properly cleaned up on shutdown.

Also add a nil guard in IsConnectionRejected to prevent panics, and update the DRPC dependency to include Stop() support.

Resolves: #165377

Release note: None

Add a Stop() method to the DRPCServer interface that closes all tracked
listeners and forcefully closes active connections, mirroring
grpc.Server.Stop(). Call it during drain and register it as a stopper
closer to ensure DRPC connections are properly cleaned up on shutdown.

Also add a nil guard in IsConnectionRejected to prevent panics, and
update the DRPC dependency to include Stop() support.

Resolves: cockroachdb#165377

Release note: None

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
@trunk-io
Copy link
Copy Markdown
Contributor

trunk-io bot commented Mar 24, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Mar 24, 2026

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cthumuluru-crdb cthumuluru-crdb added the do-not-merge bors won't merge a PR with this label. label Mar 24, 2026
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge bors won't merge a PR with this label.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

server: TestDrain failed

2 participants