-
Notifications
You must be signed in to change notification settings - Fork 110
BF: lock across threads check/instantiation of Flyweight instances #7075
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
Code Climate has analyzed commit 8eaffc4 and detected 0 issues on this pull request. View more on Code Climate. |
As commented added to the comment says we might want (eventually) make locking smarter and per "id" since in principle we should be able to instantiate multiple separate instances in parallel. Might be useful or even critical for parallel "create" and alike. But I think such use-cases are rare so decided to KISS. test added, so disable locking to see how things could go wrong (hint: there is more than 1 way ;) ). Fixes datalad#6598
8eaffc4
to
eed9496
Compare
Codecov ReportBase: 74.92% // Head: 74.92% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## maint #7075 +/- ##
=======================================
Coverage 74.92% 74.92%
=======================================
Files 354 354
Lines 58945 58945
Branches 6310 6310
=======================================
Hits 44164 44164
Misses 14767 14767
Partials 14 14 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View 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.
Thx!
While I am not entirely sure that this was the issue #6598, it seems possible and this locking should be an improvement either way.
_singleton though would have better represented the purpose/mechanics of the test -- to ensure a single instance of each GitRepo in the batch. Co-authored-by: Benjamin Poldrack <bpoldrack@users.noreply.github.com>
I would leave 10% case that indeed it was something else since I do not remember if that test should have somehow instantiated the same dataset at different time points. But from the signature of the failure, and the fact that we get exactly that error of introduced test if you remove locking -- I am almost certain it is the same issue, so I will close it there. |
PR released in |
As commented added to the comment says we might want (eventually) make locking smarter and per "id" since in principle we should be able to instantiate multiple separate instances in parallel. Might be useful or even critical for parallel "create" and alike. But I think such use-cases are rare so decided to KISS. test added, so disable locking to see how things could go wrong (hint: there is more than 1 way ;) ).
Fixes #6598