handle _get_updates_cleanup() timeout error#3959
handle _get_updates_cleanup() timeout error#3959guillemap wants to merge 6 commits intopython-telegram-bot:masterfrom
Conversation
This avoids the application to hang at updater.stop() process in some cases where it is stopped using ctrl+c
|
Hi. Thanks for your PR. I guess you mean "potentially fixing #3893" rather than #3397? |
|
I agree. What's happening along these lines of code is that the callback is called with a timeout=0. I don't know exactly why, but in combination with these semi-random conditions (as explained in #3893) the get_updates() tends to throw the TimedOut exception. Then as it's not handled the application hangs and cannot stop properly. My suggestion is to:
|
That is (very roughly) the idea outlined in #3893, yes. Although it's the
As I said above, the additional exception handling does sound like a good idea to be, but I'm not comfortable with putting into place without adressing 1 first. Please also note that a workaround is mentioned in #3893 (comment) |
|
Closing in favor of #3963 |
This prevents the application from hanging at updater.stop() process in some cases where it is stopped using ctrl+c.
The error is found when manually initializing the application to run it alongside other asyncio frameworks, as described here. In this case, sometimes when stopping with crtl+c the app hangs at
await application.updater.stop()and never reachesawait application.stop(), while showing the warning:Potentially fixes #3397