Skip to content

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

Merged
TheWitness merged 2 commits into
developfrom
fix/poller-crash-guards
Nov 13, 2026
Merged

TheWitness merged 2 commits 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>
@alcatron

Copy link
Copy Markdown
Contributor

The crash fixes look good. All 712 PHP tests passed locally, and 732 passed with #352 included.

Found one small issue with the new schedule handling: 5/1 only matches minute 5, whereas the start/step behaviour should match every minute from 5 onwards. I checked minute 6: 5/1 returns false, but 5-59/1 returns true. The upper bound currently depends on $step > 1; it needs to distinguish an explicit /1 from no step. Could you adjust that and add a test for it?

Sonar is also failing on duplication: 4.4% against the 3% limit. Worth clearing that before merging. Those are the two things I found to address.

The dataset rows repeated one shape, which the new-code duplication gate
counted as a copy. The same 15 cases now come from a match table and a miss
table.

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

Copy link
Copy Markdown

@somethingwithproof somethingwithproof added the bug Something isn't working label Nov 13, 2026
@TheWitness
TheWitness merged commit 34ab590 into develop Nov 13, 2026
10 checks passed
@TheWitness
TheWitness deleted the fix/poller-crash-guards branch November 13, 2026 19:41
@somethingwithproof

Copy link
Copy Markdown
Member Author

Thanks for catching the 5/1 case, and sorry it slipped past before merge. It's fixed in #358: an explicit step now always runs to the end of the field, and the schedule test covers 5/1 at minutes 4, 5, 6 and 59.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

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

3 participants