LLDB server accepts only 4 clients; 5th connection hangs
Nobody has claimed this yet.
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
I’m seeing an issue where the LLDB MCP server appears to accept only 4 client connections. On the 5th run, the server stops responding and the client times out.
How to reproudce
I run the same client sample repeatedly (sequentially).
Each run executes the close/cleanup logic (I have confirmed the close path is reached).
After the 4th successful run, the 5th connection attempt does not get a response from the server, and the client eventually times out.
My Question
Could you please help confirm whether this is:
a limitation/bug in the LLDB server (e.g., max client connections = 4, sockets not being released, etc.), or
an issue in my client close flow (e.g., connection not fully closed, resources leaked, etc.)?
BTW, the log folder /tmp/diagnostics-6c50da is None
New MCP client connected: client_4
LLDB diagnostics will be written to /tmp/diagnostics-6c50da
Please include the directory content when filing a bug report
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
def __init__(self, host: str = "localhost", port: int = 8085, timeout: float = 120.0,
verbose: bool = False):
self.host = host
self.port = port
self.timeout = timeout
self.verbose = verbose
self._sock: Optional[socket.socket] = None
self._request_id = 0
self._recv_buf = b""
def connect(self):
self._sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self._sock.settimeout(self.timeout)
self._sock.connect((self.host, self.port))
self._recv_buf = b""
def close(self):
if self._sock:
try:
self._sock.close()
except OSError:
pass
self._sock = None
self._recv_buf = b""
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the sequential client runs against the LLDB MCP server on port 8085 and observe the fifth connection. Inspect the server-side connection cleanup alongside the client’s close() path, then check whether /tmp/diagnostics-6c50da is populated. Done means identifying whether the hang is caused by server-side connection handling or incomplete client cleanup and documenting the evidence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100