10 Commits

Author SHA1 Message Date
Tonis Tiigi
a07a92e157 lint: unusedparams fixes for windows
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-04-09 07:23:16 -07:00
Tonis Tiigi
1f9988911f lint: unusedparams fixes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-04-09 07:23:16 -07:00
Justin Chadwell
a9b4dd5090 chore: fix windows variable naming issues
Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-11-02 10:45:34 +00:00
Tonis Tiigi
6e87e4b455 resources: add build step resource tracking via cgroups
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2023-06-08 15:51:31 -07:00
coryb
6073f5821e runc worker: fix sigkill handling
This fixes the incorrect kill handling introduced in
b76f8c0248.  We need to send the
SIGKILL to the in-container process, not the runc process.  This patch
adds an abstraction over the kill handling:
  * for `runc run` processes use `runc kill`
  * for `runc exec` processes, read pid (in host PID namespace) from
    pidfile created by `runc exec`, then send the signal directly to
    that process.
Also use the kill abstraction when we receive a SIGKILL over the
signal channel for containers created by gateway NewContainer

Signed-off-by: coryb <cbennett@netflix.com>
2023-03-31 12:56:41 -07:00
coryb
b76f8c0248 fix process termination handling for runc exec
This patch makes the process handling consistent between runc.Run and
runc.Exec usage.  Previously runc.Run would use context.Background
for the runc.Run process and would monitor the request context for
shutdown requests, sending a SIGKILL to the container pid1 process. This
allowed runc.Run to gracefully shutdown and reap child processes.  This
logic was not used for runc.Exec where instead we were passing in the
request context to runc.Exec, and if that request context was cancelled
the runc process would immediately terminate preventing runc from reaping
the child process.  In this scenario the extra pid will remain forever
and then when the pid1 process will get wedged in zap_pid_ns_processes
syscall upon shutdown waiting fo the zombie pid to exit.

With this fix both runc.Run and runc.Exec will use context.Background
for runc processes and monitor the request context for shutdown request
triggering a SIGKILL to the pid being monitored by runc.

Signed-off-by: coryb <cbennett@netflix.com>
2023-03-17 12:46:19 -07:00
Cory Bennett
559d079902 Allow signals to be sent to gateway exec containers
Signed-off-by: Cory Bennett <cbennett@netflix.com>
2022-02-02 16:57:10 +00:00
CrazyMax
54b8ff2fc8 go fmt: add //go:build
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-10-28 13:26:43 +02:00
Cory Bennett
b464f1e315 update go-runc to use runc.ExitError for container exec status
Signed-off-by: Cory Bennett <cbennett@netflix.com>
2020-10-20 06:44:29 +00:00
Cory Bennett
e308ef7874 add tty support for runc executor
Signed-off-by: Cory Bennett <cbennett@netflix.com>
2020-10-16 17:36:56 +00:00