Skip to content

Fix Await hang when log has no checkpoint - #1202

Merged
AlCutter merged 1 commit into
transparency-dev:mainfrom
benbirt:await_no_checkpoint_test
Sep 24, 2026
Merged

AlCutter merged 1 commit into
transparency-dev:mainfrom
benbirt:await_no_checkpoint_test

Conversation

@benbirt

@benbirt benbirt commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

PublicationAwaiter's poll loop previously skipped the rest of the iteration when reading the checkpoint returned os.ErrNotExist, so it never broadcast to waiters. Any Await call made before the log had published its first checkpoint would then block forever, never getting a chance to observe that its ctx had been cancelled or had expired.

Treat a missing checkpoint as "nothing published yet" (size 0, no error) and fall through to the broadcast, so waiters are woken on every poll and can return once their ctx is done.

Adds TestAwait_noCheckpointRespectsContext, which uses testing/synctest to deterministically reproduce the hang.

Fixes #1192.

PublicationAwaiter's poll loop previously skipped the rest of the
iteration when reading the checkpoint returned os.ErrNotExist, so it
never broadcast to waiters. Any Await call made before the log had
published its first checkpoint would then block forever, never getting
a chance to observe that its ctx had been cancelled or had expired.

Treat a missing checkpoint as "nothing published yet" (size 0, no
error) and fall through to the broadcast, so waiters are woken on every
poll and can return once their ctx is done.

Adds TestAwait_noCheckpointRespectsContext, which uses testing/synctest
to deterministically reproduce the hang.

Fixes transparency-dev#1192.
@AlCutter
AlCutter merged commit 6b56fec into transparency-dev:main Sep 24, 2026
20 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.

PublicationAwaiter.Await never returns for log without a checkpoint, regardless of ctx cancellation/expiration

2 participants