Skip to content

syslog poller: lock timeout, signal handler, and earlier partition rotation #298

@somethingwithproof

Description

@somethingwithproof

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions