Repository navigation
Sandbox: Await the cli run's server - #130
Merged
Merged
Conversation
why: The release rehearsal failed on the r10 pin PR with "tmux-workspace left a tmux server running: s". kill-server returns before the server has exited, and the server keeps listening for a millisecond or so. The cli build stopped its own server that way and swept its directory at once, so the sweep connected to a server that was leaving and counted it as a leak. The check passed on the guard's own PR by luck of timing. On tmux 3.8a a connect straight after kill-server returned still succeeded in 162 of 200 runs, and the socket stopped answering after a median of 1.2 ms. A tmux whose kill-server takes effect 0.3 s late reproduced the CI message on master ef44575, and the cli build passes with this change. what: - Add LeakedServers.stop, which kills a server and waits for it to stop answering, use it for each server the sweep stops, and expose it to the module-tests builds as stopServer - Have the cli build stop and await its own server before the sweep, where it ignored kill-server's result - Run a probe against a tmux that exits late and require that the sweep finds nothing, and require the cli build to call stopServer
tony
added a commit
that referenced
this pull request
Nov 1, 2026
why: Cut 0.1.2 from master so the test-run sandbox guard (#123) and its cli await fix (#130), the per-module changelogs (#125) and the Kotlin and Scala Server capability directory (#127) ship. The install snippets and the examples' snapshot coordinates need to name the release that ships them. what: - Date the 0.1.2 section (2026-11-01) in the root changelog and in each module's, and keep an empty unreleased section above it; the modules with nothing new say so - Move the install snippets and the examples' snapshot coordinates to 0.1.2 - Set the development version to 0.1.2-SNAPSHOT; libtmuxApiBaseline stays until 0.1.2 is published
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.
Part of #111
The "release rehearsal" job failed on the r10 pin PR with
tmux-workspace left a tmux server running: s(run 41330914569). No server was leaked. The guard from #123 took a server that was still exiting for one, because the cli build swept its run directory straight after stopping its own server.Why
kill-serverreturns before the server has exited, and the server keeps listening for about a millisecond after it does. Themodule-tests/clibuild stopped its server on the explicit socketsthat way and ignored the result, and e4961f20 (a review fix in #123, "Sweep the cli run dir") made the sweep that follows cover the whole directory,sincluded. The sweep connected inside that window, counted the exiting server as a leak, stopped it again and failed the build namings. The job passed on #123's own head by timing luck.Measured, with an isolated server per run on tmux 3.8a: a connect straight after
kill-serverreturned still succeeded in 162 of 200 runs, and the socket stopped answering after a median of 1.2 ms (at most 1.4 ms). The staged rehearsal passed 8 of 8 at masteref44575don this host, because the JVM takes longer than that window to reach the sweep. With atmuxfirst inPATHwhosekill-serverreturns at once and takes effect 0.3 s later, the same build atef44575dfails with exactly the CI message, and with this change it passes and leaves no server. #125 is not involved: it changes jar contents and the staged-release check, notmodule-testsor the workspace CLI.What
LeakedServers.stopkills a server and waits for it to stop answering.LeakedServers.sweepuses it for each server it stops, so its behaviour is unchanged, and it is exposed to the module-tests builds asstopServer.kill-server. What the sweep finds after that is still a leak, so the guard is as strict as before for anything the children leave.Checked
Each break was applied alone and the named test run.
stopreturns without waitinga server still exiting after kill-server is awaited, not swept as a leak, which starts a server through atmuxwhosekill-servertakes effect 0.4 s late and requires the sweep to find nothingstopServerthe cli build scrubs its children, gives them a TMUX_TMPDIR and stops what they leavebuild-logic checkpasses (16TmuxQuarantineTestcases, 3QuarantineGateTest, 2ModuleTestsQuarantineTest, 11 and 4 intest-sandbox). The cli build, run locally against a release staged atef44575d, passed with the late-exitingtmuxand 4 times without it. The probe test cleans up by the server's pid, so a failing run leaves nothing behind. CI's release rehearsal runs the real build.