From 63ea7e317465e9909497ac1bdcbe7a512f6f3eb3 Mon Sep 17 00:00:00 2001 From: Ashwin Bhat Date: Mon, 5 Jan 2026 23:01:39 +0530 Subject: [PATCH] fix: prevent orphaned installer processes from blocking retries (#790) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: prevent orphaned installer processes from blocking retries When the `timeout` command expires during Claude Code installation, it only kills the direct child bash process, not the grandchild installer processes. These orphaned processes continue holding a lock file, causing retry attempts to fail with "another process is currently installing Claude". Add `--foreground` flag to run the command in a foreground process group so all child processes are killed on timeout. Add `--kill-after=10` to send SIGKILL if SIGTERM doesn't terminate processes within 10 seconds. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude * fix: apply same timeout fix to root action.yml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- action.yml | 3 ++- base-action/action.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index f4f8fed..420cadc 100644 --- a/action.yml +++ b/action.yml @@ -213,7 +213,8 @@ runs: for attempt in 1 2 3; do echo "Installation attempt $attempt..." if command -v timeout &> /dev/null; then - timeout 120 bash -c "curl -fsSL https://claude.ai/install.sh | bash -s -- $CLAUDE_CODE_VERSION" && break + # Use --foreground to kill entire process group on timeout, --kill-after to send SIGKILL if SIGTERM fails + timeout --foreground --kill-after=10 120 bash -c "curl -fsSL https://claude.ai/install.sh | bash -s -- $CLAUDE_CODE_VERSION" && break else curl -fsSL https://claude.ai/install.sh | bash -s -- "$CLAUDE_CODE_VERSION" && break fi diff --git a/base-action/action.yml b/base-action/action.yml index b0e866e..97016b7 100644 --- a/base-action/action.yml +++ b/base-action/action.yml @@ -129,7 +129,8 @@ runs: for attempt in 1 2 3; do echo "Installation attempt $attempt..." if command -v timeout &> /dev/null; then - timeout 120 bash -c "curl -fsSL https://claude.ai/install.sh | bash -s -- $CLAUDE_CODE_VERSION" && break + # Use --foreground to kill entire process group on timeout, --kill-after to send SIGKILL if SIGTERM fails + timeout --foreground --kill-after=10 120 bash -c "curl -fsSL https://claude.ai/install.sh | bash -s -- $CLAUDE_CODE_VERSION" && break else curl -fsSL https://claude.ai/install.sh | bash -s -- "$CLAUDE_CODE_VERSION" && break fi