-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Description
Per review feedback on PR #290 (functions.php:285), three improvements are needed for the syslog poller process management:
1. Lock timeout
The GET_LOCK() call in syslog_preprocess_incoming_records() has no timeout. If a process dies while holding the lock, subsequent pollers block indefinitely. Add a reasonable timeout (e.g., 60 seconds) and handle the timeout case.
2. Signal handler
Add pcntl_signal() handlers for SIGTERM/SIGINT that release the lock and call unregister_process() before exiting. Prevents stale locks and orphaned process registrations after unclean shutdowns.
3. Earlier partition rotation
Move partition create/rotate to run ahead of the rotation boundary (e.g., an hour before midnight) instead of at the boundary itself. Avoids contention between ALTER TABLE and concurrent INSERT traffic from incoming syslog messages.
References
- PR Consolidated hardening, bug fixes, and CI improvements #290 review comment from TheWitness (2026-03-21)
functions.phpsyslog_preprocess_incoming_records()functions.phpsyslog_partition_create()