-
Notifications
You must be signed in to change notification settings - Fork 192
Use fslock to acquire lock when reading/writing the tanzu config file for update #2882
Use fslock to acquire lock when reading/writing the tanzu config file for update #2882
Conversation
Cluster Generation A/B Results: |
7e9b5b1
to
c6b8594
Compare
Cluster Generation A/B Results: |
c6b8594
to
fbc15fe
Compare
Cluster Generation A/B Results: |
Codecov Report
@@ Coverage Diff @@
## main #2882 +/- ##
==========================================
- Coverage 43.80% 43.73% -0.08%
==========================================
Files 414 415 +1
Lines 41297 41436 +139
==========================================
+ Hits 18090 18120 +30
- Misses 21512 21613 +101
- Partials 1695 1703 +8
Continue to review full report at Codecov.
|
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
fbc15fe
to
ba1f9c2
Compare
Cluster Generation A/B Results: |
ba1f9c2
to
eba494c
Compare
Cluster Generation A/B Results: |
eba494c
to
c015f66
Compare
Cluster Generation A/B Results: |
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, thanks for the updates
config.AcquireTanzuConfigLock() | ||
defer config.ReleaseTanzuConfigLock() |
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.
Is there a way to do this inside config.GetClientConfig
and config.StoreClientConfig
functions so the callers don't have to worry about it? If I'm using one of those functions, I would ideally expect it to handle all the locking for me.
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.
Unfortunately, I don't think it is possible without refactoring how we are calling this functions because these external functions use config.GetClientConfig
to get the config, update the config as part of the function and use config.StoreClientConfig
to update the config. We would like to have the RW lock for this entire read/write operation.
I am not sure we can reliably add locking mechanism as part of config.GetClientConfig
and config.StoreClientConfig
individually.
Signed-off-by: Anuj Chaudhari <anujc@vmware.com>
c015f66
to
838da0d
Compare
Cluster Generation A/B Results: |
…are-tanzu#2882) Signed-off-by: Anuj Chaudhari <anujc@vmware.com>
…are-tanzu#2882) Signed-off-by: Anuj Chaudhari <anujc@vmware.com>
What this PR does / why we need it
AcquireTanzuConfigLock
andReleaseTanzuConfigLock
using fslock.Which issue(s) this PR fixes
Fixes #2357
Describe testing done for PR
Release note
PR Checklist
Additional information
Special notes for your reviewer