-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid parent process if no log redirection is used #3624
base: master
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mback2k The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @mback2k! |
Hi @mback2k. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Exec the command without forking in case go-runner does not need to perform log output redirection. Signed-off-by: Marc Hoersken <[email protected]>
@@ -79,7 +80,11 @@ func configureAndRun() error { | |||
cmd.Stderr = errStream | |||
|
|||
log.Printf("Running command:\n%v", cmdInfo(cmd)) | |||
err := cmd.Start() | |||
if cmd.Stdout == os.Stdout && cmd.Stderr == os.Stderr { | |||
err = syscall.Exec(cmd.Path, cmd.Args, syscall.Environ()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, this feels like a potentially breaking change. Shall we make it an optional feature or such?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but the idea was to automatically/intelligently save systems resources by avoiding the parent process (go-runner) if not needed. What do you think about an opt-out argument/flag?
@mback2k Thank your for the contribution! I agree with @saschagrunert that this should probably be an option. Additionally, can you please clarify (e.g. in the PR description) why do you think this change is needed and what do we get from it? |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
Sorry for the delay, I just added "The idea here is to save resources by exec'ing instead of fork'ing the subprocess to avoid an unnecessary process lingering around." |
What type of PR is this?
/kind design
What this PR does / why we need it:
Exec the command without forking in case go-runner does not need to perform log output redirection.
The idea here is to save resources by exec'ing instead of fork'ing the subprocess to avoid an unnecessary process lingering around.
Which issue(s) this PR fixes:
None
Special notes for your reviewer:
Not sure if this is a desired change, please review and decide if generally useful or not. Thanks!
Does this PR introduce a user-facing change?
Yes