You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Should float("inf") for timeout raise an Overflow error? #102
Traceback (most recent call last):
File "kafka-python/kafka/record/test.py", line 10, in <module>
loop.run_until_complete(test())
File "uvloop/loop.pyx", line 1203, in uvloop.loop.Loop.run_until_complete (uvloop/loop.c:25632)
File "uvloop/future.pyx", line 146, in uvloop.loop.BaseFuture.result (uvloop/loop.c:109361)
File "uvloop/future.pyx", line 101, in uvloop.loop.BaseFuture._result_impl (uvloop/loop.c:108900)
File "uvloop/future.pyx", line 372, in uvloop.loop.BaseTask._fast_step (uvloop/loop.c:112669)
File "kafka-python/kafka/record/test.py", line 7, in test
await asyncio.wait_for(asyncio.sleep(10), timeout=float("inf"))
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/tasks.py", line 362, in wait_for
timeout_handle = loop.call_later(timeout, _release_waiter, waiter)
File "uvloop/loop.pyx", line 1048, in uvloop.loop.Loop.call_later (uvloop/loop.c:23438)
OverflowError: cannot convert float infinity to integer
The problem comes from aio-libs/aiokafka#210, basically, I put in float('inf') for the timeout in wait(fs) call and it worked with vanilla asyncio, but crashed on uvloop. Docs for asyncio don't really specify that timeout needs to be in a specific range. Semantically specifying float('inf') should probably be the same as None (no timeout).
The reasoning for using float('inf') is simple, we can do computations with it and still get a proper float type.
What do you think?
Activity
1st1 commentedon Nov 10, 2017
libuvwon't work withinf. I guess a reasonable option would be to convertinftimeouts to100 years from now.Add support for infinite timeouts. Issue #102.
1st1 commentedon Nov 13, 2017
Fixed in master. Will be in the next uvloop release (0.9.0) soon.
1st1 commentedon Nov 27, 2017
Please try uvloop v0.9.0.