-
Notifications
You must be signed in to change notification settings - Fork 386
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
Automated cherry pick of #5566 and #5583 Fix deadlock when accessing dirtyRules in fqdn controller #5579
Merged
tnqn
merged 2 commits into
antrea-io:release-1.11
from
luolanzone:automated-cherry-pick-of-#5566-upstream-release-1.11
Oct 17, 2023
Merged
Automated cherry pick of #5566 and #5583 Fix deadlock when accessing dirtyRules in fqdn controller #5579
tnqn
merged 2 commits into
antrea-io:release-1.11
from
luolanzone:automated-cherry-pick-of-#5566-upstream-release-1.11
Oct 17, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tnqn
approved these changes
Oct 16, 2023
/skip-all |
tnqn
requested changes
Oct 16, 2023
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.
incorrect backport
Signed-off-by: Dyanngg <dingyang@vmware.com>
6b1d691
to
0f71f29
Compare
ruleSyncTracker.Run() can update ruleSyncTracker.dirtyRules in-place, while ruleSyncTracker.getDirtyRules() returns the pointer of the set which could be read by other goroutines and leads to a data race like below: WARNING: DATA RACE Write at 0x00c000dd8180 by goroutine 276: runtime.mapdelete_faststr() /usr/local/go/src/runtime/map_faststr.go:301 +0x0 k8s.io/apimachinery/pkg/util/sets.Set[go.shape.string].Delete() /root/go/pkg/mod/k8s.io/apimachinery@v0.26.4/pkg/util/sets/set.go:62 +0x2ae antrea.io/antrea/pkg/agent/controller/networkpolicy.(*ruleSyncTracker).Run() /root/antrea/pkg/agent/controller/networkpolicy/fqdn.go:570 +0x1d2 antrea.io/antrea/pkg/agent/controller/networkpolicy.(*fqdnController).runRuleSyncTracker() /root/antrea/pkg/agent/controller/networkpolicy/fqdn.go:584 +0x4a antrea.io/antrea/pkg/agent/controller/networkpolicy.TestSyncDirtyRules.func1.4() /root/antrea/pkg/agent/controller/networkpolicy/fqdn_test.go:495 +0x44 Previous read at 0x00c000dd8180 by goroutine 271: reflect.maplen() /usr/local/go/src/runtime/map.go:1411 +0x0 reflect.Value.lenNonSlice() /usr/local/go/src/reflect/value.go:1720 +0x324 reflect.Value.Len() /usr/local/go/src/reflect/value.go:1709 +0x158f reflect.deepValueEqual() /usr/local/go/src/reflect/deepequal.go:139 +0x1571 reflect.DeepEqual() /usr/local/go/src/reflect/deepequal.go:237 +0x38b github.com/stretchr/testify/assert.ObjectsAreEqual() /root/go/pkg/mod/github.com/stretchr/testify@v1.8.4/assert/assertions.go:65 +0x172 github.com/stretchr/testify/assert.Equal() /root/go/pkg/mod/github.com/stretchr/testify@v1.8.4/assert/assertions.go:414 +0x1f7 antrea.io/antrea/pkg/agent/controller/networkpolicy.TestSyncDirtyRules.func1() /root/antrea/pkg/agent/controller/networkpolicy/fqdn_test.go:517 +0xb6f testing.tRunner() /usr/local/go/src/testing/testing.go:1595 +0x238 testing.(*T).Run.func1() /usr/local/go/src/testing/testing.go:1648 +0x44 Signed-off-by: Quan Tian <qtian@vmware.com>
0f71f29
to
6852fac
Compare
/test-all |
2 similar comments
/test-all |
/test-all |
tnqn
approved these changes
Oct 17, 2023
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
kind/cherry-pick
Categorizes issue or PR as related to the cherry-pick of a bug fix from the main branch to a release
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry pick of #5566 and #5583 on release-1.11.
#5566: Fix deadlock when accessing dirtyRules in fqdn controller
#5583: Fix data race in FQDN ruleSyncTracker
For details on the cherry pick process, see the cherry pick requests page.