coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

timeout: fix subprocess is never terminated

Open miles170 opened this issue 2 years ago • 7 comments

Closes #4176.

Follow GNU's timeout behavior, send a signal to the process group to make sure subprocesses are cleaned up, and also send SIGCONT to the child and the whole process group after that.

miles170 avatar Feb 01 '23 08:02 miles170

would it be possible to add a test for this? Thanks

sylvestre avatar Feb 02 '23 22:02 sylvestre

would it be possible to add a test for this? Thanks

Added test_kill_subprocess test.

miles170 avatar Feb 03 '23 03:02 miles170

I'm not sure why the CI is failing randomly. I have increased the timeout from 2 seconds to 5 seconds. (Everything works fine on my local Ubuntu 22.10)

miles170 avatar Feb 08 '23 02:02 miles170

GNU testsuite comparison:

Congrats! The gnu test tests/tail-2/inotify-dir-recreate is no longer failing!

github-actions[bot] avatar Feb 08 '23 03:02 github-actions[bot]

GNU testsuite comparison:

Congrats! The gnu test tests/tail-2/inotify-dir-recreate is no longer failing!

github-actions[bot] avatar Feb 08 '23 04:02 github-actions[bot]

I have increased the timeout from 5 seconds to 10 seconds, and the failing tests are not related to this PR.

miles170 avatar Feb 08 '23 07:02 miles170

GNU testsuite comparison:

Congrats! The gnu test tests/tail-2/inotify-dir-recreate is no longer failing!

github-actions[bot] avatar Feb 08 '23 07:02 github-actions[bot]

GNU testsuite comparison:

Congrats! The gnu test tests/tail-2/inotify-dir-recreate is no longer failing!

github-actions[bot] avatar Mar 05 '23 21:03 github-actions[bot]

I checked the GNU test logs and found that this should also fix #4073, which is caused by the split subprocess (filter) not being killed by the timeout.

miles170 avatar Mar 15 '23 09:03 miles170

Indeed this reduces the log size from 86MB to just 2MB, that's great! Let's hope the CI becomes a bit more stable as a result.

tertsdiepraam avatar Mar 15 '23 13:03 tertsdiepraam