XERK-678: Windows follow-ups — archive-raw path separator + tunnel poke guard - #722
Merged
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
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.
What & why
Two Windows-portability bugs found while driving the native agent on a real Windows host for XERK-678 (both non-fatal — the host runs — but real parity gaps):
#10 — archive-raw path separator (
hub-agent.py)The raw-archive rel-path came from
os.path.relpath, which is backslash-separated on Windows, and the hub'ssafeRawRelsplits on/only — so the hub HTTP 400'd every raw sidecar on Windows (archive raw: the hub refused …\tool-results\x.txt … (HTTP 400)). Fix:_session_filesnormalizes the rel to forward slashes at construction (.replace(os.sep, "/")), and_archivable_relsplits on/so a backslash rel still validates by component. The same normalized rel is the wire key, thearchiveRawHavecursor key, and the local reopen path (os.path.join(proj, rel)— Windows accepts/for opens), so one normalization covers all three. No-op on POSIX (os.sep == "/").#9 — tunnel heartbeat poke (
tunnel-agent.js)pokeHeartbeatdid an unguardedprocess.kill(pid, "SIGUSR1"). On Windows Node that doesn't poke — libuvEINVALs SIGUSR1 or terminates the target — andhub-agent.pyinstalls no SIGUSR1 handler on Windows anyway (already guarded, #719). Fix:pokeHeartbeatreturns early onprocess.platform === "win32"(checked at call time so the suite drives both platforms). The manager beats on its normalTURMA_INTERVAL— the same latency the existing|| 1fallback already accepts.How verified
.replace("/","/")andsplit("/")are identical to the old else-branch;platform !== "win32"so the poke still fires on Linux).test_archivable_rel_accepts_a_windows_backslash_rel— asserts a forward-slash rel under a mocked Windowsos.sep="\\"(the case that actually flows after normalization;Trueon the fix,Falseon the bug). Reverting the split fails the test.pokeHeartbeat is a no-op on Windows(tunnel-agent.test.js) — asserts no signal is sent under a mockedwin32. Removing the guard fails the test.test_hub_agent.py(2136 OK),node --test tunnel-agent.test.js(116/0).qapass caught that the_archivable_reltest was a placebo (it only asserted backslash rels, where fixed and buggy code agree) — a real find; the test now includes the distinguishing forward-slash-under-Windows-os.sepassertion and is mutation-verified.qa-deltare-confirmation in flight.Rules:
windows-agent.md(forward-slash-on-the-wire rule),windows-launcher.md(poke now a Windows no-op).Scope
Follow-up to the merged XERK-678 PRs #719 (manager guards) + #720 (installer). Separate known gap XERK-682 (installer doesn't lay
turma-agent-update.ps1intobin\) is not in this PR.