[RFC] Unified Error Status Model and Panic Policy #63
feichai0017
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
NoKV currently uses plain
error, ad-hoc error strings, andpanicacross different modules. This creates three problems:retryvsconflictvsinternalfailures.engine -> raftstore -> rpc/client).panic.Goal
Define a unified Error Status model and a clear panic policy:
Non-Goals
Proposal (Draft)
1) Unified status codes (
StatusCode)Proposed minimum set:
OKInvalidArgumentNotFoundAlreadyExistsConflictDeadlineExceededUnavailableResourceExhaustedInternal2) Unified status object (
Status)Proposed fields:
CodeMessageCause(optional, internal debugging)Op(optional, operation name)Retryable(optional)3) Panic policy
panicis allowed only for impossible internal invariant violations.Status/Error, notpanic.4) Layered mapping
Status/Error.Migration Plan (Incremental)
statuspackage and mapping helpers first, without changing core behavior.Open Questions
Causebe process-local only, or partially propagated across RPC boundaries?Feedback welcome on:
Beta Was this translation helpful? Give feedback.
All reactions