Skip to content
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

Merged
merged 4 commits into from
Jan 6, 2025
Merged

Conversation

vladvildanov
Copy link
Collaborator

@vladvildanov vladvildanov commented Jan 6, 2025

Pull Request check-list

Please make sure to review and check all of these items:

  • Do tests and lints pass with this change?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?
  • Was the change added to CHANGES file?

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

@vladvildanov vladvildanov merged commit 9dfaeae into master Jan 6, 2025
33 checks passed
@vladvildanov vladvildanov deleted the vv-3459-fix branch January 6, 2025 15:23
@@ -1395,7 +1396,6 @@ def get_protocol(self):
return self.connection_kwargs.get("protocol", None)

def reset(self) -> None:
self._lock = threading.Lock()
Copy link
Contributor

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?

Copy link
Collaborator Author

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?

Copy link
Contributor

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'BlockingConnectionPool' object has no attribute '_lock'
2 participants