fix(app-server): stop skills watcher on shutdown#23557
Closed
fcoury-oai wants to merge 1 commit into
Closed
Conversation
Contributor
Author
|
Superseded by #23578. |
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
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.
Why
Pressing
Ctrl+Cin the TUI could make Codex take about 5 seconds to exit.Shutdown tracing showed that the delay was the in-process app-server waiting for its outbound task to finish until the shutdown timeout elapsed. The remaining outbound sender owner was consistently
skills_watcher.event_loop.The app-server-owned watcher task captured
Arc<OutgoingMessageSender>and waited indefinitely on file-watch events, so shutdown could not close the outbound channel promptly.What Changed
SkillsWatcher.skills_watcher.shutdown()fromMessageProcessor::clear_runtime_references()during app-server teardown.This lets the watcher task drop its
OutgoingMessageSenderclone during shutdown, so the outbound channel closes without waiting for the 5 second timeout.How to Test
Ctrl+C.Focused regression check from the shutdown investigation:
app_server.runtime.wait_outbound_handle,app_server_runtime.wait_shutdown_ack, andapp_server_client.wait_shutdown_response.app_server.runtime.wait_outbound_handlecompleted in0ms.Local validation:
just fmtgit diff --checkLocal lint note:
just argument-comment-lintdid not reach this diff because local Bazel analysis failed in externalllvm/ BuildBuddy setup before the linter ran.