Skip to content

Sentry-python does not set connection timeouts #4247

@aivarsk

Description

@aivarsk

How do you use Sentry?

Sentry Saas (sentry.io)

Version

2.25.1

Steps to Reproduce

When sentry-python tries to report errors during network failures, it may hang up forever while trying to connect.

Expected Result

Inside transport.py both _get_pool_options it should set timeouts to something reasonable like:

        options["timeout"] = urllib3.util.Timeout(connect=5, read=5)

That will allow process to terminate during network failures.

Actual Result

When the PoolManager is created, it gets the default timeout values (https://urllib3.readthedocs.io/en/stable/reference/urllib3.util.html#urllib3.util.Timeout)

Timeout(connect=<_TYPE_DEFAULT.token: -1>, read=<_TYPE_DEFAULT.token: -1>, total=None)

This leads to connect call being made in blocking mode and it might block forever preventing the process to terminate and restart.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions