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.

Açıklama

The operation was cancelled, typically by the caller.

Gördüğünüzde

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

Nasıl Düzeltilir

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

Açıklama

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

Gördüğünüzde

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

Nasıl Düzeltilir

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

Temel Farklar

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.

Hangisini Ne Zaman Kullanmalı

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.

Daha Fazla Öğren