-
Notifications
You must be signed in to change notification settings - Fork 373
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
[Windows] Fix the race condition in ifConfigurator #2253
Conversation
/test-all |
Codecov Report
@@ Coverage Diff @@
## main #2253 +/- ##
==========================================
+ Coverage 61.62% 65.21% +3.59%
==========================================
Files 279 279
Lines 21327 21327
==========================================
+ Hits 13142 13908 +766
+ Misses 6821 6002 -819
- Partials 1364 1417 +53
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
LGTM, I'm not sure why it wasn't done this way to begin with
seems you have a formatting issue
@tnqn is this a fix that needs to be cherry-picked / backported? |
ensureHNSNetwork may be called in parallel but the variable hnsNetwork was not protected by lock, which could lead to data race. This patch fixes it by initializing the variable when ifConfigurator is instantiated. It also removes an unused variable. Signed-off-by: Quan Tian <qtian@vmware.com>
@antoninbas thanks for the review. I think it should be backported. I'm not sure what could happen in worst case with the race condition. |
/test-all |
@tnqn In this case, could you backport it to 0.13, 1.0 and 1.1 as per https://github.com/antrea-io/antrea/blob/main/docs/contributors/cherry-picks.md, once this PR is merged? |
Please correct me if I'm wrong. What if antrea-hnsnetwork is not ready when |
@antoninbas sure. |
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.
Thank you for the explanation. @tnqn
LGTM.
ensureHNSNetwork may be called in parallel but the variable hnsNetwork
was not protected by lock, which could lead to data race. This patch
fixes it by initializing the variable when ifConfigurator is instantiated.
It also removes an unused variable.
Signed-off-by: Quan Tian qtian@vmware.com