You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is actually a part of #157 (but this part needs to be solved in the adapter).
I'm up to the point where the part of unblocking threads works in the pydevd side, but I've gotten into some corner cases if during the evaluation another breakpoint is hit in another thread while still answering the evaluation.
Consider the case below where a processor just keeps on echoing what is sent to it (just acknowledging it in obj.event.set(), which the client waits for):
Now, consider that there are breakpoints in break 1 and break 2. With the fix I have, when the user does an evaluation for processor.process('something') while stopped in break 1, it'll (after a timeout) proceed to let other threads run and do the evaluation.
Now, in this case, everything works if there are no other breakpoints hit, but in the example, the user has a break 2 on the processor thread, so, pydevd sends a notification to the client saying that a breakpoint was hit (still before returning the evaluate response) and then, all communication from VSCode<->adapter<->pydevd seems to stop.
By doing a thread dump, it appears that the reason this happens is that the adapter stops everything unil some response is given (and as in this case, the breakpoint was hit during the evaluate, everything stays halted inside the adapter).
From a thread dump (thread_dump.txt), it appears the thread Thread Client[1] message handler is blocked in a wait_for_response and due to that everything is halted (i.e.: the stopped event from pydevd doesn't seem to get to VSCode and a continue from VSCode doesn't get to pydevd).
The text was updated successfully, but these errors were encountered:
Yep, the design is intentionally serialized by default to simplify implementation - we had a lot of trouble properly synchronizing the fully async response handling in ptvsd 4. Where needed, it has to be done on a case-by-case basis, as with "launch" / "attach" (to allow for "initialized" and "configurationDone"). Sounds like it also needs to be done for "evaluate".
int19h
changed the title
debugpy should not block if a response isn't sent in a timely manner
"evaluate" should allow nested messages
Jul 5, 2020
This is actually a part of #157 (but this part needs to be solved in the adapter).
I'm up to the point where the part of unblocking threads works in the
pydevd
side, but I've gotten into some corner cases if during the evaluation another breakpoint is hit in another thread while still answering the evaluation.Consider the case below where a processor just keeps on echoing what is sent to it (just acknowledging it in
obj.event.set()
, which the client waits for):Now, consider that there are breakpoints in
break 1
andbreak 2
. With the fix I have, when the user does an evaluation forprocessor.process('something')
while stopped inbreak 1
, it'll (after a timeout) proceed to let other threads run and do the evaluation.Now, in this case, everything works if there are no other breakpoints hit, but in the example, the user has a
break 2
on the processor thread, so,pydevd
sends a notification to the client saying that a breakpoint was hit (still before returning the evaluate response) and then, all communication fromVSCode<->adapter<->pydevd
seems to stop.By doing a thread dump, it appears that the reason this happens is that the adapter stops everything unil some response is given (and as in this case, the breakpoint was hit during the evaluate, everything stays halted inside the adapter).
From a thread dump (thread_dump.txt), it appears the thread
Thread Client[1] message handler
is blocked in await_for_response
and due to that everything is halted (i.e.: thestopped
event frompydevd
doesn't seem to get toVSCode
and acontinue
fromVSCode
doesn't get topydevd
).The text was updated successfully, but these errors were encountered: