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

updater.py: Better handling of timeouts during getUpdates #1007

Merged
merged 2 commits into from Feb 18, 2018

Conversation

Projects
None yet
2 participants
@tsnoam
Member

tsnoam commented Feb 15, 2018

TimedOut exception is an expected an normal event. To reduce noise and
make things more "fluent" we now:

  • Make sure that we don't sleep after the timeout but rather retry
    immediately.
  • Log debug instead of error level.

Fixes #802

updater.py: Better handling of timeouts during getUpdates
TimedOut exception is an expected an normal event. To reduce noise and
make things more "fluent" we now:
 - Make sure that we don't sleep after the timeout but rather retry
immediately.
 - Log debug instead of error level.

Fixes #802

@tsnoam tsnoam requested a review from Eldinnie Feb 15, 2018

@Eldinnie

Generally it looks good. But I'm wondering. This will probably work fine for a shortly interrupted connection, but won't this hog memory when timedout is fired often?

Show outdated Hide outdated telegram/ext/updater.py
@tsnoam

This comment has been minimized.

Show comment
Hide comment
@tsnoam

tsnoam Feb 17, 2018

Member

@Eldinnie
There will be no memory hogging. If you've meant CPU hogging, I don't see how it's possible as if the next get_updates() will be interrupted by:

  1. A detectable network error, then the except TelegramError as te: block will come into affect.
  2. A timeout - the wait itself for the timeout to occur will take enough time to avoid any CPU hogging.
Member

tsnoam commented Feb 17, 2018

@Eldinnie
There will be no memory hogging. If you've meant CPU hogging, I don't see how it's possible as if the next get_updates() will be interrupted by:

  1. A detectable network error, then the except TelegramError as te: block will come into affect.
  2. A timeout - the wait itself for the timeout to occur will take enough time to avoid any CPU hogging.
@Eldinnie

This comment has been minimized.

Show comment
Hide comment
@Eldinnie

Eldinnie Feb 17, 2018

Member

Good, merge after #1006

Member

Eldinnie commented Feb 17, 2018

Good, merge after #1006

@tsnoam

This comment has been minimized.

Show comment
Hide comment
@tsnoam

tsnoam Feb 17, 2018

Member

@Eldinnie Why after?

Member

tsnoam commented Feb 17, 2018

@Eldinnie Why after?

@Eldinnie

This comment has been minimized.

Show comment
Hide comment
@Eldinnie

Eldinnie Feb 18, 2018

Member

@tsnoam not really needed maybe, but that will make CI pass. And I prefer t if master passes CI

Member

Eldinnie commented Feb 18, 2018

@tsnoam not really needed maybe, but that will make CI pass. And I prefer t if master passes CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment