Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async Telebot retries immediately when it runs into a bad gateway error, potentially flooding the API #2327

Closed
All-The-Foxes opened this issue Jun 30, 2024 · 2 comments

Comments

@All-The-Foxes
Copy link

All-The-Foxes commented Jun 30, 2024

I'm using pyTelegramBotAPI version 4.20 on Ubuntu Noble (24.04 LTS) with Python 3.12. When async Telebot receives a bad gateway response from Telegram, it will retry immediately and log an unhandled exception. My own code logs the bad gateway error and then sleeps for 5 seconds. During this sleep, several more error messages per second about this unhandled exception will continue to be logged by async Telebot if the server's connection remains unstable, meaning Telebot itself is trying to reconnect over and over and over again for polling without waiting first. This not only floods the API, but it also generates massive log files full of complete garbage and spams the logging output.

simplescreenrecorder-2024-06-30_14.21.42.mp4
@coder2020official
Copy link
Collaborator

Yep, this was reported. Thanks again, I will fix it ASAP

@coder2020official
Copy link
Collaborator

coder2020official commented Jul 3, 2024

#2332 should fix it, it introduces an error interval which increases twice after each unsuccessful getupdates request, until it reaches its maximum of 60 seconds.
image
telegram-cloud-photo-size-2-5202210109021872598-y

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

No branches or pull requests

2 participants