Skip to content
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

stdin-killer: do not setpgrp if already leader #1881

Merged
merged 1 commit into from
Aug 4, 2023
Merged

Conversation

batrick
Copy link
Member

@batrick batrick commented Aug 4, 2023

Fixes bugs in https://pulpito.ceph.com/pdonnell-2023-08-03_19:12:12-fs-wip-batrick-testing-20230803.140718-distro-default-smithi/

2023-08-03T19:40:10.942
INFO:teuthology.orchestra.run.smithi100.stderr:Traceback (most recent
call last):
2023-08-03T19:40:10.942
INFO:teuthology.orchestra.run.smithi100.stderr:  File
"/usr/bin/stdin-killer", line 213, in <module>
2023-08-03T19:40:10.943
INFO:teuthology.orchestra.run.smithi100.stderr:    os.setpgrp()
2023-08-03T19:40:10.943
INFO:teuthology.orchestra.run.smithi100.stderr:PermissionError: [Errno
1] Operation not permitted

Fixes failure like:

    2023-08-03T19:40:10.942 INFO:teuthology.orchestra.run.smithi100.stderr:Traceback (most recent call last):
    2023-08-03T19:40:10.942 INFO:teuthology.orchestra.run.smithi100.stderr:  File "/usr/bin/stdin-killer", line 213, in <module>
    2023-08-03T19:40:10.943 INFO:teuthology.orchestra.run.smithi100.stderr:    os.setpgrp()
    2023-08-03T19:40:10.943 INFO:teuthology.orchestra.run.smithi100.stderr:PermissionError: [Errno 1] Operation not permitted

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
pgrp = os.getpgrp()
if pgrp != os.getpid():
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks correct as EPERM errno is returned if the process calling setpgrp is the session/process group leader. Question is, what caused this failure now.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure but clearly under normal circumstances stdin-killer is not already the process group leader. Perhaps when it was wrapped with the ulimit wrapper.

@zmc zmc merged commit 7fda959 into main Aug 4, 2023
9 checks passed
@batrick batrick deleted the stdin-killer-setpgrp branch August 4, 2023 17:59
@dmick dmick changed the title stdin-killer: do not setpgrp is already leader stdin-killer: do not setpgrp if already leader Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants