fix DATA RACE in TestCertRoute#1168
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Continue to review full report in Codecov by Sentry.
|
| time.Sleep(2 * time.Second) | ||
| for { | ||
| cert2 := secretManager.GetCert(identity1) | ||
| secretManager.certsCache.mu.RLock() |
There was a problem hiding this comment.
This code looks strange, cert2 is not protected between secretManager.GetCert(identity1) and this line.
d64aacc to
8557b43
Compare
Signed-off-by: lec-bit <glfhmzmy@126.com>
| secretManager.certsCache.mu.RUnlock() | ||
| break | ||
| } | ||
| secretManager.certsCache.mu.RUnlock() |
There was a problem hiding this comment.
This is not right, you should also consider break in L130
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hzxuzhonghu The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
In response to a cherrypick label: new pull request created: #1178 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #1167
Special notes for your reviewer:
Does this PR introduce a user-facing change?: