Skip to content

Commit a82fe75

Browse files
committed
Fix DAP initialization deadlock by making launch request non-blocking
1 parent e4f4868 commit a82fe75

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/daemon/session.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -225,17 +225,11 @@ impl DebugSession {
225225
"Sending DAP launch request"
226226
);
227227

228-
// For Python/debugpy, we need to use non-blocking launch because debugpy
229-
// doesn't respond to launch until after configurationDone is sent.
230-
// We send launch, wait for initialized, send configurationDone, then
231-
// the launch response arrives.
232-
if is_python {
233-
client.launch_no_wait(launch_args).await?;
234-
tracing::debug!("DAP launch request sent (no-wait mode for Python)");
235-
} else {
236-
client.launch(launch_args).await?;
237-
tracing::debug!("DAP launch request successful");
238-
}
228+
// The DAP specification allows adapters to defer the launch response
229+
// until after configurationDone is received. To prevent deadlocks with
230+
// strict adapters (like debugpy and lldb-dap), we use a non-blocking launch.
231+
client.launch_no_wait(launch_args).await?;
232+
tracing::debug!("DAP launch request sent (no-wait mode)");
239233

240234
// Wait for initialized event (comes after launch per DAP spec)
241235
tracing::debug!(timeout_secs = request_timeout.as_secs(), "Waiting for DAP initialized event");

0 commit comments

Comments
 (0)