Skip to content

[0.11] cherry picks for v0.11.5#3734

Merged
tonistiigi merged 5 commits into
moby:v0.11from
tonistiigi:v0.11.5-picks
Mar 23, 2023
Merged

[0.11] cherry picks for v0.11.5#3734
tonistiigi merged 5 commits into
moby:v0.11from
tonistiigi:v0.11.5-picks

Conversation

coryb and others added 5 commits March 22, 2023 16:06
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>
(cherry picked from commit b76f8c0)
Recording build history calls into LeaseManager, which can block for
several seconds. This can trigger a 3 second timeout in GatewayForwarder
while it waits for a build ID to be registered.  Longer-term, we should
figure out the performance issues in the containerd metadata DB, but
this addresses the immediate problems of timeouts that manifest in these
error messages:

    forwarding Ping: no such job 93oss3bmbagcpq8yokla3921z

Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
(cherry picked from commit 396b276)
This fixes an issue where the tty message handling loop will go into a
tight loop and never exit upon context.Canceled.  There is select
statement in `(*procMessageForwarder).Recv` that returns nil on
ctx.Done, but the control loop in `(*container).Start` did not exit on
this condition.  I think the intent was to flush out any inflight
messages on cancel, but this is already done in
`(*procMessageForwarder) Close`.

Signed-off-by: coryb <cbennett@netflix.com>
(cherry picked from commit aa827f5)
Before this, in the case where nothing was mutated the visited memo
would never be updated, thus causing exponential complexity.

Now the memo is updated even when nothing is mutated, just setting old
and new to be the same digest.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
(cherry picked from commit ea69a59)
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit f6d1845)
Copy link
Copy Markdown
Collaborator

@coryb coryb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

@tonistiigi tonistiigi merged commit 252ae63 into moby:v0.11 Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants