Repository navigation
apply: stop holding the session a second after the apply file exits - #1191
Merged
Merged
Conversation
applyCommand follows the apply file's log with `tail -f --pid`, and GNU tail only checks whether that PID is still alive once per sleep interval, which defaults to a full second. So every apply file, however short, kept its SSH session -- and the `onctl create` or `onctl ssh -a` behind it -- open for up to a second after it had finished. Seen from onctl-runners, where each runner VM is created with a bootstrap script that takes about 0.2s: across five creates the script finished in the guest 1.29-1.35s before `onctl create` returned. With `-s 0.1` a 0.2s script on the same host returns in 0.31s instead of 1.21s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKmJku7417CUEaGfeQRx8C
cdalar
enabled auto-merge (squash)
October 12, 2026 20:51
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1191 +/- ##
=======================================
Coverage 39.79% 39.79%
=======================================
Files 67 67
Lines 7310 7310
=======================================
Hits 2909 2909
Misses 4401 4401 β View full report in Codecov by Harness. π New features to boost your workflow:
|
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.
Problem
applyCommandfollows the apply file's log withtail -f --pid=$pid. GNU tail checks that PID once per sleep interval, and the default interval is one second, so every apply file kept its SSH session open for up to a second after it had finished.onctl create -aandonctl ssh -aboth wait on that session.Measured from onctl-runners, where each runner microVM is created with a bootstrap script that takes about 0.2 s: over five creates, the script's log was last written 1.29β1.35 s before
onctl createreturned.Change
Pass
-s 0.1to tail.Test plan
TestApplyCommandReturnsWhenScriptExits(skips without GNU tail, like the existing apply test)go test ./internal/tools/,go vet,golangci-lint runcleanπ€ Generated with Claude Code
https://claude.ai/code/session_01AKmJku7417CUEaGfeQRx8C