This is an archive of the discontinued Mercurial Phabricator instance.

httpclient: honor the timeout when setting up the connection
AbandonedPublic

Authored by simpkins on Jul 13 2017, 12:13 AM.

Details

Reviewers
phillco
durin42
Group Reviewers
hg-reviewers
Summary

Previously HTTPConnection._connect() called socket.create_connection() without
specifying a timeout. This could cause the code to hang forever trying to
establish a connection, even if a timeout parameter was specified when
creating the HTTPConnection object.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

simpkins created this revision.Jul 13 2017, 12:13 AM

LGTM, but I'm not sure how to test it locally.

phillco accepted this revision.Jul 13 2017, 2:10 PM
durin42 requested changes to this revision.Jul 14 2017, 11:53 AM
durin42 added a subscriber: durin42.

httpclient is off by default, and is actually vendored code from https://bitbucket.org/durin42/httpplus - Could you sign https://cla.developers.google.com/about/google-individual and send this patch to httpplus (and then we can update the vendored copy).

Alternatively, httpplus is probably a dead end, and we should instead look into switching to requests (so we pick up Cory Benfield's awesome work on that), so we could just rip out httpclient and everything that requires it...

This revision now requires changes to proceed.Jul 14 2017, 11:53 AM
simpkins abandoned this revision.Aug 23 2017, 5:38 PM