fix(hero_db): silence BrokenPipe ERROR spam on client disconnect #32
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_db!32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/silence-broken-pipe-error"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Two related ERROR-level log-spam bugs in hero_db, both triggered by normal client disconnects mid-response. The servers function correctly; the bugs are invisible from the UI and visible only as noise in
hero_db_server/hero_db_adminlogs. Matches the issue Kristof flagged in chat ("its 10 min to fix hero_db"). Omar correctly reported the admin UI works.Bug 1 —
hero_db_server: BrokenPipe spam (every ~5s)crates/hero_db/src/server.rs:371and:412filter outUnexpectedEofandConnectionResetbut notBrokenPipe. Onmahmoud-ashraf-devboxthis produced:Every 5s for 25+ hours (the admin stats poller closing mid-response). Fix: add
io::ErrorKind::BrokenPipeto the filters on both the TCP and Unix code paths.Bug 2 —
hero_db_admin: hyper connection-error spamcrates/hero_db_admin/src/main.rs:237-241filters out"shutting down","connection closed", and"Connection reset"via substring match but missed"Broken pipe"and"error writing a body". Observed:Fix: lowercase the comparison (so
Broken pipe/broken pipeboth match) and addbroken pipe+error writing a bodyto the benign-disconnect list. Demote message wording from "during shutdown" (no longer accurate) to "Client connection closed".Test plan
cargo check -p hero_dbpassescargo check -p hero_db_adminpasseshero_db_serverinto/home/common/hero/bin/, restarted via hero_procservice.start→Broken pipeERROR events in the last 90s: 0 (was every 5s). Server-side filter alone is sufficient; spam stays gone even with the older admin running.hero_db_adminnot deployed on devbox yet — a fresh build fromdevelopmentHEAD throwsTemplate error: Template 'index.html' not found(HTTP 500). Unrelated to this PR; looks like fallout from5d9aaa5 chore: migrate to hero_admin_lib shared assets. Rolled back to the previous admin binary; admin UI is HTTP 200 again. The Bug 2 fix in this PR is still correct and merge-worthy; deploy on devbox is blocked by that separate issue.Follow-up
File a separate issue / PR for the
hero_db_admintemplate-not-found regression ondevelopmentso this PR can land without waiting on it.Filed the template-not-found regression that's blocking devbox deploy of the
hero_db_adminhalf of this PR: #33. Thehero_db_serverfix in this PR (Bug 1) is unaffected and is fully deployed and verified onmahmoud-ashraf-devbox.