File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2- HOIST_VERSION=" 1.8.2 "
2+ HOIST_VERSION=" 1.8.3 "
33HOIST_REPO=" KingPin/hoist"
44
55DOCKER_BINARY=" ${DOCKER_BINARY:- $(which docker)} "
@@ -363,7 +363,17 @@ _with_project_lock() {
363363 local fd
364364 exec {fd}> " $lock " || { log " Error: cannot open project lock $lock " ; return 1; }
365365 flock " $fd "
366- " $@ " ; rc=$?
366+ # The flock is held against the open file description, not this process,
367+ # and bash sets no close-on-exec on {var}> fds — so the docker/compose
368+ # child run below would otherwise inherit $fd and keep the lock held even
369+ # after this worker dies. A Ctrl+C mid-`docker compose pull` then orphans
370+ # that pull (reparented to init) holding the inherited fd, wedging every
371+ # later run that touches this project on `flock` forever. Close $fd for
372+ # the command only ({fd}>&-): this worker keeps its own copy open so the
373+ # lock stays held for the pull/up, but the docker child cannot pin it —
374+ # an orphaned pull no longer survives its worker. (Same fd-inheritance
375+ # hazard the run lock handles via its childless holder process.)
376+ " $@ " {fd}>& -; rc=$?
367377 exec {fd}>& -
368378 return " $rc "
369379 fi
You can’t perform that action at this time.
0 commit comments