Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a default timeout & connect_timeout to Guzzle #616

Merged
merged 5 commits into from
Nov 18, 2020

Conversation

imjoehaines
Copy link
Contributor

Goal

By default Guzzle has no timeout, meaning it waits indefinitely for requests to finish. This PR applys a very conservative default timeout of 15 seconds to avoid blocking scripts forever*

This is only applied when Bugsnag constructs the Guzzle instance used; if one is provided in the constructor, no timeout will be added (though it can, of course, provide its own timeout value)

Design

To avoid yet more Guzzle version checks, I've consolidated them into a new GuzzleCompat class

Testing

Some basic unit tests check that a timeout is applied by makeGuzzle. Testing the timeout itself is a bit out of scope

@imjoehaines imjoehaines requested a review from kattrali November 17, 2020 14:52
@imjoehaines imjoehaines merged commit 9eee8d0 into next Nov 18, 2020
@imjoehaines imjoehaines deleted the default-guzzle-timeout branch November 18, 2020 16:38
@imjoehaines imjoehaines mentioned this pull request Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants