-
Notifications
You must be signed in to change notification settings - Fork 726
Closed
Labels
difficulty: mediumfix is medium in difficultyfix is medium in difficultystatus: 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
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
SendGridAPIClientcreates 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
SendGridAPIClientto overrideSendGridAPIClient.clientor 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:
- 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
Metadata
Metadata
Assignees
Labels
difficulty: mediumfix is medium in difficultyfix is medium in difficultystatus: help wantedrequesting help from the communityrequesting help from the communitytype: community enhancementfeature request not on Twilio's roadmapfeature request not on Twilio's roadmap