Skip to content

blocking_timeout should default to self.timeout #3728

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jvanasco
Copy link

@jvanasco jvanasco commented Aug 2, 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?
  • [NA] Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • [NA] Is there an example added to the examples folder (if applicable)?

Description of change

Default the blocking_timeout on Lock.acquire to self.timeout.

I ran into a platform specific error, which prevented redis-py from acquiring a Lock. Although the timeout was set, there was no blocking_timeout. This led to a test suite hanging on an infinite loop, minutes longer than the explicit timeout. There is no reason for a blocking_timeout to ever be longer than the normal timeout.

If the acquire succeeds after the Lock.timeout expires, the lock will already fail. This change simply makes that failure instant, and prevents potentially infinite loops.

@jvanasco jvanasco marked this pull request as draft August 2, 2025 15:04
@jvanasco jvanasco marked this pull request as ready for review August 2, 2025 19:51
@jvanasco
Copy link
Author

jvanasco commented Aug 2, 2025

All working tests pass in my repo, except for the same test that is currently failing on the main repo.

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.

1 participant