Replace usage of with await lock (asyncio reactor broken in Python 3.9+)#1270
Replace usage of with await lock (asyncio reactor broken in Python 3.9+)#1270absurdfarce merged 1 commit intoapache:trunkfrom
with await lock (asyncio reactor broken in Python 3.9+)#1270Conversation
with await lockwith await lock
with await lockwith await lock (asyncio reactor broken in Python 3.9+)
|
Yup, this looks right to me. Syntax was changed in Python 3.9 so all the versions we're planning on covering for 3.30.0 should be fine with this change. I'm going to kick off a CI run to confirm there aren't any other unexpected regressions here but I think this should work just as it sits. Nice find @ramikg! |
|
Jenkins test run looks clean. @bschoening if I can get a 👍 from you I believe we're good to merge this guy. |
There was a problem hiding this comment.
Pull request overview
Fixes Python 3.9+ compatibility for the asyncio-based Cassandra reactor by replacing deprecated/removed lock-acquisition syntax so write-queue pushes no longer fail silently and connections don’t time out.
Changes:
- Replace
with await self._write_queue_lock:withasync with self._write_queue_lock:in the async write-queue path.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@absurdfarce @ramikg looks good and copilot approves! |
patch by ramikg; reviewed by Bret McGuire and Brad Schoening reference: apache#1270
1460357 to
8830f0e
Compare
Trying to connect to Cassandra using the
asyncioreactor times out in Python 3.9+.This is because pushing messages to the queue silently fails due to the usage of the
with await asyncio.Locksyntax, removed in Python 3.9.I've replaced it with
async with lock(as suggested by the docs), and now it works.