Skip to content

fix: Only complete auto progress after the certified time has been set - #11355

Open
mraszyk wants to merge 1 commit into
masterfrom
mraszyk/auto-progress-certified-time
Open

fix: Only complete auto progress after the certified time has been set#11355
mraszyk wants to merge 1 commit into
masterfrom
mraszyk/auto-progress-certified-time

Conversation

@mraszyk

@mraszyk mraszyk commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Enabling auto progress on a PocketIC instance spawned the progress thread and returned immediately, i.e., before the thread executed its initial SetCertifiedTime operation. Hence, a client could observe a stale certified time right after enabling auto progress (also when creating an instance with auto progress enabled or making an instance live).

Now the progress thread signals via a oneshot channel once the certified time has been set for the first time and ApiState::auto_progress awaits that signal before returning. The instance locks are dropped before awaiting since the progress thread needs them to execute the operation.

Enabling auto progress on a PocketIC instance spawned the progress thread
and returned immediately, i.e., before the thread executed its initial
`SetCertifiedTime` operation. Hence, a client could observe a stale
certified time right after enabling auto progress (also when creating an
instance with auto progress enabled or making an instance live).

Now the progress thread signals via a oneshot channel once the certified
time has been set for the first time and `ApiState::auto_progress` awaits
that signal before returning. The instance locks are dropped before
awaiting since the progress thread needs them to execute the operation.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the fix label Aug 27, 2026
@mraszyk
mraszyk marked this pull request as ready for review August 27, 2026 20:38
@mraszyk
mraszyk requested a review from a team as a code owner August 27, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant