-
Notifications
You must be signed in to change notification settings - Fork 260
fix: repair windows cni lock issue #1712
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
Conversation
12b7b4c to
9d6145d
Compare
tamilmani1989
left a comment
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.
I'm also thinking..we should add these changes under a config field somethinng like "optimizeLock" so that we can release only to customers we want and also revert back easily for any mitigation
51bfd0d to
c9919e2
Compare
e205c74 to
4146ac6
Compare
ae3512f to
b44ff46
Compare
cni/plugin.go
Outdated
|
|
||
| // Lock key-value store for Windows Runtime. This function is being used for locking access to TelemetryService start. | ||
| func (plugin *Plugin) LockKeyValueStore() error { | ||
| if runtime.GOOS == "windows" { |
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.
can we move this condition to a place where we call LockKeyValueStore()
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.
addressed in the new commit
telemetry/telemetrybuffer.go
Outdated
| tb.Cleanup(FdName) | ||
| StartTelemetryService(path, args) | ||
| WaitForTelemetrySocket(telemetryNumRetries, time.Duration(telemetryWaitTimeInMilliseconds)) | ||
| if err = netPlugin.UnLockKeyValueStore(); err != nil { |
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.
unlock only if windows
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.
addressed in the new commit
b44ff46 to
5915954
Compare
5915954 to
276d2cf
Compare
tamilmani1989
left a comment
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
…ve functions to improve cni performance on windows.
…n startup for CRD and MultitenantCRD mode.
276d2cf to
47b69a3
Compare
* Moving the lock from InitializeKeyValueStore() function to restore/save functions to improve cni performance on windows. * fix: use defer function to unlock statefile. * fix: fixing the IPAM lock and defer func * fix: Optimizing cni file lock by moving SetSdnRemoteArpMacAddress() on startup for CRD and MultitenantCRD mode. * adding store lock on telemetry service start to avoid race condition on windows.
* Moving the lock from InitializeKeyValueStore() function to restore/save functions to improve cni performance on windows. * fix: use defer function to unlock statefile. * fix: fixing the IPAM lock and defer func * fix: Optimizing cni file lock by moving SetSdnRemoteArpMacAddress() on startup for CRD and MultitenantCRD mode. * adding store lock on telemetry service start to avoid race condition on windows.
* Moving the lock from InitializeKeyValueStore() function to restore/save functions to improve cni performance on windows. * fix: use defer function to unlock statefile. * fix: fixing the IPAM lock and defer func * fix: Optimizing cni file lock by moving SetSdnRemoteArpMacAddress() on startup for CRD and MultitenantCRD mode. * adding store lock on telemetry service start to avoid race condition on windows.
This reverts commit 7b647be.
This reverts commit 7b647be.
Moving the lock from InitializeKeyValueStore() function to restore/save functions to improve cni performance on windows.
Reason for Change:
In Windows CNI We are currently lock access to statefile in the init phase which may cause some CNI performance issue. This PR will move the lock to the exact point when we read/write from/to statefile.