comparison mercurial/wireprotov2peer.py @ 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 9f51fd22ed50
children 43d92d68ac88
comparison
equal deleted inserted replaced
39484:98995b689e03 39485:42bc1c70a6b8
131 'never told about this request: %r' % frame) 131 'never told about this request: %r' % frame)
132 132
133 response = self._responses[frame.requestid] 133 response = self._responses[frame.requestid]
134 134
135 if action == 'responsedata': 135 if action == 'responsedata':
136 self._processresponsedata(frame, meta, response) 136 # Any failures processing this frame should bubble up to the
137 # future tracking the request.
138 try:
139 self._processresponsedata(frame, meta, response)
140 except BaseException as e:
141 self._futures[frame.requestid].set_exception(e)
137 else: 142 else:
138 raise error.ProgrammingError( 143 raise error.ProgrammingError(
139 'unhandled action from clientreactor: %s' % action) 144 'unhandled action from clientreactor: %s' % action)
140 145
141 def _processresponsedata(self, frame, meta, response): 146 def _processresponsedata(self, frame, meta, response):