Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is there a limit on delayed calls like asyncio.call_later to not exceed one day?

https://docs.python.org/3/library/asyncio-eventloop.html#delayed-calls

Note: Timeouts (relative delay or absolute when) should not exceed one day.

Does anyone have a good explanation as to why this limit exists?

Thanks in advance

like image 292
Peter Matev Avatar asked Feb 12 '23 12:02

Peter Matev


1 Answers

This is due to issue 20493:

In asyncio, if the next event is in 2^40 seconds, epoll.poll() raises an OverflowError because epoll_wait() maximum value for the timeout is INT_MAX seconds.

Guido van Rossum suggested that:

For now, can we just add to the asyncio docs that timeouts shouldn't exceed one day? Then we can fix it later without breaking expectations.

It's best to read the full issue log for all details and considerations.

like image 115
Simeon Visser Avatar answered Feb 14 '23 00:02

Simeon Visser