Repository navigation
Document client error retryability - #5
Merged
Merged
Conversation
Parse google.rpc.ErrorInfo from HTTP and gRPC errors, expose reason/operation/retryable metadata, preserve status details through GRPCStatus, and add IsRetryable/ErrorInfo helpers. Add a complete reason, HTTP status, and retry table with idempotency guidance for mutations.
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.
Summary
Follow-up to #4. Documents client error handling and makes retryability explicit in the generated client.
docs/client-errors.mdwith a complete reason/code/HTTP-status/retryability table and retry guidance.request_idfor mutations.google.rpc.ErrorInfofrom HTTP and gRPC errors in the generated client.Error.Reason,Error.OperationID, andError.Retryable, plusError.IsRetryable(),client.IsRetryable(err), andclient.ErrorInfo(err).google.rpc.Statusdetails throughError.GRPCStatus().retryable=falseoverrides, code-based fallback, and ErrorInfo extraction.Retryability notes
ErrorInfo.metadata.retryableis authoritative;IsRetryableuses it and falls back toUnavailable,DeadlineExceeded, andResourceExhaustedwhen metadata is absent.FailedPreconditionmaps to HTTP 400 under grpc-gateway defaults.SESSION_ACTIVEis not immediately retryable; the initiator must log out first.RESOURCE_EXHAUSTEDandADMISSION_REJECTEDrequire backoff until capacity or concurrency changes.IsRetryable; retry those only with the samerequest_idand reconcile state.Validation
go build ./...go vet ./...go test -tags=unit ./...golangci-lint runmake proto(generated client is reproducible)