Skip to content

fix: Address state checkpoint review findings - #1

Merged
erezrokah merged 2 commits into
jpollard-cs:feat/state-checkpointsfrom
cloudquery:fix/state-checkpoints-review
Oct 20, 2026
Merged

erezrokah merged 2 commits into
jpollard-cs:feat/state-checkpointsfrom
cloudquery:fix/state-checkpoints-review

Conversation

@erezrokah

@erezrokah erezrokah commented Oct 20, 2026 •

Copy link
Copy Markdown

Fixes the early sync exit race, keeps every message drained after the post-sync hook, tracks resolver scopes in a ContextVar, schedules a flush's checkpoints atomically, rejects checkpoints from resolvers of an ended sync, and accepts non-string client ids in state_key (follow-up to cloudquery#415).

- Wait for _sync to finish submitting resolvers before ending the sync
- Yield every message left after the post-sync hook
- Track the resolver scope in a ContextVar so copied contexts keep it
- Schedule a flush's checkpoints all or none
- Accept non-string client ids in state_key
- Drop unused _Pending.sent and the redundant root scope in _sync
A Scheduler reused across syncs kept resolvers of a cancelled sync running.
Their flushes went onto the next sync's stream, so the CLI could persist
cursors past the rows it committed.
@erezrokah
erezrokah merged commit 847a92b into jpollard-cs:feat/state-checkpoints Oct 20, 2026
@erezrokah
erezrokah deleted the fix/state-checkpoints-review branch October 20, 2026 12:34
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