[0.11] cherry picks for v0.11.5#3734
Merged
Merged
Conversation
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)
aaronlehmann
approved these changes
Mar 22, 2023
sipsma
approved these changes
Mar 22, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix gateway exec tty cleanup on context.Canceled #3658
Register builds before recording build history #3726
llbsolver: Fix performance of recomputeDigests #3732
llbsolver: fix sorting of history records #3733 (not merged)
@coryb @aaronlehmann @sipsma