fix(grpc): preserve graceful streaming shutdown#443
Conversation
yordis
commented
Jul 19, 2026
- Long-lived gRPC streams must not force graceful shutdown to wait for the server timeout.
- Shutdown-driven disconnects must remain retryable without changing ordinary client cancellation.
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
PR SummaryMedium Risk Overview When shutdown drives that cancellation, Subscription enumerators ( Reviewed by Cursor Bugbot for commit 94ba180. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (14)
WalkthroughStreaming enumerators now preserve caller cancellation tokens. gRPC streaming requests link host shutdown to request cancellation, translate shutdown cancellations into an Unavailable RPC error, and remove asynchronous disposal callbacks from the read path. ChangesStreaming cancellation and shutdown
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant HostApplicationLifetime
participant GrpcStreamLifetimeMiddleware
participant StreamsRead
participant GrpcServerShutdownInterceptor
HostApplicationLifetime->>GrpcStreamLifetimeMiddleware: Cancel ApplicationStopping
GrpcStreamLifetimeMiddleware->>StreamsRead: Provide linked RequestAborted token
StreamsRead->>GrpcServerShutdownInterceptor: Propagate streaming cancellation
GrpcServerShutdownInterceptor-->>StreamsRead: Return server-shutdown RPC error
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |