[LTP] [PATCH] test_children_cleanup.sh: Fix race condition

Li Wang liwang@redhat.com
Tue Feb 15 10:50:21 CET 2022


On Tue, Feb 15, 2022 at 5:39 PM Petr Vorel <pvorel@suse.cz> wrote:

> > On 15. 02. 22 5:30, Li Wang wrote:
> > > It doesn't work for all platforms and we can not guarantee how long it
> will
> > > cost before PID 1 reaps zombie process.
>
> > > Also, I just get to know that  Docker does not run processes under a
> > > special init process that properly reaps child processes, so that it is
> > > possible for the container to end up with zombie processes that cause
> > > all sorts of trouble.
>
> > > I even try adding `kill -SIGCHLD 1` but does not work as expected.
>
> > > See CI jobs:
> > >
> https://github.com/wangli5665/ltp/runs/5194270998?check_suite_focus=true
> > > <
> https://mail.google.com/mail/u/1/%E2%80%8Bhttps://github.com/wangli5665/ltp/runs/5194270998?check_suite_focus=true
> >
>
> > > Therefore, I suggest giving a chance to my refined patch V2 :).
>
> > When I was testing the libtest yesterday on a moderately stressed
> > machine, I actually saw the child process still in the R state during
>

That might cause by signal asynchronous processing when the system is under
pressure.


> > the first state check a couple of times. That's why I've added looping
> > with delay.


> > On the other hand I did not see any zombies even after several hundred
> > tries. But I can add a zombie check to my patch a well.
> I'd be for it. As Li noticed, containers behave really differently
> (maybe it'd be faster to debug tests using podman).
>

Right, we have to consider many scenarios:

1.  asynchronous processing signal so that child still in 'R'
2.  the child correctly terminated on bare-metal system
3. allow zombied while running by docker (without a formal init(PID 1)
process)

Especially scenario-3 confused me for quite a while.

@Martin, feel free to send the patch that includes the above.
or I can help summarize these in the commit description.


-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220215/7c800aa2/attachment.htm>


More information about the ltp mailing list