gRPC 8 RESOURCE_EXHAUSTED vs 9 FAILED_PRECONDITION
Both gRPC 8 (RESOURCE_EXHAUSTED) and 9 (FAILED_PRECONDITION) 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, 9 means that the operation was rejected because the system is not in a state required for the operation's execution. For example, deleting a non-empty directory.
विवरण
Some resource has been exhausted, perhaps a per-user quota, or the entire file system is out of space.
जब आप इसे देखें
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.
कैसे ठीक करें
Implement exponential backoff and retry. If quota-related, request a quota increase or optimize your usage pattern to stay within limits.
विवरण
The operation was rejected because the system is not in a state required for the operation's execution. For example, deleting a non-empty directory.
जब आप इसे देखें
The request is valid on its own, but the system's current state doesn't allow it — like trying to delete a non-empty directory or update a resource that has been modified concurrently.
कैसे ठीक करें
Bring the system into the required state before retrying. For example, empty the directory first, or re-read the resource to get the latest version before updating.
मुख्य अंतर
gRPC 8: Some resource has been exhausted, perhaps a per-user quota, or the entire file system is out of space.
gRPC 9: The operation was rejected because the system is not in a state required for the operation's execution. For example, deleting a non-empty directory.
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.
You encounter 9 when the request is valid on its own, but the system's current state doesn't allow it — like trying to delete a non-empty directory or update a resource that has been modified concurrently.
कब किसका उपयोग करें
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 9 (FAILED_PRECONDITION): Bring the system into the required state before retrying. For example, empty the directory first, or re-read the resource to get the latest version before updating.