gRPC

gRPC 8 RESOURCE_EXHAUSTED vs 14 UNAVAILABLE

Both gRPC 8 (RESOURCE_EXHAUSTED) and 14 (UNAVAILABLE) belong to the gRPC Status Codes category. 8 indicates that some resource has been exhausted, perhaps a per-user quota, or the entire file system is out of space. Meanwhile, 14 means that the service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff.

Mô tả

Some resource has been exhausted, perhaps a per-user quota, or the entire file system is out of space.

Khi bạn thấy mã này

A rate limit was hit, a quota was exceeded, or the server ran out of memory/disk. Common with API rate limiting and resource quotas.

Cách khắc phục

Implement exponential backoff and retry. If quota-related, request a quota increase or optimize your usage pattern to stay within limits.

Mô tả

The service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff.

Khi bạn thấy mã này

The server is overloaded, shutting down, or a network partition occurred. This is the most common code to retry on, as it's explicitly transient.

Cách khắc phục

Retry with exponential backoff. If persistent, check the server health, load balancer configuration, and network connectivity between client and server.

Sự khác biệt chính

1.

gRPC 8: Some resource has been exhausted, perhaps a per-user quota, or the entire file system is out of space.

2.

gRPC 14: The service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff.

3.

You encounter 8 when a rate limit was hit, a quota was exceeded, or the server ran out of memory/disk. Common with API rate limiting and resource quotas.

4.

You encounter 14 when the server is overloaded, shutting down, or a network partition occurred. This is the most common code to retry on, as it's explicitly transient.

Khi nào dùng cái nào

For 8 (RESOURCE_EXHAUSTED): Implement exponential backoff and retry. If quota-related, request a quota increase or optimize your usage pattern to stay within limits. For 14 (UNAVAILABLE): Retry with exponential backoff. If persistent, check the server health, load balancer configuration, and network connectivity between client and server.

Tìm hiểu thêm