-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
introduce debug session model #80
Conversation
094fffc
to
f3808da
Compare
65adba8
to
92b653a
Compare
@Anthony-Eid I think this fixed the race condition you noticed with the configuration done request. So the issue is when the task is created it directly start the execution of the task itself. So the `configuration_done` request is most of the times finished before the breakpoints are send if you don't have a lot of breakpoints. So instead of creating both tasks before the task is created we now create the 2 tasks right after eachother, so we can be sure that the `configuration_done` request is send after the breakpoints are send. ``` [2024-12-25T21:51:09+01:00 DEBUG dap::client] Client 0 received event `Initialized` [2024-12-25T21:51:09+01:00 DEBUG dap::client] Client 0 send `setBreakpoints` request with sequence_id: 3 [2024-12-25T21:51:09+01:00 DEBUG dap::client] Client 0 send `setBreakpoints` request with sequence_id: 4 [2024-12-25T21:51:09+01:00 DEBUG dap::client] Client 0 send `configurationDone` request with sequence_id: 8 [2024-12-25T21:51:09+01:00 DEBUG dap::client] Client 0 send `setBreakpoints` request with sequence_id: 9 [2024-12-25T21:51:09+01:00 DEBUG dap::client] Client 0 send `setBreakpoints` request with sequence_id: 7 [2024-12-25T21:51:09+01:00 DEBUG dap::client] Client 0 send `setBreakpoints` request with sequence_id: 5 [2024-12-25T21:51:09+01:00 DEBUG dap::client] Client 0 received response for: `setBreakpoints` sequence_id: 3 [2024-12-25T21:51:09+01:00 DEBUG dap::client] Client 0 received response for: `setBreakpoints` sequence_id: 4 [2024-12-25T21:51:09+01:00 DEBUG dap::client] Client 0 send `setBreakpoints` request with sequence_id: 6 [2024-12-25T21:51:09+01:00 DEBUG dap::client] Client 0 received response for: `configurationDone` sequence_id: 8 [2024-12-25T21:51:09+01:00 DEBUG dap::client] Client 0 received response for: `setBreakpoints` sequence_id: 9 [2024-12-25T21:51:09+01:00 DEBUG dap::client] Client 0 received response for: `setBreakpoints` sequence_id: 7 [2024-12-25T21:51:09+01:00 DEBUG dap::client] Client 0 received response for: `setBreakpoints` sequence_id: 5 [2024-12-25T21:51:09+01:00 DEBUG dap::client] Client 0 received response for: `setBreakpoints` sequence_id: 6 ``` ``` [2024-12-25T21:49:51+01:00 DEBUG dap::client] Client 0 received event `Initialized` [2024-12-25T21:49:51+01:00 DEBUG dap::client] Client 0 send `setBreakpoints` request with sequence_id: 4 [2024-12-25T21:49:51+01:00 DEBUG dap::client] Client 0 send `setBreakpoints` request with sequence_id: 5 [2024-12-25T21:49:51+01:00 DEBUG dap::client] Client 0 send `setBreakpoints` request with sequence_id: 6 [2024-12-25T21:49:51+01:00 DEBUG dap::client] Client 0 send `setBreakpoints` request with sequence_id: 7 [2024-12-25T21:49:51+01:00 DEBUG dap::client] Client 0 send `setBreakpoints` request with sequence_id: 8 [2024-12-25T21:49:51+01:00 DEBUG dap::client] Client 0 send `setBreakpoints` request with sequence_id: 3 [2024-12-25T21:49:51+01:00 DEBUG dap::client] Client 0 received response for: `setBreakpoints` sequence_id: 4 [2024-12-25T21:49:51+01:00 DEBUG dap::client] Client 0 received response for: `setBreakpoints` sequence_id: 5 [2024-12-25T21:49:51+01:00 DEBUG dap::client] Client 0 received response for: `setBreakpoints` sequence_id: 6 [2024-12-25T21:49:51+01:00 DEBUG dap::client] Client 0 received response for: `setBreakpoints` sequence_id: 7 [2024-12-25T21:49:51+01:00 DEBUG dap::client] Client 0 received response for: `setBreakpoints` sequence_id: 8 [2024-12-25T21:49:51+01:00 DEBUG dap::client] Client 0 received response for: `setBreakpoints` sequence_id: 3 [2024-12-25T21:49:51+01:00 DEBUG dap::client] Client 0 send `configurationDone` request with sequence_id: 9 [2024-12-25T21:49:51+01:00 DEBUG dap::client] Client 0 received response for: `configurationDone` sequence_id: 9 ```
4730d13
to
4cea4e8
Compare
As we don't only merge we also insert if there is no capabilities for the client yet.
We should always shutdown all clients from a single debug session when one is shutdown/terminated.
Hey @gaauwe, could you test if you still have the issue with the port not always being available? This PR should fix this issue, because we shut down now all clients that belong to a single debug session. |
Hi @RemcoSmitsDev! Bit later due to holidays (hope you had a great time as well!), but this seems to work really great. Played a bit around with restarting / closing processes and debugging sessions and it all seems to go well now :D Not sure if this info is helpful; but if I omit the ![]() Showing the task name in the debugger tab itself works also really great: ![]() All in all great work again. Will keep playing around with it as always, but so far so good :D |
@gaauwe No worries, yeah I also had a great time, I also took some time to fix this issue. Great to hear it fixes your issues, and that the UI now is a bit more self explaining. Thanks for the kind words🙂 and for testing it once again!! |
Intro
This pr introduces a new layer called
DebugSession
the debug session is responsible for holding the clients, because we can have more clients for one debug session. Some debug adapter tell us to spawn a new client that should reconnect to the current already spawned debug adapter (first spawned client). This allows us also to show clients under a debug session inside the dap log, so it's more clear for users that we did not start 2 debug session, but we spawned 2 clients.The reason behind this change is that a user had an issue with reverse request, not always both clients are shutting down. So instead of only shutting down the client that the adapter tells us to shut down, we also shut down the main client that spawned the adapter itself.
This PR also fixes a race issue with sending breakpoints and the configuration done request. See bf293f9.
TODO's