D4440: wireprotov2peer: report exceptions in frame handling against request future
indygreg (Gregory Szorc)
phabricator at mercurial-scm.org
Fri Aug 31 22:57:20 UTC 2018
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
Otherwise the future may never resolve, which could cause deadlock.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D4440
AFFECTED FILES
mercurial/wireprotov2peer.py
CHANGE DETAILS
diff --git a/mercurial/wireprotov2peer.py b/mercurial/wireprotov2peer.py
--- a/mercurial/wireprotov2peer.py
+++ b/mercurial/wireprotov2peer.py
@@ -136,7 +136,12 @@
response = self._responses[frame.requestid]
if action == 'responsedata':
- self._processresponsedata(frame, meta, response)
+ # Any failures processing this frame should bubble up to the
+ # future tracking the request.
+ try:
+ self._processresponsedata(frame, meta, response)
+ except BaseException as e:
+ self._futures[frame.requestid].set_exception(e)
else:
raise error.ProgrammingError(
'unhandled action from clientreactor: %s' % action)
To: indygreg, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list