changeset 39485:42bc1c70a6b8

wireprotov2peer: report exceptions in frame handling against request future Otherwise the future may never resolve, which could cause deadlock. Differential Revision: https://phab.mercurial-scm.org/D4440
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 23 Aug 2018 13:50:47 -0700
parents 98995b689e03
children 43d92d68ac88
files mercurial/wireprotov2peer.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/wireprotov2peer.py	Sat Sep 08 21:58:51 2018 +0800
+++ b/mercurial/wireprotov2peer.py	Thu Aug 23 13:50:47 2018 -0700
@@ -133,7 +133,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)