fix(web): single-instance pidfile guard to stop stray web procs on redeploy #115
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_shrimp!115
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_web_pidfile_guard"
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
Fixes redeploy fragility in
hero_shrimp_web: repeated relaunches left several stray processes becauserun_ui()blindly unlinkedweb.sockand bound a fresh inode with no liveness check, so the old process kept serving its orphaned inode. This adds a single-instance pidfile guard, reusing the daemon's provenPidFile(now shared).Related Issue
Closes #46
Changes
PidFileinto the sharedhero_shrimp_types::pidfile(single implementation for daemon + web); generalised the adjacent-socket-to-clear into a parameter.hero_shrimp_types::paths::default_web_pidfile()(web.pid, distinct fromdaemon.pid).hero_shrimp_serverre-exports the shared guard; dropped its now-unusedlibcdep.hero_shrimp_web::run_ui()acquires the guard (force-takeover) before binding and holds it acrossaxum::serve; refuses loudly if a predecessor can't be evicted.docs/getting-started.md.Test Results
cargo test -p hero_shrimp_types: 24 unit + 6 doctests pass, incl. new web-socket takeover and web-pidfile path tests.cargo buildfor the three crates succeeds; server pidfile behaviour unchanged.fix(web): single-instance pidfile guard to stop stray web procs on redeployto WIP: fix(web): single-instance pidfile guard to stop stray web procs on redeployWIP: fix(web): single-instance pidfile guard to stop stray web procs on redeployto fix(web): single-instance pidfile guard to stop stray web procs on redeployf87d3727fato774c2eaae5774c2eaae58ce767e8b8