Repository navigation
Conversation
lfrancke
force-pushed
the
fix/capture-shell-output-wait-for-tee
branch
from
November 18, 2026 10:00
0c971fd to
45b9ca8
Compare
lfrancke
marked this pull request as ready for review
November 18, 2026 10:15
adwk67
self-requested a review
November 19, 2026 16:47
This branch has not been deployed
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.
Description
Note
Build fails until #1337 is merged
Side finding from my bug hunting/jig/kuttl investigation.
ZK operator has a bunch of random test failures in the
loggingtest because of this bug so this should increase stability.This affects mostly init containers which lose their captured output (stdout/stderr) sometimes (timing dependent) which means Vector doesn't ship anything, so the logs are missing and the test fails :(
capture_shell_outputusesteeto capture the outptu butteeis a separate process and nothing waits for them to actually finish their job. It kinda looks like it's all in the bash process but it.s not. So when the PID 1 bash exits everything is torn down and this might happen beforeteehad time to write.So this now sets an exit trap that waits for the
teeprocesses. The wait is limited to 5 seconds (arbitrarily chosen). The reason is Trino's password-file updater which has a background process that keeps the pipe open and tee would never finish and we'd wait until the end of the grace period.Tested using this:
Init container running the generated command plus
echo hello && echo err >&2, using the ZooKeeper image, 50 pods each on k3d:mainCallers must not set their own EXIT trap but none of our operators currently do.
I know this is not super trivial to review due to all the bash-fu but it all makes sense to me.
Follow-up for spark-k8s-operator: the job container ends with
sleep 1to wait for the log file, which is no longer needed after this change.Definition of Done Checklist
Author
Reviewer
Acceptance