Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bundled/tool/lsp_jsonrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ def _monitor_process():
del self._processes[workspace]
rpc = self._rpc.pop(workspace)
rpc.close()
except: # pylint: disable=bare-except
except KeyError:
# KeyError is sufficient because the process is already dead

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📍 bundled/tool/lsp_jsonrpc.py:185
The comment misstates the cause of the KeyError. The monitor only runs after proc.wait() returns, so the process is always dead at this point — that's not what triggers the KeyError. The KeyError arises because a concurrent path (e.g. stop_process or a restart's monitor) already removed the _processes/_rpc entries. Reword to e.g. # Another path (e.g. stop_process) may have already removed these entries.

pass

self._thread_pool.submit(_monitor_process)
Expand Down