fix: suppress context cancellation errors during graceful shutdown#153
fix: suppress context cancellation errors during graceful shutdown#153
Conversation
When the gravity client is shut down gracefully (context cancelled), the gRPC streams return 'context canceled' errors. These are expected during shutdown and should not be logged at ERROR level. Changes: - Add isContextCanceled() helper to detect context cancellation from various sources (direct context.Canceled, gRPC codes.Canceled) - Check for context cancellation in Start() before logging errors - Log at DEBUG level instead of ERROR for graceful shutdown - Return context.Canceled cleanly to allow callers to handle it Fixes: agentuity/sdk#775
📝 WalkthroughWalkthroughThe change introduces context cancellation detection in the gRPC client startup flow. A new Changes
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (5)
✏️ Tip: You can disable this entire section by setting Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Comment |
Summary
Fixes context cancellation errors being logged at ERROR level during graceful shutdown of the gravity client.
Changes
isContextCanceled()helper function to detect context cancellation errors (including wrapped errors)Start()method to log context cancellation at DEBUG level instead of ERRORfailed to establish control stream: context canceledduring normal shutdownRelated
gravityandsdkreposSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.