Conversation
Contributor
Author
|
test-me-please Hit #10565 (comment), other tests passed |
It is possible for the IP deficit resolution to be triggered before the initial CiliumNode resource is asigned to the node. n.resource can be nil in this scenario. Fixes: #10582 Signed-off-by: Thomas Graf <thomas@cilium.io>
Fixes:
```
WARNING: DATA RACE
Write at 0x00c0005b0750 by goroutine 308:
runtime.mapassign_faststr()
/usr/local/go/src/runtime/map_faststr.go:202 +0x0
github.com/cilium/cilium/pkg/aws/eni.UpdateLimitsFromUserDefinedMappings()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/aws/eni/limits.go:269 +0xdf
github.com/cilium/cilium/pkg/aws/eni.(*ENISuite).TestUpdateLimitsFromUserDefinedMappings()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/aws/eni/limits_test.go:47 +0x11d
runtime.call32()
/usr/local/go/src/runtime/asm_amd64.s:539 +0x3a
reflect.Value.Call()
/usr/local/go/src/reflect/value.go:321 +0xd3
gopkg.in/check%2ev1.(*suiteRunner).forkTest.func1()
/home/vagrant/go/src/github.com/cilium/cilium/vendor/gopkg.in/check.v1/check.go:781 +0xa0a
gopkg.in/check%2ev1.(*suiteRunner).forkCall.func1()
/home/vagrant/go/src/github.com/cilium/cilium/vendor/gopkg.in/check.v1/check.go:675 +0xd9
```
Signed-off-by: Thomas Graf <thomas@cilium.io>
Signed-off-by: Thomas Graf <thomas@cilium.io>
Data updates are passed in as pointers, deep copies must be made for
data passed in and for data passed out.
Fixes:
```
WARNING: DATA RACE
Write at 0x00c000276970 by goroutine 31:
github.com/cilium/cilium/pkg/aws/ec2/mock.(*API).AssignPrivateIpAddresses()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/aws/ec2/mock/mock.go:296 +0x4f7
github.com/cilium/cilium/pkg/aws/eni.(*Node).AllocateIPs()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/aws/eni/node.go:253 +0x102
github.com/cilium/cilium/pkg/ipam.(*Node).maintainIPPool()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/ipam/node.go:502 +0xa0d
github.com/cilium/cilium/pkg/ipam.(*Node).MaintainIPPool()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/ipam/node.go:532 +0x90
github.com/cilium/cilium/pkg/ipam.(*NodeManager).Update.func1()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/ipam/node_manager.go:249 +0x8b
github.com/cilium/cilium/pkg/trigger.(*Trigger).waiter()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/trigger/trigger.go:206 +0x4b9
```
```
WARNING: DATA RACE
Read at 0x0000048bffa8 by goroutine 25:
github.com/cilium/cilium/pkg/aws/ec2/mock.(*API).CreateNetworkInterface()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/aws/ec2/mock/mock.go:199 +0x5fd
github.com/cilium/cilium/pkg/aws/eni.(*Node).CreateInterface()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/aws/eni/node.go:387 +0x927
github.com/cilium/cilium/pkg/ipam.(*Node).createInterface()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/ipam/node.go:330 +0x2d4
github.com/cilium/cilium/pkg/ipam.(*Node).maintainIPPool()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/ipam/node.go:516 +0x85d
github.com/cilium/cilium/pkg/ipam.(*Node).MaintainIPPool()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/ipam/node.go:532 +0x90
github.com/cilium/cilium/pkg/ipam.(*NodeManager).Update.func1()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/ipam/node_manager.go:249 +0x8b
github.com/cilium/cilium/pkg/trigger.(*Trigger).waiter()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/trigger/trigger.go:206 +0x4b9
```
```
WARNING: DATA RACE
Read at 0x00c0006aa9f0 by goroutine 30:
github.com/cilium/cilium/pkg/aws/eni/types.(*ENI).DeepCopyInto()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/aws/eni/types/zz_generated.deepcopy.go:60 +0x65
github.com/cilium/cilium/pkg/aws/eni/types.(*ENI).DeepCopy()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/aws/eni/types/zz_generated.deepcopy.go:82 +0x476
github.com/cilium/cilium/pkg/aws/ec2/mock.(*API).GetInstances()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/aws/ec2/mock/mock.go:382 +0x1b8
github.com/cilium/cilium/pkg/aws/eni.(*InstancesManager).Resync()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/aws/eni/instances.go:171 +0x851
github.com/cilium/cilium/pkg/aws/eni.(*ENISuite).TestNodeManagerManyNodes()
/home/vagrant/go/src/github.com/cilium/cilium/pkg/aws/eni/node_manager_test.go:570 +0xaf4
runtime.call32()
/usr/local/go/src/runtime/asm_amd64.s:539 +0x3a
reflect.Value.Call()
/usr/local/go/src/reflect/value.go:321 +0xd3
gopkg.in/check%2ev1.(*suiteRunner).forkTest.func1()
/home/vagrant/go/src/github.com/cilium/cilium/vendor/gopkg.in/check.v1/check.go:781 +0xa0a
gopkg.in/check%2ev1.(*suiteRunner).forkCall.func1()
/home/vagrant/go/src/github.com/cilium/cilium/vendor/gopkg.in/check.v1/check.go:675 +0xd9
```
Signed-off-by: Thomas Graf <thomas@cilium.io>
cf06495 to
6dbaf74
Compare
Contributor
Author
|
test-me-please |
aanm
approved these changes
Mar 17, 2020
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A series of bugfixes discovered while refactoring the IPAM code. No backporting is required. While the data races in the mock code also affect 1.7 and 1.6 branches, it is relatively harmless as we have not seen any unit test flakes so far.
This change is