feat(api-db): count work-lock failures#3961
Conversation
WorkLock now exposes release and keepalive failures through one bounded counter while retaining each existing diagnostic. - Replaces four error boundaries with Events sharing `carbide_work_lock_failures_total`. - Distinguishes database, command-dispatch, command-reply, and lock-loss failures; releasing an expired lock stays a lock-loss condition rather than a database failure. - Keeps work keys, worker identifiers, and error details in correlated log context instead of metric labels. - Covers all seven reachable `operation`/`failure` series, the `KeepAliveError` mapping, and the production expiry path. Tests added! This supports NVIDIA#3910 Signed-off-by: Chet Nichols III <chetn@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
Summary by CodeRabbit
WalkthroughWork-lock release and keepalive failures now emit structured ChangesWork-lock failure instrumentation
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant WorkLockManager
participant WorkLock
participant KeepAliveLoop
participant carbide_instrument
WorkLockManager->>carbide_instrument: Emit release failure event
WorkLock->>carbide_instrument: Emit release dispatch failure event
KeepAliveLoop->>carbide_instrument: Emit lock-lost or keepalive failure event
carbide_instrument-->>carbide_work_lock_failures_total: Increment labeled counter
Possibly related issues
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai full_review, thanks! |
|
🐇 ✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 6 minutes. |
|
🌿 Preview your docs: https://nvidia-preview-pull-request-3961.docs.buildwithfern.com/infra-controller |
|
@coderabbitai full_review, thanks! |
|
🐇 ✅ Action performedFull review finished. |
WorkLock now exposes release and keepalive failures through one bounded counter while retaining each existing diagnostic.
carbide_work_lock_failures_total.operation/failureseries, theKeepAliveErrormapping, and the production expiry path.Related issues
This supports #3910
Type of Change
Breaking Changes
Testing
Unit tests added/updated
Integration tests added/updated
Manual testing performed
No testing required (docs, internal refactor, etc.)
cargo test -p carbide-api-db work_lock_manager --libcargo make format-nightlycargo make clippycargo make carbide-lintscargo make check-event-namescargo xtask check-metric-docscargo xtask check-workspace-depscargo make check-licensescargo make check-bansAdditional Notes
Expected lock contention and connection-health records remain plain tracing. An expired lock that cannot be released is labeled
lock_lost, notdatabase.