-
-
Notifications
You must be signed in to change notification settings - Fork 406
Fix broken pipe during test and gracefully exit the server #4701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
soulomoon
wants to merge
64
commits into
master
from
1875-tests-randomly-fail-with-exception-fd111-hputbuf-resource-vanished-broken-pipe---test-option-j1-workaround
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gracefully exit the server
@soulomoon
soulomoon
changed the title
(削除) Fix broken pip during test (削除ここまで)
(追記) Fix broken pipe during test (追記ここまで)
Aug 22, 2025
...te to use new lsp revision
...111-hputbuf-resource-vanished-broken-pipe---test-option-j1-workaround
...t and progress reporting
Key idea:
- Wait for the refactor loop to finish in shutdown handler.
- After sending the shutdown response, stop sending further response to client. (This is done in lsp)
...ith a more flexible flaky-test-loop script, update test patterns handling, and improve logging and exit code interpretation.
The worker thread checks this flag before dequeuing each job; if set, it exits immediately, ensuring that no new work is started after shutdown is requested. This mechanism is necessary because some downstream code may swallow async exceptions, making 'cancel' unreliable for stopping the thread in all cases. If 'cancel' does interrupt the thread (e.g., while blocked in STM or in a cooperative job), the thread exits immediately and never checks the TMVar; in such cases, the stop flag is redundant.
@soulomoon
soulomoon
changed the title
(削除) Fix broken pipe during test (削除ここまで)
(追記) Fix broken pipe during test and gracefully exit the server (追記ここまで)
Aug 26, 2025
...ly-fail-with-exception-fd111-hputbuf-resource-vanished-broken-pipe---test-option-j1-workaround
@soulomoon
soulomoon
force-pushed
the
1875-tests-randomly-fail-with-exception-fd111-hputbuf-resource-vanished-broken-pipe---test-option-j1-workaround
branch
from
September 5, 2025 18:28
eb5356d
to
773bfee
Compare
...ly-fail-with-exception-fd111-hputbuf-resource-vanished-broken-pipe---test-option-j1-workaround
This reverts commit 773bfee.
What's been done
-
Refactor exit logic
- Previously, shutdown and Shake database cleanup only happened in the shutdown handler.
- Now, the cleanup is moved into the
finally
clause of the reactor thread, ensuring it always runs on reactor exit. - Also adapted to a modified LSP package branch so the server can now gracefully exit. Gracefully exit the server lsp#622 (comment)
-
Improve logging
- Added clearer and more structured logging to aid debugging.
-
Add flakiness testing support
- Introduced a flakiness testing script and CI integration.
- Makes it easier to detect and diagnose flaky behavior in development and CI runs.
@soulomoon
soulomoon
requested review from
michaelpj,
fendor,
jian-lin and
wz1000
as code owners
September 18, 2025 12:45
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
gracefully exit the server