detect: an absence is raised when its deadline passes, and after a restart - #5
Merged
Merged
Conversation
…start (varpulis #287) "An order not acknowledged within 4h" waited for the next event that reached the pattern: on subjects that went quiet after the order, it was never raised. And an absence the unit was waiting out when it stopped lost what its negated step waited for in the snapshot, so after the restart the deadline dropped it without an alert. Engine pinned at varpulis 21f3ba4 (#287). e2e/detect D8 (silent subjects) and D9 (kill -9 with the order in the snapshot) fail on v0.3.3 and pass now. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N3K1TGnWTvwYzt9rKuJXES
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
The alert waited for the next event. A detect unit with an absence (
Order as o -> NOT Ack where id == o.id within 4h) raised it only when the next event reached the pattern. On subjects that go quiet after the order, that event never comes, so the alert never did.A restart lost the pending absences. Take an absence the unit was waiting out when it was killed. The snapshot kept the open sequence, but not what its negated step waited for. After the restart the acknowledgement no longer cancelled it, and the deadline dropped it without an alert.
The fix
The engine is pinned at varpulis 21f3ba4 (varpulis/varpulis#287).
VEJAS_IDLE_CLOSE_SECS, v0.3.3).No change to the runtime itself.
Proof on NATS:
e2e/detectVEJAS_BIN=...): nothing.Run locally: every invariant passes on this build (D1–D9). On v0.3.3, D8 and D9 fail and the rest pass.
Docs
concepts/detects.md: an absence is raised when its deadline passes, and a restart does not lose it.🤖 Generated with Claude Code
https://claude.ai/code/session_01N3K1TGnWTvwYzt9rKuJXES