fix(api): handle gRPC unavailable and deadline errors in volume orchestrator retry loop - #3578
Open
chill-czar wants to merge 1 commit into
Open
Conversation
…strator retry loop
chill-czar
requested review from
ValentaTomas,
dobrac and
jakubno
as code owners
August 17, 2026 19:51
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.
Closes #3577
Summary
isRetryableErrorinpackages/api/internal/handlers/volume_util.goto extractstatus.FromError(err)and returntrueforcodes.Unavailable,codes.DeadlineExceeded, andcodes.Canceled.executeOnOrchestratorByClusterIDproperly retries subsequent candidate nodes in the cluster when an orchestrator node is down, unreachable, or timing out.packages/api/internal/handlers/volume_util_test.gocovering standard errors and gRPC status codes.Why
In
packages/api/internal/handlers/volume_util.go, when a volume creation or deletion RPC was attempted on a node that was rebooting or unavailable, gRPC returnedstatus.Error(codes.Unavailable, ...). BecauseisRetryableErroronly checkederrors.Is(err, net.ErrClosed), gRPC status errors evaluated tofalse, causing the loop to abort on the first node rather than failing over to other healthy nodes in the cluster pool.Diff Overview
func isRetryableError(err error) bool { - if errors.Is(err, net.ErrClosed) || errors.Is(err, context.DeadlineExceeded) { + if errors.Is(err, net.ErrClosed) || errors.Is(err, context.DeadlineExceeded) || errors.Is(err, context.Canceled) { return true } + st, ok := status.FromError(err) + if ok { + switch st.Code() { + case codes.Unavailable, codes.DeadlineExceeded, codes.Canceled: + return true + } + } + return false }Test Plan
go test -v ./packages/api/internal/handlers -run TestIsRetryableError(10 test cases verified)go test -v ./packages/api/internal/handlers/...make fmtandmake lintcodes.Unavailable,codes.DeadlineExceeded, andcodes.Canceledreturntruewhile terminal errors returnfalse/cc @jakubno @dobrac @ValentaTomas @arkamar @tvi