Send the isolation mutex name on the wire's IsolationMutexName field
Summary
-
Bug:
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. -
Decision (semantics): serialise FullIsolation scripts per machine — the safe default — made explicit via a shared
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). - Removed the per-action
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. -
Non-breaking: on a single-machine agent the global lock stays global — serialisation behaviour is unchanged. Only the wire field, the doc comments, and the tests now reflect it. No agent-side change required (it already reads
IsolationMutexName, null-falling-back to"default"); old-server↔️ new-agent and new-server↔️ old-agent both still serialise.
Test plan
-
Unit (red→green): new 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) -
Unit: ScriptIsolationMutexNamesTestspins the format literal + same-machine-same-name / different-machine-different-name (the shared-string invariant deploy⇄upgrade serialisation depends on) -
Unit: both upgrade strategies' isolation-pin tests now assert IsolationMutexName == ForMachine(machineId) -
Removed the stale per-action GenerateMutexNametests + ARCH.7 comments; corrected the ticket test to checkScriptTicket.TaskId(the actual Guid) not the SHA-in-TaskId -
251 affected tests green; broad DeploymentExecution+Deployments+Machines.Upgradesweep 5017/5017 green;dotnet build Squid.sln0 errors -
Tentacle ScriptExecutionsuite: 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)