Skip to content

observability: log the ic-persist thread panic cause (closes #585)#604

Merged
ELares merged 1 commit into
mainfrom
obs/585-persist-panic-log
Jul 9, 2026
Merged

observability: log the ic-persist thread panic cause (closes #585)#604
ELares merged 1 commit into
mainfrom
obs/585-persist-panic-log

Conversation

@ELares

@ELares ELares commented Jul 9, 2026

Copy link
Copy Markdown
Owner

What

Closes #585. A panic in the off-thread snapshot dump (ic-persist-<n>, from #588) previously surfaced to the serving shard only as an opaque oneshot RecvError ("save failed"), with the panic CAUSE lost. Now the encode+write runs under catch_unwind, and on a panic the downcast payload (&str/String) is tracing::error!-logged with the shard index, then turned into an io::Error so the save fails cleanly. The DURABLE prior snapshot is intact (manifest-last), so this is a failed save, never data loss. AssertUnwindSafe is sound: the caught closure only READS the frozen Arcs (immutable for the save) + the filesystem, and the frozen slots are dropped regardless.

The backpressure-wait-metric half of #585 is MOOT: the save throttle (#577/#578) was measured to WORSEN the concurrent-snapshot tail and is deprecated for tail use (see #589), so a metric for it is not worth adding.

Tests

persistence suite (10, incl. bgsave_cow_serves_inplace_writes_and_reloads_consistently, bgsave_off_thread_keeps_datapath_low_latency_during_dump) passes; clippy -D warnings (incl. io_other_error -> Error::other) + io_uring build + fmt clean; no dashes. The panic path is a pure add around the existing dump; the normal save path is behavior-unchanged.

Closes #585.

🤖 Generated with Claude Code

A panic in the off-thread snapshot dump (encode bug, filesystem edge) previously
surfaced to the shard only as an opaque oneshot RecvError ("save failed"), with the
panic cause lost. Wrap the encode+write under catch_unwind and tracing::error! the
downcast panic payload before the thread exits, then turn the panic into an io::Error
so the save fails cleanly (the durable prior snapshot is intact, manifest-last).
AssertUnwindSafe is sound: the caught closure only READS the frozen Arcs (immutable
for the save) + the filesystem.

The backpressure-wait-metric half of #585 is moot (the save throttle was measured to
worsen the tail and is deprecated for tail use, see #589).

Closes #585.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Zeke <ezequiel.lares@outlook.com>
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

perf-gate (A5)

Same-runner ratchet of HEAD against the merge-base (both rebuilt and measured in this job).
PASS = within the noise band, WARN = a real move inside budget (does not fail), FAIL = past budget in the bad direction.

metric base head delta% band budget verdict
qps_median (peak) 112268.46 114415.22 1.91% +/-5.00% drop <= 15% PASS
bytes_per_key int 45.16 45.16 0.00% det rise <= 5% PASS
bytes_per_key embstr 60.19 60.19 0.00% det rise <= 5% PASS
bytes_per_key raw 332.51 332.51 0.00% det rise <= 5% PASS

Overall: PASS

  • qps: noisy on shared CI, so the band comes from the base reps spread (floored at 5%); a drop is only a regression past the 15% budget.
  • bytes_per_key: deterministic (allocator-true memmodel), so a tight 5% rise budget; any rise beyond it FAILs.
  • Open-loop tails / criterion micro-benches are reported-not-failed (tail noise is high) and are not part of this ratchet.
  • An intentional perf trade is landed by raising the relevant budget in this PR with a documented reason (CI never auto-commits a baseline).

@ELares
ELares merged commit e14457c into main Jul 9, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

observability: log the persist-thread panic cause + a backpressure-wait metric (#576 PR-B follow-up)

1 participant