Skip to content

fix(hardening): add SIGTERM handler, parking_lot mutex, event size cap#74

Merged
mostafa merged 1 commit into
mainfrom
fix/hardening
May 6, 2026
Merged

fix(hardening): add SIGTERM handler, parking_lot mutex, event size cap#74
mostafa merged 1 commit into
mainfrom
fix/hardening

Conversation

@mostafa
Copy link
Copy Markdown
Member

@mostafa mostafa commented May 6, 2026

Summary

Depends on #71.

  • Add SIGTERM handler alongside ctrl_c for graceful daemon shutdown
  • Replace std::sync::Mutex with parking_lot::Mutex in processor.rs, eliminating 7 .lock().unwrap() call sites
  • Add per-line size cap (1 MB) to /api/v1/events handler, returning 413 Payload Too Large
  • Document the reload channel backpressure design (capacity 4, debounce, try_recv drain)

Test plan

  • cargo check passes with parking_lot::Mutex
  • All existing processor tests pass
  • Manual verification of SIGTERM behavior documented

@mostafa mostafa force-pushed the fix/security-critical branch from c78c56f to 3c8e980 Compare May 6, 2026 10:15
Base automatically changed from fix/security-critical to main May 6, 2026 10:44
- Add shutdown_signal() that handles both SIGINT and SIGTERM on Unix,
  replacing bare ctrl_c() calls in both OTLP and non-OTLP serve paths
- Replace std::sync::Mutex with parking_lot::Mutex in processor.rs,
  eliminating 7 .lock().unwrap() sites that could panic on poisoning
- Add 1MB per-line size cap to /api/v1/events HTTP endpoint to prevent
  memory exhaustion from oversized payloads
- Document reload channel backpressure design (bounded capacity 4 with
  500ms debounce + try_recv drain)
@mostafa mostafa merged commit 3f64706 into main May 6, 2026
14 of 15 checks passed
@mostafa mostafa deleted the fix/hardening branch May 6, 2026 11:19
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.

1 participant