Skip to content

HTTP requests to SendGrid can hang as SendGridAPIClient does not have a timeout. #985

@matheusbrat

Description

@matheusbrat

I'm creating a new issue as the other one was closed but the issue reported on: #757 still happens using sendgrid=6.6.0 and Python 3.7.

Issue Summary

HTTP requests to SendGrid could hang, as SendGridAPIClient has no time out defined in case of a network anomaly.

Steps to Reproduce

This is a bit difficult to reproduce, as it could be caused by a network anomaly (Not necessarily SendGrid's issue).

When a network anomaly occurred, it is possible for API calls to SendGrid to hang indefinitely.

  • By default, the HTTP client's timeout defaults to None.
  • When SendGridAPIClient creates a client, it does not allow a timeout to be passed in.
  • User of the client, unfortunately, has no way to provide a timeout, unless s/he creates a wrapper on top of SendGridAPIClient to override SendGridAPIClient.client or to have an outer wrapper to control timeout.

Expected Behavior
Either a reasonable timeout is set, or a timeout option should be allowed when creating a SendGridAPIClient.

Actual
None is available.

Technical details:

  • sendgrid-python Version: master
  • Python Version: 2.7
  • python-http-client Version: master

Relevant Link:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions