Skip to content

fix: keep bad targets, degenerate links and cron steps from aborting the poller - #353

Open
somethingwithproof wants to merge 1 commit into
developfrom
fix/poller-crash-guards
Open

somethingwithproof wants to merge 1 commit into
developfrom
fix/poller-crash-guards

Conversation

@somethingwithproof

Copy link
Copy Markdown
Member

An unrecognised target now counts as no data, the link geometry returns the shared vertex or a zero normal instead of dividing by zero, a new weathermap_data row's first sample gives a zero rate, and schedule fields accept *, N, N-M, lists and /step, with a zero step never matching. The poller hook also catches a failed map run, logs it and releases its lock, and returns instead of calling exit(1) when another run holds the lock.

Tested on PHP 8.5 in Docker. The new tests/Unit/PollerCrashGuardTest.php reproduces each failure and fails without the fix, the full Pest suite passes apart from the two DocumentationExampleHoverTest failures that also fail on develop, and patch coverage is 100%. The CHANGELOG entry is in #352's branch to keep the two PRs from conflicting.

Fixes #351

…the poller

An unrecognised TARGET, a zero-width or doubled-back link, the first sample of a
new weathermap_data row and a */0 schedule each threw out of the poller. Cron
fields now also accept lists and ranges.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
4.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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.

Bad targets, degenerate links, new counter rows and some schedules abort the poller

1 participant