[Lldb-commits] [lldb] [lldb-dap] Add new optional argument `time-to-live` when using `--connection` (PR #156803)

via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 5 17:48:19 PDT 2025


================
@@ -327,6 +366,11 @@ serveConnection(const Socket::SocketProtocol &protocol, const std::string &name,
       std::unique_lock<std::mutex> lock(dap_sessions_mutex);
       dap_sessions.erase(&loop);
       std::notify_all_at_thread_exit(dap_sessions_condition, std::move(lock));
+
+      // Start the countdown to kill the server at the end of each connection.
----------------
jeffreytan81 wrote:

Also, there seems to be a potential race condition here:
* When last connection timeout, `should_request_terimation` is set to true. 
* Before `loop.RequestTermination()` is called.
* Then a new client starts debugging being Accepted() and calling ResetTimeToLive() and move forward.
* The previous last connection calls `loop.RequestTermination()` and shutdown the server
* The newly accepted client got killed due to server shutdown.


https://github.com/llvm/llvm-project/pull/156803


More information about the lldb-commits mailing list