forgejo-runner-act/pkg
Markus Wolf 4ef50eeae7
feat: handle context cancelation during docker exec (#1170)
* feat: handle context cancelation during docker exec

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.

To make sure we do not get stuck during cleanup, we do
set the cleanup contexts with a timeout of 5 minutes

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>
Co-authored-by: Philipp Hinrichsen <philipp.hinrichsen@new-work.se>

* feat: handle SIGTERM signal and abort run

* test: on context cancel, abort running command

This test makes sure that whenever the act Context was canceled, the
currently running docker exec is sent a 0x03 (ctrl+c).

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

* test: make sure the exec funcction handles command exit code

This test makes sure that the exec function does handle
docker command error results

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>
Co-authored-by: Philipp Hinrichsen <philipp.hinrichsen@new-work.se>
Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>
2022-05-24 14:52:25 +00:00
..
artifacts chore: fold integration test outputs (#1111) 2022-04-20 18:34:27 +00:00
common feat: add option to specify git remote name (#1104) 2022-04-04 17:53:08 +00:00
container feat: handle context cancelation during docker exec (#1170) 2022-05-24 14:52:25 +00:00
exprparser implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
model implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
runner feat: handle context cancelation during docker exec (#1170) 2022-05-24 14:52:25 +00:00