Race condition when multiple services share the same build repo #33

Closed
opened 2026-02-26 16:03:41 +00:00 by mik-tf · 0 comments
Owner

Context

When two services reference the same git repo in their TOML [build] section (e.g. zinit_openrpc and zinit_http both point to geomind_code/zinit.git), their install steps race on the shared git directory.

The first install clones the repo, builds, and exits. The second install starts milliseconds later, tries git fetch on the same directory, and fails with exit 128 (git lock or shallow clone conflict).

Impact

Non-blocking — the first install's make install builds the entire workspace, so all binaries are already present. The service starts and runs fine despite the install step failing.

Observed

14:54:29.521 — zinit_openrpc.install exits (exit 0)
14:54:29.522 — zinit_http.install starts (1ms later)
14:54:31.417 — zinit_http.install fails (exit 128)

Both services use repo ssh://git@forge.ourworld.tf/geomind_code/zinit.git.

Suggested fix

In install.rs, when generating install commands:

  • If a repo was already cloned and built by a previous service's install, skip the redundant git fetch + build
  • Or serialize install steps for services sharing the same repo URL
  • Or use a file lock around git operations on the same directory
## Context When two services reference the same git repo in their TOML `[build]` section (e.g. `zinit_openrpc` and `zinit_http` both point to `geomind_code/zinit.git`), their install steps race on the shared git directory. The first install clones the repo, builds, and exits. The second install starts milliseconds later, tries `git fetch` on the same directory, and fails with exit 128 (git lock or shallow clone conflict). ## Impact Non-blocking — the first install's `make install` builds the entire workspace, so all binaries are already present. The service starts and runs fine despite the install step failing. ## Observed ``` 14:54:29.521 — zinit_openrpc.install exits (exit 0) 14:54:29.522 — zinit_http.install starts (1ms later) 14:54:31.417 — zinit_http.install fails (exit 128) ``` Both services use repo `ssh://git@forge.ourworld.tf/geomind_code/zinit.git`. ## Suggested fix In `install.rs`, when generating install commands: - If a repo was already cloned and built by a previous service's install, skip the redundant git fetch + build - Or serialize install steps for services sharing the same repo URL - Or use a file lock around git operations on the same directory
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_services#33
No description provided.