gRPC

gRPC 8 RESOURCE_EXHAUSTED vs 11 OUT_OF_RANGE

Both gRPC 8 (RESOURCE_EXHAUSTED) and 11 (OUT_OF_RANGE) 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, 11 means that the operation was attempted past the valid range. For example, seeking or reading past the end of a file.

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 operation was attempted past the valid range. For example, seeking or reading past the end of a file.

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

A pagination offset exceeded the available data, or an iterator moved past the end of a collection. Unlike INVALID_ARGUMENT, this depends on the current state of the data.

Cách khắc phục

Check the valid range before making the request. For pagination, use the total count or next-page token to avoid requesting beyond the last page.

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 11: The operation was attempted past the valid range. For example, seeking or reading past the end of a file.

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 11 when a pagination offset exceeded the available data, or an iterator moved past the end of a collection. Unlike INVALID_ARGUMENT, this depends on the current state of the data.

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 11 (OUT_OF_RANGE): Check the valid range before making the request. For pagination, use the total count or next-page token to avoid requesting beyond the last page.

Tìm hiểu thêm