-
Notifications
You must be signed in to change notification settings - Fork 726
Open
Labels
status: help wantedrequesting help from the communityrequesting help from the communitytype: community enhancementfeature request not on Twilio's roadmapfeature request not on Twilio's roadmap
Description
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 overrideSendGridAPIClient.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 aSendGridAPIClient
.Actual
None is available.Technical details:
- sendgrid-python Version: master
- Python Version: 2.7
- python-http-client Version: master
Relevant Link:
- How HTTP Client is created in
SendGridAPIClient
:sendgrid-python/sendgrid/sendgrid.py
Line 75 in 265b984
self.client = python_http_client.Client(host=self.host, - python-http-client: https://github.com/sendgrid/python-http-client/blob/master/python_http_client/client.py#L71
erdnaxeli, franciscoruiz, totobest, tjcutajar, qeternity and 10 more
Metadata
Metadata
Assignees
Labels
status: help wantedrequesting help from the communityrequesting help from the communitytype: community enhancementfeature request not on Twilio's roadmapfeature request not on Twilio's roadmap