Potential race condition in HTTP11Connection._expire_at with GIL disabled #1027
Unanswered
ismaelorenstein
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm running httpcore (1.0.9) through httpx (0.28.1) in Python 3.140rc1 free-threaded (ie, with the GIL disabled).
I've noticed an intermittent bug when sending a request in the sync interface:
Seems to be that there is some sort of race condition where the check for
self._expire_at is not None
initially returns true but thenself._expire_at
is set to None at handle_request:76 before thenow > self._expire_at
check runs as that part of the code is not protected by a lockI did this workaround here and it is now working:
Thanks for the awesome library. I wasn't able to isolate the issue in a reproductible snippet yet but let me know if you need it.
Beta Was this translation helpful? Give feedback.
All reactions