Skip to content

When restarting the query server wait for the old one to stop properly#4465

Closed
josefs wants to merge 1 commit into
mainfrom
josefs/fix-windows-test-flakiness
Closed

When restarting the query server wait for the old one to stop properly#4465
josefs wants to merge 1 commit into
mainfrom
josefs/fix-windows-test-flakiness

Conversation

@josefs

@josefs josefs commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Some of the Windows tests have been very flaky. I particularly experience that on #4455

The problem is restarting the query server. The current code doesn't wait for the old server to stop properly. On Windows, the old process will hold locks on the file and if the new server starts up too quickly it will fail to open those files.

This PR makes sure to wait for the old server process to close properly (with a timeout, just to be sure) before opening the new one.

I don't know if people are experiencing any problems with this in practice, but it's good to have less flaky tests.

@josefs
josefs marked this pull request as ready for review July 17, 2026 10:00
@josefs
josefs requested a review from a team as a code owner July 17, 2026 10:00
@josefs
josefs requested review from cklin and Copilot July 17, 2026 10:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Ensures query-server restarts wait for the previous process to terminate, reducing Windows file-lock failures.

Changes:

  • Adds process-exit waiting with timeout and forced termination.
  • Uses exit waiting during query-server restarts.
  • Adds unit tests and a changelog entry.
Show a summary per file
File Description
server-process.ts Adds process-exit waiting logic.
query-server-client.ts Waits before starting the replacement server.
server-process.test.ts Tests exit and timeout behavior.
CHANGELOG.md Documents the reliability fix.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Medium

Comment on lines +64 to +65
this.child.kill("SIGKILL");
resolve();
@josefs

josefs commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Closed in favor of #4464

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants