Skip to content

Commit 63ea7e3

Browse files
authored
fix: prevent orphaned installer processes from blocking retries (#790)
* 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 <noreply@anthropic.com> * fix: apply same timeout fix to root action.yml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 653f9cd commit 63ea7e3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ runs:
213213
for attempt in 1 2 3; do
214214
echo "Installation attempt $attempt..."
215215
if command -v timeout &> /dev/null; then
216-
timeout 120 bash -c "curl -fsSL https://claude.ai/install.sh | bash -s -- $CLAUDE_CODE_VERSION" && break
216+
# Use --foreground to kill entire process group on timeout, --kill-after to send SIGKILL if SIGTERM fails
217+
timeout --foreground --kill-after=10 120 bash -c "curl -fsSL https://claude.ai/install.sh | bash -s -- $CLAUDE_CODE_VERSION" && break
217218
else
218219
curl -fsSL https://claude.ai/install.sh | bash -s -- "$CLAUDE_CODE_VERSION" && break
219220
fi

base-action/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ runs:
129129
for attempt in 1 2 3; do
130130
echo "Installation attempt $attempt..."
131131
if command -v timeout &> /dev/null; then
132-
timeout 120 bash -c "curl -fsSL https://claude.ai/install.sh | bash -s -- $CLAUDE_CODE_VERSION" && break
132+
# Use --foreground to kill entire process group on timeout, --kill-after to send SIGKILL if SIGTERM fails
133+
timeout --foreground --kill-after=10 120 bash -c "curl -fsSL https://claude.ai/install.sh | bash -s -- $CLAUDE_CODE_VERSION" && break
133134
else
134135
curl -fsSL https://claude.ai/install.sh | bash -s -- "$CLAUDE_CODE_VERSION" && break
135136
fi

0 commit comments

Comments
 (0)