From 13672e032ad83f7a624cb64df6552f2f4d2f328c Mon Sep 17 00:00:00 2001 From: Aseem Shrey Date: Sat, 7 Feb 2026 15:21:28 -0500 Subject: [PATCH] fix(worker): revert deterministic volume naming, restore unique per-node names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The deterministic naming from f8caa000 made every node in the same workflow run share one Docker volume name. Parallel branches can overwrite each other's files and cleanup can remove the volume while another branch is still using it. Restore timestamp-based naming in initialize() so each node gets a unique volume. Remove deriveVolumeName() — downstream components (scanners) should receive the volume name from clone-repo's output via the workflow graph instead of deriving it. Signed-off-by: Aseem Shrey --- worker/src/utils/isolated-volume.ts | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/worker/src/utils/isolated-volume.ts b/worker/src/utils/isolated-volume.ts index 53e35ee8..ea630470 100644 --- a/worker/src/utils/isolated-volume.ts +++ b/worker/src/utils/isolated-volume.ts @@ -50,19 +50,6 @@ export class IsolatedContainerVolume { } } - /** - * Derives the deterministic volume name for a given tenant and run. - * Downstream components can use this to reference an existing volume - * created by an upstream component in the same workflow execution. - * - * @param tenantId - Tenant identifier - * @param runId - Unique run/execution identifier - * @returns The volume name (e.g., `tenant-foo-run-bar`) - */ - static deriveVolumeName(tenantId: string, runId: string): string { - return `tenant-${tenantId}-run-${runId}`; - } - /** * Creates the isolated volume and populates it with files. * @@ -85,9 +72,10 @@ export class IsolatedContainerVolume { }); } - // Create deterministic volume name from tenantId + runId - // runId is unique per workflow execution, so no timestamp needed - this.volumeName = IsolatedContainerVolume.deriveVolumeName(this.tenantId, this.runId); + // Create unique volume name with timestamp to prevent collisions + // when parallel nodes in the same run each create their own volume. + const timestamp = Date.now(); + this.volumeName = `tenant-${this.tenantId}-run-${this.runId}-${timestamp}`; try { // Create the volume with labels for tracking