fix(server): suppression of a potential raised exception with running processes manipulation#212
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens local server shutdown by preventing LanguageTool._terminate_server() from raising when the server process is unexpectedly missing from the global _RUNNING_SERVER_PROCESSES tracking list, improving reliability of close()-based cleanup.
Changes:
- Suppress
ValueErroraround_RUNNING_SERVER_PROCESSES.remove(self._server)during server termination. - Document the fix in the changelog.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/language_tool_python/server.py | Makes _terminate_server() resilient to missing process entries in _RUNNING_SERVER_PROCESSES. |
| CHANGELOG.md | Adds a “Fixed” entry describing the shutdown exception prevention. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #212 +/- ##
==========================================
+ Coverage 80.65% 80.66% +0.01%
==========================================
Files 13 13
Lines 1768 1769 +1
==========================================
+ Hits 1426 1427 +1
Misses 342 342 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… processes manipulation
6469c0c to
1e4d0fb
Compare
fix(server): suppression of a potential raised exception with running processes manipulation
Why the pull request was made
To avoid a potential exception raised in the close method of the server, and having a silent close.
Summary of changes
ValueErrorthat can be raised in_RUNNING_SERVER_PROCESSES.removeif our server is not yet or not anymore in this list.Screenshots (if appropriate):
Not applicable.
How has this been tested?
Applied local tests.
Resources
Not applicable.
Types of changes
Checklist