Skip to content

Replace usage of with await lock (asyncio reactor broken in Python 3.9+)#1270

Open
ramikg wants to merge 1 commit intoapache:trunkfrom
ramikg:fix-asyncio-reactor
Open

Replace usage of with await lock (asyncio reactor broken in Python 3.9+)#1270
ramikg wants to merge 1 commit intoapache:trunkfrom
ramikg:fix-asyncio-reactor

Conversation

@ramikg
Copy link

@ramikg ramikg commented Feb 18, 2026

Trying to connect to Cassandra using the asyncio reactor 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.Lock syntax, removed in Python 3.9.

I've replaced it with async with lock (as suggested by the docs), and now it works.

@ramikg ramikg changed the title Drop usage of with await lock Replace usage of with await lock Feb 22, 2026
@ramikg ramikg changed the title Replace usage of with await lock Replace usage of with await lock (asyncio reactor broken in Python 3.9+) Feb 22, 2026
@absurdfarce
Copy link
Contributor

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!

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.

2 participants