Skip to content

Add graceful gRPC server example - #91

Open
ting-hong-shieh wants to merge 1 commit into
cloudflare:masterfrom
ting-hong-shieh:docs/grpc-server-example
Open

Add graceful gRPC server example#91
ting-hong-shieh wants to merge 1 commit into
cloudflare:masterfrom
ting-hong-shieh:docs/grpc-server-example

Conversation

@ting-hong-shieh

Copy link
Copy Markdown

Closes #5.

Summary

  • Adds a standalone gRPC example module without changing tableflip's core dependencies or Go 1.14 requirement.
  • Transfers the listening socket during SIGHUP upgrades and drains active RPCs with GracefulStop.
  • Marks the standard gRPC health service as not serving before shutdown and force-stops RPCs after a configurable deadline.
  • Includes server reflection, health-check and upgrade commands, and unit tests for graceful and timed-out shutdown paths.

Validation

  • go test ./... in the gRPC example module
  • go test -race ./... in the gRPC example module
  • go vet ./... in the gRPC example module
  • go build ./... in the gRPC example module
  • go test ./... and go vet ./... in the tableflip root module
  • End-to-end SIGHUP upgrade: PID changed from 15121 to 15157 and grpc.health.v1.Health/Check returned SERVING before and after the handoff
  • git diff --check

@ting-hong-shieh
ting-hong-shieh marked this pull request as ready for review August 13, 2026 14:03
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.

Add an example for grpc servers

1 participant