-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
lib: Attach stdout to child only if --log=stdout and stdout FD is a tty #16738
Conversation
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.
Could you fix the styling?
b8449b6
to
abd19c8
Compare
@ton31337, sure. Done. |
abd19c8
to
f28f377
Compare
f28f377
to
8f0fafd
Compare
@ton31337, done. |
8f0fafd
to
de8a402
Compare
de8a402
to
fb73061
Compare
Prior to this commit stdout of a process started in a daemon mode was attached to a calling process. As a result a calling process hung for infinity. Signed-off-by: Vladislav Odintsov <[email protected]>
fb73061
to
0e3c5e8
Compare
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.
LGTM
@ton31337, this change seems to be qualified as a bugfix, so would you consider to backport it down to supported branches? |
@ton31337, it's just gentle ping about backport. |
@Mergifyio backport stable/10.1 stable/10.0 stable/9.1 |
✅ Backports have been created
|
lib: Attach stdout to child only if --log=stdout and stdout FD is a tty (backport #16738)
lib: Attach stdout to child only if --log=stdout and stdout FD is a tty (backport #16738)
lib: Attach stdout to child only if --log=stdout and stdout FD is a tty (backport #16738)
Thanks, @ton31337 and @donaldsharp! |
We've faced with a regression after we moved from frr 8.5 to a newer versions (9.0, 9.1, 10.0, 10.1).
In our automation we start frr from python code using subprocess like this:
This call hangs in
poll()
for stdout FD indefinitely andfrrinit.sh
hangs in zombie state unless we killsubprocess.run()
call.If we remove stdout capturing from
subprocess.run()
call (make associated to stdout FD a tty FD), things go well and process terminates correctly with no hangs and zombies.This commit fixes this situation where stdout of a process started in a daemon mode was attached to a calling process regardless of presence
--log
option.If this patch is acceptable, it's worth backporting down to 9.0 branch, where the initial commit 4d28aea appeared.