Skip to content

Commit 62536ff

Browse files
authored
fix: git collisions on many parallel instances (#42)
1 parent 38de91a commit 62536ff

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/instance_runner/git_operations.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,11 @@ async def prepare_workspace(
124124
sidx = "0"
125125
khash = (instance_id or "")[0:8] or "x"
126126

127-
# Path: {base}/pitaya/${run_id}/i_${sidx}_${khash} (stable across resume suffixes)
128-
workspace_dir = base_dir / f"pitaya/{run_id}/i_{sidx}_{khash}"
127+
# Path: {base}/pitaya/${run_id}/i_${sidx}_${khash}_${iid8}
128+
# Include a short instance_id suffix to avoid collisions when many
129+
# parallel instances share the same durable key (khash).
130+
iid8 = (instance_id or "")[:8] or "x"
131+
workspace_dir = base_dir / f"pitaya/{run_id}/i_{sidx}_{khash}_{iid8}"
129132
else:
130133
# Fallback for standalone usage
131134
workspace_dir = base_dir / f"pitaya/instance_{instance_id}"

0 commit comments

Comments
 (0)