Skip to content

Don't lose a wake that follows the last within seconds - #203

Merged
vitramir merged 2 commits into
mainfrom
wake-repeats-by-sleep
Nov 5, 2026
Merged

vitramir merged 2 commits into
mainfrom
wake-repeats-by-sleep

Conversation

@vitramir

@vitramir vitramir commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Implements agynio/architecture#195.

A lost wake. A sign of a wake within 20 seconds of the last was taken for a repeat, measured on the wall clock. A turn can start, end and hibernate again in seconds, so the wake for the next message lands in that window and was dropped. Nothing read the inbox, and the message sat unread until another one came. On the local VM that was the wake 9 seconds after a wake: running idle for over five minutes, until the next message.

Every wake has a sleep behind it, so that is the test now: the signs of one wake have none between them however far apart they come, and two wakes have one however close. The keepalive's clock check uses the same one-second floor, so a sleep shorter than a tick is noticed too if both signals go missing.

A reopened stream. A message published while the Notifications stream was down was announced to nobody, and reopening it read nothing. It now asks for one inbox read. After a wake that means a second read, which finds nothing.

Verified on the local VM with this build in place of the published binary, restoring by copy: 7 wakes in a row, each message sent as soon as the workload had hibernated again, all answered in 1–3 s. The same run on 0.25.0 lost the second wake.

The reopened stream is covered by unit tests only.

A message published while the stream was down was announced to nobody, and
nothing read the inbox until the next message came. The first stream has
nothing before it: the daemon's initial read covers that.
A wake within 20 seconds of the last was taken for a repeat of it, measured
on the wall clock. A fast turn gets there: the workload wakes, answers and
hibernates in seconds, and the next message wakes it again inside the window.
That wake was dropped, so nothing read the inbox and the message sat unread
until another one arrived.

Every wake has a sleep behind it, so that is the test now: the signs of one
wake have none between them however far apart they come, and two wakes have
one however close. The keepalive's clock check uses the same floor, so a sleep
shorter than a tick is seen too when both signals go missing.
@vitramir
vitramir merged commit 883b468 into main Nov 5, 2026
1 of 2 checks passed
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.

1 participant