Skip to content

[BUG] 20.x PTB Hangs unexpectedly when handling large volume of updates #3887

@david8k

Description

@david8k

Steps to Reproduce

  1. Activate the bot
  2. Run it either using polling or with webhooks
  3. Send a massive load of updates
  4. The bot inadvertedly will stop handling updates

Expected behaviour

The bot should keep handling updates or display an error

Actual behaviour

It hangs without displaying any kind of error

Operating System

Ubuntu 22.04

Version of Python, python-telegram-bot & dependencies

PTB 20.5
Python 3.11.4

Relevant log output

No log since it fails silently.

Additional Context

Our team's initial investigation suggests that the bot eventually sort of 'deadlocks' itself. This happens if it is handling a specially large volume of data, but we have seen this behavior to happen with 2 or 3 minutes of functioning without a huge load to process.

The only workaround we have found so far is to restart the whole bot / kill the thread. There's no logs to be displayed. It just hangs after receiving the update.

That update never triggers any handler we have and prevent consequent updates from being processed.

We've proven that when using direct calls to the telegram API, it responds normally. Hence enclosing the possible problem to this dependency.

I'll keep this issue updated if we manage to find something else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions