Repository navigation
fix: make MCP panic logging non-panicking - #66
mukeshbhandarkar wants to merge 1 commit into
Conversation
|
Verified locally (build clean, 123/123 infigraph-mcp tests pass, fmt+clippy clean) — this fix is solid and I was about to merge it, but #57 just merged and both PRs independently added a |
Signed-off-by: mukeshbhandarkar <shell00035@gmail.com>
2b2fb0d to
fb3226b
Compare
|
Thanks @murari316 — rebased onto current |
Summary
Fixes the recursive panic path described in section 1 of #65.
The MCP panic hook currently logs through
eprintln!. If stderr is unavailable or closed,eprintln!can panic while the process is already handling a panic. That re-enters the panic hook and can turn a recoverable panic into a hard abort.This change makes stderr logging best-effort by writing through a locked stderr handle and ignoring write failures.
Changes
mcp_logstderr writes non-panicking/dev/fullto simulate stderr write failureScope
This PR intentionally addresses only the panic-hook recursion from #65.
It does not address the separate OOM, segfault, worker lifecycle, or core-dump-location observations from that issue.
Validation
Passed locally:
cargo fmt --all -- --checkgit diff --checkThe targeted runtime test was attempted locally, but the build was blocked before reaching the MCP test by unrelated native dependency build failures in
usearch/simsimdand thenlbug.The regression test is included so CI can exercise the panic path in the repository's supported build environment.