Skip to content

watch: handle SIGHUP in watcher interrupt path#2725

Open
SergioChan wants to merge 1 commit intogo-task:mainfrom
SergioChan:fix-watcher-sighup-2642
Open

watch: handle SIGHUP in watcher interrupt path#2725
SergioChan wants to merge 1 commit intogo-task:mainfrom
SergioChan:fix-watcher-sighup-2642

Conversation

@SergioChan
Copy link

@SergioChan SergioChan commented Mar 8, 2026

Summary

  • include syscall.SIGHUP in the watcher interrupt signal handler
  • watcher mode now exits/restarts on SIGHUP just like SIGINT/SIGTERM

Testing

  • Unable to run go test ./... locally in this environment because the repository requests Go 1.25 toolchain and automatic toolchain download is unavailable here (toolchain not available).
  • Change is a single signal list update in closeOnInterrupt, with no behavioral impact outside watch-mode signal handling.

Related

@trulede
Copy link
Contributor

trulede commented Mar 15, 2026

What would happen if both SIGTERM and SIGHUP are received in quick succession? Is it going to restart the watcher, or exit Task.

Possibly call signal.Stop(ch) before w.Close(),

@trulede trulede added the area: watcher Changes related to the Taskfile watcher. label Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: watcher Changes related to the Taskfile watcher.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Watcher interrupt on SIGHUP

2 participants