Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix race conditions uncovered with -race #7253

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

Merged
merged 3 commits into from
May 7, 2025

Conversation

begelundmuller
Copy link
Contributor

Attaching screenshots of the two race conditions this PR addresses.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!
Screenshot 2025-04-28 at 14 26 07 Screenshot 2025-04-23 at 22 49 12

@begelundmuller begelundmuller self-assigned this May 1, 2025
@begelundmuller begelundmuller requested a review from k-anshul May 1, 2025 17:44
// Clone for editing
tmp := *inst
inst = &tmp
inst.ProjectConnectors = projConns

return r.EditInstance(ctx, inst, false)
Copy link
Member

Choose a reason for hiding this comment

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

IMO this entire workflow is somewhat hacky. Ideally EditInstance should take another struct as input and return a new object scanned from DB.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, not going to fix now, but would be nice to improve the instance management logic

@begelundmuller begelundmuller merged commit f7ac4c8 into main May 7, 2025
9 checks passed
@begelundmuller begelundmuller deleted the begelundmuller/fix-race-conditions branch May 7, 2025 16: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.

2 participants