You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] multiple-pipeline.sh fails due to number of PID mismatch #672
When I did #671 I didn't think it was possible for ps to miss a process just started in the background and I still believe that HOWEVER I think I missed one important detail: the aplay_opts() indirection. It is this function and not aplay (resp. arecord) that is started in the background. So when ps_checks() starts running, it can expect to find 7 aplay_opts() subshells for sure but maybe not 7 aplay processes yet.
The fact that ps_checks() finds only 6 processes while func_error_exit() finds the 7 expected processes immediately after is consistent with that explanation.
This is all horribly racy and I wish we could rethink and refactor how we manage background processes but that wouldn't be a quick fix. For now I can only think about adding yet another sleep as @fredoh9 is offering in #674
I did a bit more testing. As with any race condition, reproduction is about making it worse and the change below does reproduce the exact same log after a few iterations.
@fredoh9 I "stole" your sleep in #674, added a comment explaining the problem and submitted #676
Activity
fredoh9 commentedon May 3, 2021
is this side effect of #671?
fredoh9 commentedon May 5, 2021
Found on JSL_RVP_NOCODEC for internal test 3691
marc-hb commentedon May 5, 2021
After looking at this in more detail I think I have an explanation.
Likely yes.
When I did #671 I didn't think it was possible for
psto miss a process just started in the background and I still believe that HOWEVER I think I missed one important detail: theaplay_opts()indirection. It is this function and notaplay(resp.arecord) that is started in the background. So whenps_checks()starts running, it can expect to find 7aplay_opts()subshells for sure but maybe not 7aplayprocesses yet.The fact that
ps_checks()finds only 6 processes whilefunc_error_exit()finds the 7 expected processes immediately after is consistent with that explanation.This is all horribly racy and I wish we could rethink and refactor how we manage background processes but that wouldn't be a quick fix. For now I can only think about adding yet another
sleepas @fredoh9 is offering in #674@plbossart , @lgirdwood , @kv2019i , any thought?
At least we have decent logging, relatively simple logic and no more copy/paste in this test now, better times than #472 that took me days!
marc-hb commentedon May 8, 2021
I did a bit more testing. As with any race condition, reproduction is about making it worse and the change below does reproduce the exact same log after a few iterations.
@fredoh9 I "stole" your sleep in #674, added a comment explaining the problem and submitted #676