Skip to content

fix: keep gRPC status reachable from QdrantResourceExhaustedError - #154

Merged
Anush008 merged 2 commits into
qdrant:masterfrom
Goodnight77:fix-resource-exhausted-unwrap
Sep 6, 2026
Merged

fix: keep gRPC status reachable from QdrantResourceExhaustedError#154
Anush008 merged 2 commits into
qdrant:masterfrom
Goodnight77:fix-resource-exhausted-unwrap

Conversation

@Goodnight77

Copy link
Copy Markdown
Contributor

summary

the rate-limit interceptor replaces the server's ResourceExhausted error with QdrantResourceExhaustedError so callers can read RetryAfterS. The wrapper dropped the original error and had no Unwrap, so status.Code(err) returned codes.Unknown instead of codes.ResourceExhausted. Any rate-limit handling written against gRPC codes silently stopped matching.

Fix: keep the original status error inside the wrapper and add Unwrap(). status.Code and errors.As now both work on the same error. No public field changes

Verified with an in-process gRPC server returning ResourceExhausted with a retry-after trailer: status.Code is Unknown on master, ResourceExhausted with this change

Comment thread qdrant/error.go Outdated
Comment on lines +41 to +42
// err is the original gRPC status error, kept so status.Code(err) and
// errors.As still see codes.ResourceExhausted.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// err is the original gRPC status error, kept so status.Code(err) and
// errors.As still see codes.ResourceExhausted.
// the original gRPC status error

Comment thread qdrant/error.go Outdated
return fmt.Sprintf("ResourceExhausted: %s, retry after %d seconds", e.Reason, e.RetryAfterS)
}

// Unwrap returns the underlying gRPC status error.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Unwrap returns the underlying gRPC status error.

@Anush008 Anush008 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🙏

@Anush008
Anush008 merged commit ae79372 into qdrant:master Sep 6, 2026
2 checks passed
@Goodnight77
Goodnight77 deleted the fix-resource-exhausted-unwrap branch September 6, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants