# HG changeset patch # User Gregory Szorc # Date 2018-08-23 20:50:47 # Node ID 42bc1c70a6b83ee78440e8a81b7ff7466137362c # Parent 98995b689e03fd3d39ace0799d7357d4edba9ef5 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 diff --git a/mercurial/wireprotov2peer.py b/mercurial/wireprotov2peer.py --- a/mercurial/wireprotov2peer.py +++ b/mercurial/wireprotov2peer.py @@ -133,7 +133,12 @@ class clienthandler(object): 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)