llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-lldb Author: Roy Shi (royitaqi) <details> <summary>Changes</summary> Currently, in Server Mode (i.e. `--connection`), the destroy callbacks of all debuggers are called at the lldb-dap process's termination. This causes delayed logging and release of resources. This can also cause congestion if all debuggers have the same destroy callbacks, which will fight for the same resources (e.g. web requests) at the same time. Instead, these can be done earlier, during the disconnect request handling. This way, as soon as the debug session is over, logging and release of release of resources can happen. Congestion is also naturally avoided, because it's unlikely that all debug sessions finish at the same time. --- Full diff: https://github.com/llvm/llvm-project/pull/156231.diff 1 Files Affected: - (modified) lldb/tools/lldb-dap/Handler/DisconnectRequestHandler.cpp (+5) ``````````diff diff --git a/lldb/tools/lldb-dap/Handler/DisconnectRequestHandler.cpp b/lldb/tools/lldb-dap/Handler/DisconnectRequestHandler.cpp index 8314a1011a57e..0dfa0b28a20a6 100644 --- a/lldb/tools/lldb-dap/Handler/DisconnectRequestHandler.cpp +++ b/lldb/tools/lldb-dap/Handler/DisconnectRequestHandler.cpp @@ -20,6 +20,11 @@ namespace lldb_dap { /// Disconnect request; value of command field is 'disconnect'. Error DisconnectRequestHandler::Run( const std::optional<DisconnectArguments> &arguments) const { + // Destroy the debugger at disconnection. This will trigger the debugger's + // destroy callbacks for earlier logging and clean-ups, rather than waiting + // until the lldb-dap process's termination. + lldb::SBDebugger::Destroy(dap.debugger); + bool terminateDebuggee = !dap.is_attach; if (arguments && arguments->terminateDebuggee) `````````` </details> https://github.com/llvm/llvm-project/pull/156231 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits