Send the isolation mutex name on the wire's IsolationMutexName field#427
Merged
Conversation
Script dispatch built the agent's isolation mutex name but passed it into StartScriptCommand's taskId parameter (arg 7) instead of isolationMutexName (arg 5), leaving the real field null. The agent then fell back to its single "default" mutex, so the per-action name the code and tests claimed to send never reached the wire and the SHA hash polluted the correlation field. The two upgrade strategies passed null + the ticket id the same way. Decide the semantics and make code, comments and tests agree: serialise FullIsolation scripts per machine — the safe default — made explicit via a shared ScriptIsolationMutexNames.ForMachine used by BOTH deployment dispatch and the upgrade strategies, so every FullIsolation script to a machine (deployment or upgrade) serialises behind one writer lock instead of relying on the accidental null -> "default" fallback. Remove the per-action GenerateMutexName (keyed by serverTaskId, which actually defeated cross- deployment serialisation); taskId now carries the server task id for correlation. Behaviour on a single-machine agent is unchanged (the global lock stays global), but the wire field, the doc comments and the tests now reflect it. Add a test that captures the dispatched StartScriptCommand and asserts IsolationMutexName — the field no prior test pinned, which is why the mis-wiring survived.
ppXD
force-pushed
the
fix/isolation-mutex-name-wiring
branch
from
June 10, 2026 10:02
223b532 to
77b132a
Compare
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.
Summary
HalibutMachineExecutionStrategy(both dispatch sites) built the agent isolation mutex name but passed it intoStartScriptCommand'staskIdparameter (arg 7) instead ofisolationMutexName(arg 5), leaving the wire fieldnull. The agent (ScriptIsolationMutex) then fell back to its single"default"mutex — so the per-action name the code + ARCH.7 docs + tests claimed to send never reached the wire, and the SHA hash polluted the correlation field.Linux/WindowsTentacleUpgradeStrategypassednull+ the ticket id the same way.ScriptIsolationMutexNames.ForMachine(machineId)used by both deployment dispatch and the upgrade strategies. So every FullIsolation script dispatched to a machine (deployment or upgrade) serialises behind one writer lock, instead of relying on the accidentalnull → "default"fallback. Crucially, deployments and upgrades now share the identical name, preserving the deploy⇄upgrade agent-level serialisation (they were both on"default"before; a one-sided change would have split them onto different mutexes).GenerateMutexName(keyed byserverTaskId, which actually defeated cross-deployment serialisation — FullIsolation's whole purpose).taskIdnow carries the server task id for correlation;ResolveParentTraceIdignores it, so this is behaviour-neutral on the agent.IsolationMutexName, null-falling-back to"default"); old-server↔new-agent and new-server↔old-agent both still serialise.Test plan
ExecuteScriptAsync_PassesMachineScopedMutexNameAsIsolationMutexName_NotTaskIdcaptures the dispatchedStartScriptCommandand assertsIsolationMutexName == ForMachine(machineId)+TaskId == ServerTaskId— the wire field no prior test pinned, which is why the mis-wiring survived (confirmed RED before the fix)ScriptIsolationMutexNamesTestspins the format literal + same-machine-same-name / different-machine-different-name (the shared-string invariant deploy⇄upgrade serialisation depends on)IsolationMutexName == ForMachine(machineId)GenerateMutexNametests + ARCH.7 comments; corrected the ticket test to checkScriptTicket.TaskId(the actual Guid) not the SHA-in-TaskIdDeploymentExecution+Deployments+Machines.Upgradesweep 5017/5017 green;dotnet build Squid.sln0 errorsScriptExecutionsuite: 30LocalScriptServiceTestsfail only on a near-full dev disk (DiskSpaceChecker10% floor inStartScript— environmental, agent code untouched by this change, branch-independent; all 30 confirmed disk-spaceIOException, zero mutex-related; pass on CI)