Repository navigation
Shut-down handles report UNAVAILABLE - #147
Merged
Merged
Conversation
A request submitted to a handle that is not running, or queued for a max_streams slot when the handle shuts down, raised FAILED_PRECONDITION. By gRPC's status code guidance that tells the caller not to retry until the system state is explicitly fixed. A shut-down handle is usually mid-reset (grpc_shutdown then grpc_init, as a caller does to drop a wedged connection), so the call can simply be retried. grpc-java reports calls on a shut-down channel as UNAVAILABLE for the same reason. This also makes the shutdown path consistent: in-flight requests already fail with UNAVAILABLE (previous commit), so a caller racing a reset now sees one retryable code whether its request was in flight, queued or new. A load balancer forwarding through such a handle can fail over on it instead of returning an error to its client. The uninitialized-handle case shares the code because the two states are indistinguishable on the handle; the message still names grpc_init(). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PuqQwzW8mJkyABmduLBbi1
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #147 +/- ##
=======================================
Coverage 92.72% 92.72%
=======================================
Files 8 8
Lines 948 949 +1
=======================================
+ Hits 879 880 +1
Misses 69 69 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fix:
close(grpc)(grpc_shutdown) cleaned up in-flight requests without setting an exception, sogrpc_async_awaitreturned whatever was buffered (usually an empty response) as a success. The same applied to response streams cut off by shutdown. In-flight requests now fail withUNAVAILABLE. This is the fix released in 1.1.2.Behaviour change: a request submitted to a handle that is not running, or queued for a
max_streamsslot when the handle shuts down, now raisesUNAVAILABLEinstead ofFAILED_PRECONDITION. A shut-down handle is usually being reset (grpc_shutdownthengrpc_init), so the call is retryable; gRPC's status guidance reservesFAILED_PRECONDITIONfor "do not retry until state is fixed". grpc-java usesUNAVAILABLEfor calls on a shut-down channel. A caller racing a reset now sees one retryable code whether its request was in flight, queued, or new.An uninitialized handle shares the code, since the handle cannot distinguish it from a shut-down one; the message still names
grpc_init().Changes
src/Curl.jl: setUNAVAILABLEon unfinished requests inclose; useUNAVAILABLEat the three shut-down submission and queue sitesUNAVAILABLECANCELLEDwas incorrect and is removedCallers matching on
FAILED_PRECONDITIONfor a shut-down handle need to update; worth a line in the 1.2 release notes.🤖 Generated with Claude Code