chore(agent/agentscripts): log command cancellation (#16324)

Relates to https://github.com/coder/internal/issues/329

It's currently unclear where the SIGHUP came from; adding some logging
to make it more clear if it happens again in future.

---------

Co-authored-by: Danny Kopping <danny@coder.com>
This commit is contained in:
Cian Johnston
2025-01-29 13:37:43 +00:00
committed by GitHub
parent d38974405d
commit e8e16c9404
3 changed files with 11 additions and 3 deletions

View File

@ -290,7 +290,7 @@ func (r *Runner) run(ctx context.Context, script codersdk.WorkspaceAgentScript,
cmd = cmdPty.AsExec()
cmd.SysProcAttr = cmdSysProcAttr()
cmd.WaitDelay = 10 * time.Second
cmd.Cancel = cmdCancel(cmd)
cmd.Cancel = cmdCancel(ctx, logger, cmd)
// Expose env vars that can be used in the script for storing data
// and binaries. In the future, we may want to expose more env vars