This is an archive of the discontinued Mercurial Phabricator instance.

phabricator: add a config to use curl for communication
ClosedPublic

Authored by quark on Sep 1 2017, 3:21 PM.

Details

Summary

Not sure why, but I got phabsend hang on work network pretty frequently.
The traceback indicates it hangs at _sslobj.do_handshake():

File "mercurial/sslutil.py", line 404, in wrapsocket
  sslsocket = sslcontext.wrap_socket(sock, server_hostname=serverhostname)
File "/usr/lib/python2.7/ssl.py", line 363, in wrap_socket
  _context=self)
File "/usr/lib/python2.7/ssl.py", line 611, in __init__
  self.do_handshake()
File "/usr/lib/python2.7/ssl.py", line 840, in do_handshake
  self._sslobj.do_handshake()

I had tried adding timeout in various places but they seem not effective.
It seems easier to just allow shelling out to curl with retry and timeout
flags.

This could also be helpful for people with an older Python installed without
modern security (SNI).

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

quark created this revision.Sep 1 2017, 3:21 PM
quark updated this revision to Diff 1548.Sep 1 2017, 3:24 PM
quark updated this revision to Diff 1568.Sep 1 2017, 8:29 PM
This revision was automatically updated to reflect the committed changes.
yuja added a subscriber: yuja.Sep 3 2017, 10:22 AM
yuja added inline comments.
contrib/phabricator.py
122

Maybe it's better to insert -- for extra safety.