Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly reset new TVar values when restoring snapshots #332

Merged
merged 2 commits into from
Dec 28, 2020
Merged

Conversation

barrucadu
Copy link
Owner

Summary

Previously, the setup action for an STM transaction was just the transaction itself. This works fine for replacing SWrites, but not for SNews, as it just creates a new new TVar and doesn't reset the value of the existing one.

This PR records an explicit "effect" of STM transactions to be used in snapshots, in the same way as non-STM effects are replayed when running a snapshot.

This adds the overhead of constructing the effect to every STM transaction, which I worried would be a large cost; but it turns out that the overhead is negligible.

Related issues: fixes #331

This adds the overhead of constructing the effect to every STM
transaction, which I worried would be a large cost; but it turns out
that the overhead is negligible.
@barrucadu barrucadu merged commit 9806335 into master Dec 28, 2020
@barrucadu barrucadu deleted the fix-331 branch December 28, 2020 01: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.

newTVar isn't properly handled in snapshots
1 participant