-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Moved self._lock initialisation to Pool constructor #3473
Conversation
@@ -1395,7 +1396,6 @@ def get_protocol(self): | |||
return self.connection_kwargs.get("protocol", None) | |||
|
|||
def reset(self) -> None: | |||
self._lock = threading.Lock() |
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.
... So the lock is not re-initialized anymore when calling reset()
? Is that intentional?
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.
Any reasons why we do need to re-initialised lock variable?
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.
There's probably a reason for it to have been in reset()
. I'd look at the call sites for reset()
and figure it out from there...
* Moved self._lock initialisation to Pool constructor * Added test case * Codestyle fixes * Added correct annotations
* Fixed flacky TokenManager test (#3468) * Fixed flacky TokenManager test * Fixed additional flacky test * Removed token count assertion * Skipped test on version 3.9 * Fix incorrect attribute reuse (#3456) add CacheEntry Co-authored-by: zhousheng06 <[email protected]> Co-authored-by: Vladyslav Vildanov <[email protected]> * Expand type for EncodedT (#3472) As of PEP 688, type checkers will no longer implicitly consider bytearray to be compatible with bytes * Moved self._lock initialisation to Pool constructor (#3473) * Moved self._lock initialisation to Pool constructor * Added test case * Codestyle fixes * Added correct annotations * DOC-4423: add TCEs for various command pages (#3476) Co-authored-by: Vladyslav Vildanov <[email protected]> * DOC-4345 added testable JSON search examples for home page (#3407) * DOC-4345 added testable JSON search examples for home page * DOC-4345 avoid possible non-deterministic results in tests * DOC-4345 close connection at end of example * DOC-4345 remove unnecessary blank lines * Adding unit text fixes to improve compatibility with MacOS. (#3486) * Adding unit text fixes to improve compatibility with MacOS. * Applying review comments * Unifying the exception msg validation pattern for both test_connection.py files --------- Co-authored-by: Vladyslav Vildanov <[email protected]> * Add return type to `close` functions (#3496) * Add types to ConnectionPool.from_url (#3495) Co-authored-by: Vladyslav Vildanov <[email protected]> * Add types to execute method of pipelines (#3494) Co-authored-by: Vladyslav Vildanov <[email protected]> * DOC-4796 fixed capped lists example (#3493) Co-authored-by: Vladyslav Vildanov <[email protected]> * typing for client __init__ (#3357) * typing for client __init__ * typing with string literals * retry_on_error more specific typing * retry typing * fix lint --------- Co-authored-by: Vladyslav Vildanov <[email protected]> * test: Updated CredentialProvider test infrastructure (#3502) * test: Updated CredentialProvider test infrastructure * Added linter exclusion * Updated dev dependency * Codestyle fixes * Updated async test infra * Added missing constant * Updated package version * Updated testing versions and docs * Updated server versions * Fixed test --------- Co-authored-by: zs-neo <[email protected]> Co-authored-by: zhousheng06 <[email protected]> Co-authored-by: Shantanu <[email protected]> Co-authored-by: David Dougherty <[email protected]> Co-authored-by: andy-stark-redis <[email protected]> Co-authored-by: petyaslavova <[email protected]> Co-authored-by: Patrick Arminio <[email protected]> Co-authored-by: Artur Mostowski <[email protected]>
Pull Request check-list
Please make sure to review and check all of these items:
NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.
Description of change
Because property initialised outside of constructor, it cannot be re-used in child class without calling another method
Closes #3459