ryanwang520 / aiothrift

AsyncIO (PEP 3156) Thrift support
MIT License
44 stars 12 forks source link

Async-timeout 5 not working correctly with aiothrift 0.2.7 #67

Open cratuki opened 2 weeks ago

cratuki commented 2 weeks ago

I have a distributed system. Nodes talk to one another using aiothrift.

I found one node was not able to connect to other nodes.

Through tracewrites, I was able to find that the path of execution was not entering the scope of line 32 of aiothrift server.py,

with async_timeout.timeout(self.timeout):

This caused me to do a version check of the async-timeout library, and I found the host with problems was running async-timeout==5.0.0, whereas others were running async-timeout==4.0.3. When I changed the problem host to async-timeout==4.0.3, it started to behave correctly again.

This platform is based on Python 3.8.12.

As a quick-fix, you may want to tie the aiothrift dependencies to version 4.0.3 of async-timeout. I do not understand the internals of aiothrift or role of async-timeout well enough to recommend a long-term fix.

cratuki commented 2 weeks ago

These notes talk about the deprecation of async-timeout, and new functionality in python 3.11, https://pypi.org/project/async-timeout/