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

copy transition state to prevent concurrency issue #382

Closed
wants to merge 19 commits into from

Conversation

gballet
Copy link
Owner

@gballet gballet commented Feb 20, 2024

No description provided.

}

func (db *cachingDB) SetActiveTransitionState(ts *TransitionState) {
db.CurrentTransitionState = ts
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use a lock here?
Despite you tried making the assignment "more atomic" now (all fields at once), this still can have a race.

@gballet
Copy link
Owner Author

gballet commented Feb 22, 2024

The giant lock approach works well enough, this would be considered an optimization. It doesn't make sense to work on it right now as many more changes are going to come in. I'll start again from scratch when needed. Adding a tag and closing.

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.

2 participants