Skip to content

Conversation

@ldez
Copy link
Member

@ldez ldez commented Mar 4, 2025

The context.WithTimeout doesn't kill a command when the command is stuck because CombinedOutput is waiting for a "pause".

The previous implementation was able to stop the hook if the script was too long, but not stuck on one element (cf test: sleepy.sh).

But it was not able to stop the hook if the script was waiting for a long (never-ending) process (cf test: sleeping_beauty.sh).

I modified the code to add a timer that kills the current process if the timeout is reached.

This implementation has another advantage: the output of the hook will be live streamed to the console.

Fixes #2468

@ldez ldez added this to the unreleased milestone Mar 4, 2025
@ldez ldez requested a review from dmke March 4, 2025 23:01
@ldez ldez force-pushed the fix/hook-timeout branch from 47f25f8 to 3319412 Compare March 4, 2025 23:21
@ldez ldez changed the title fix: kill hook when the command is locked fix: kill hook when the command is stuck Mar 4, 2025
@ldez ldez force-pushed the fix/hook-timeout branch 2 times, most recently from 5cf1152 to 9f874b0 Compare March 4, 2025 23:45
@ldez ldez force-pushed the fix/hook-timeout branch from 9f874b0 to c206e28 Compare March 4, 2025 23:47
Copy link
Member

@dmke dmke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ldez ldez merged commit 1378056 into go-acme:master Mar 5, 2025
7 checks passed
@ldez ldez deleted the fix/hook-timeout branch March 5, 2025 12:32
@ldez ldez modified the milestones: unreleased, v4.23 Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

renewal hook hangs forever

2 participants