gRPC

gRPC 1 CANCELLED vs 10 ABORTED

Both gRPC 1 (CANCELLED) and 10 (ABORTED) belong to the gRPC Status Codes category. 1 indicates that the operation was cancelled, typically by the caller. Meanwhile, 10 means that the operation was aborted, typically due to a concurrency issue such as a sequencer check failure or transaction abort.

Descripción

The operation was cancelled, typically by the caller.

Cuándo lo verás

The client explicitly cancelled the RPC, or a deadline or context cancellation propagated to the server before it could finish processing.

Cómo solucionarlo

If unexpected, check whether the client is setting too-short deadlines or if cancellation is being triggered inadvertently in your call chain.

Descripción

The operation was aborted, typically due to a concurrency issue such as a sequencer check failure or transaction abort.

Cuándo lo verás

A transaction or optimistic concurrency check failed — for example, a read-modify-write cycle detected a conflict with another concurrent operation.

Cómo solucionarlo

Retry the entire read-modify-write sequence from the beginning. Implement proper optimistic concurrency control with version tokens or ETags.

Diferencias clave

1.

gRPC 1: The operation was cancelled, typically by the caller.

2.

gRPC 10: The operation was aborted, typically due to a concurrency issue such as a sequencer check failure or transaction abort.

3.

You encounter 1 when the client explicitly cancelled the RPC, or a deadline or context cancellation propagated to the server before it could finish processing.

4.

You encounter 10 when a transaction or optimistic concurrency check failed — for example, a read-modify-write cycle detected a conflict with another concurrent operation.

Cuándo usar cada uno

For 1 (CANCELLED): If unexpected, check whether the client is setting too-short deadlines or if cancellation is being triggered inadvertently in your call chain. For 10 (ABORTED): Retry the entire read-modify-write sequence from the beginning. Implement proper optimistic concurrency control with version tokens or ETags.

Saber más