Handled specific exception generated when detaching from the debug session in VS Code using the debug 'disconnect' button. Prevents the ptvsd from becoming unresponsive (#823)

This commit is contained in:
ahaslam 2018-09-21 13:12:44 +12:00 committed by Pavel Minaev
parent d3d334593b
commit c3217df886

View file

@ -890,6 +890,15 @@ class VSCodeMessageProcessorBase(ipcjson.SocketIO, ipcjson.IpcChannel):
_util.lock_release(self._listening)
_util.lock_release(self._connected)
self.close()
except socket.error as exc:
if exc.errno == errno.ECONNRESET:
debug('client socket forcibly closed')
with self._connlock:
_util.lock_release(self._listening)
_util.lock_release(self._connected)
self.close()
else:
raise exc
self.server_thread = _util.new_hidden_thread(
target=process_messages,
name=threadname,