Skip to content

Commit

Permalink
Fix microsoft#314: Occasional missing response to "configurationDone"
Browse files Browse the repository at this point in the history
Don't treat missing response as error, but gracefully finalize the debug session instead.
  • Loading branch information
int19h committed Jul 1, 2020
1 parent be4c063 commit 8384fd0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/debugpy/adapter/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,16 @@ def handle(self, request):
# to conform to the DAP spec, we'll need to defer waiting for response.
try:
self.server.channel.request(request.command, arguments)
except messaging.NoMoreMessages:
# Server closed connection before we could receive the response to
# "configurationDone" - this can happen when debuggee exits shortly
# after starting. It's not an error, but we can't do anything useful
# here at this point, either, so just bail out.
request.respond({})
self.session.finalize(
fmt('{0} disconnected before responding to "configurationDone"', self.server)
)
return
except messaging.MessageHandlingError as exc:
exc.propagate(request)

Expand Down

0 comments on commit 8384fd0

Please sign in to comment.