[PR #1170] [MERGED] feat: handle context cancelation during docker exec #1819

Closed
opened 2026-03-01 21:52:49 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/1170
Author: @KnisterPeter
Created: 5/17/2022
Status: Merged
Merged: 5/24/2022
Merged by: @mergify[bot]

Base: masterHead: allow-to-interrupt-execution


📝 Commits (4)

  • 60f6f75 feat: handle context cancelation during docker exec
  • 966d34e feat: handle SIGTERM signal and abort run
  • c9bc172 test: on context cancel, abort running command
  • 42f0a15 test: make sure the exec funcction handles command exit code

📊 Changes

5 files changed (+182 additions, -14 deletions)

View changed files

📝 main.go (+2 -1)
📝 pkg/container/docker_run.go (+43 -12)
📝 pkg/container/docker_run_test.go (+118 -0)
📝 pkg/runner/job_executor.go (+11 -1)
📝 pkg/runner/runner.go (+8 -0)

📄 Description

To allow interrupting docker exec (which could be long running)
we process the log output in a go routine and handle
context cancelation as well as command result.

In case of context cancelation a CTRL+C is written into the docker
container. This should be enough to terminate the running
command.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nektos/act/pull/1170 **Author:** [@KnisterPeter](https://github.com/KnisterPeter) **Created:** 5/17/2022 **Status:** ✅ Merged **Merged:** 5/24/2022 **Merged by:** [@mergify[bot]](https://github.com/apps/mergify) **Base:** `master` ← **Head:** `allow-to-interrupt-execution` --- ### 📝 Commits (4) - [`60f6f75`](https://github.com/nektos/act/commit/60f6f75787a0fff1ae2a14f72de9846fcdbd2e62) feat: handle context cancelation during docker exec - [`966d34e`](https://github.com/nektos/act/commit/966d34e0cea3534363cc77ccad66bc1ee07d58e5) feat: handle SIGTERM signal and abort run - [`c9bc172`](https://github.com/nektos/act/commit/c9bc172da5f9a79ca2977a56d2105120f2acc508) test: on context cancel, abort running command - [`42f0a15`](https://github.com/nektos/act/commit/42f0a1593ab57838000bcee43d1a037fb0d07efd) test: make sure the exec funcction handles command exit code ### 📊 Changes **5 files changed** (+182 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `main.go` (+2 -1) 📝 `pkg/container/docker_run.go` (+43 -12) 📝 `pkg/container/docker_run_test.go` (+118 -0) 📝 `pkg/runner/job_executor.go` (+11 -1) 📝 `pkg/runner/runner.go` (+8 -0) </details> ### 📄 Description To allow interrupting docker exec (which could be long running) we process the log output in a go routine and handle context cancelation as well as command result. In case of context cancelation a CTRL+C is written into the docker container. This should be enough to terminate the running command. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:52:49 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#1819
No description provided.