Skip to content

Fix freeze rollback for incomplete SCCs#107

Open
mjp41 wants to merge 1 commit into
immutable-mainfrom
immutable_rollback
Open

Fix freeze rollback for incomplete SCCs#107
mjp41 wants to merge 1 commit into
immutable-mainfrom
immutable_rollback

Conversation

@mjp41

@mjp41 mjp41 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

When freeze() failed or restarted from a pre-freeze hook while an SCC was still pending, rollback treated pending SCC state as if it had already been completed. Finish pending SCC bookkeeping from the DFS stack before undoing freeze work, and explicitly discard any incomplete traversal for the current item on ordinary errors.

This also factors shared SCC completion logic, restores rollback for retained weakref references, clears non-GC visited state on rollback, and adds regressions for nested pre-freeze restarts and failed freezes with pending SCCs.

Fixes #100.

When freeze() failed or restarted from a pre-freeze hook while an SCC was still pending, rollback treated pending SCC state as if it had already been completed. Finish pending SCC bookkeeping from the DFS stack before undoing freeze work, and explicitly discard any incomplete traversal for the current item on ordinary errors.

This also factors shared SCC completion logic, restores rollback for retained weakref references, clears non-GC visited state on rollback, and adds regressions for nested pre-freeze restarts and failed freezes with pending SCCs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mjp41 mjp41 requested a review from xFrednet July 14, 2026 10:01
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