-
Notifications
You must be signed in to change notification settings - Fork 89
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
ESD-25205: Fix concurrency issue in association resources #425
Conversation
connection, err := api.Connection.Read(connectionID) | ||
if err != nil { | ||
if mErr, ok := err.(management.Error); ok && mErr.Status() == http.StatusNotFound { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
404 checks should not happen on CREATE to prevent Root resource was present, but now absent
errors.
@@ -159,6 +162,10 @@ func readOrganizationMember(ctx context.Context, d *schema.ResourceData, m inter | |||
|
|||
roles, err := api.Organization.MemberRoles(orgID, userID) | |||
if err != nil { | |||
if err, ok := err.(management.Error); ok && err.Status() == http.StatusNotFound { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This 404 check was missed on this read func.
Codecov ReportBase: 86.79% // Head: 86.87% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #425 +/- ##
==========================================
+ Coverage 86.79% 86.87% +0.07%
==========================================
Files 41 42 +1
Lines 9036 9091 +55
==========================================
+ Hits 7843 7898 +55
Misses 924 924
Partials 269 269
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
704cd91
to
c21ef59
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sergiught and I talked this over. We agree this is a push in the right direction and reduces esoteric errors. A similar precedent is already set by the AWS provider.
🔧 Changes
All the association resources are prone to concurrency issues when needing to operate on the same entity. In this PR we are introducing a global mutex to prevent such issues.
📚 References
🔬 Testing
📝 Checklist