-
Notifications
You must be signed in to change notification settings - Fork 94
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
fix: avoid copying Repository mutex state #364
Conversation
I considered also copying the |
Nice catch! |
Codecov Report
@@ Coverage Diff @@
## main #364 +/- ##
==========================================
+ Coverage 72.16% 72.22% +0.06%
==========================================
Files 42 42
Lines 4092 4105 +13
==========================================
+ Hits 2953 2965 +12
- Misses 857 858 +1
Partials 282 282
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@abursavich Thank you for your contribution and catching this bug. Could you address the review comments accordingly so that we can merged your PR? |
Signed-off-by: Andy Bursavich <abursavich@gmail.com>
@shizhMSFT, PTAL. |
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
Signed-off-by: Andy Bursavich <abursavich@gmail.com>
Signed-off-by: Andy Bursavich <abursavich@gmail.com>
PTAL |
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
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
The
Repository
struct contains mutex state (in thesync.Mutex
andsyncutil.Pool
). When convertingRepositoryOptions
values toRepository
values, this mutex state is copied. This change prevents the internal state from being copied by passingRepositoryOptions
around by reference and explicitly copying the visible fields.