1 |
On Mon, May 14, 2012 at 09:33:58AM +0200, Michael Haubenwallner wrote: |
2 |
> |
3 |
> |
4 |
> On 05/11/2012 06:39 PM, Mike Frysinger wrote: |
5 |
> > +multijob_child_init() { |
6 |
> > + trap 'echo ${BASHPID} $? >&'${mj_control_fd} EXIT |
7 |
> > + trap 'exit 1' INT TERM |
8 |
> > +} |
9 |
> |
10 |
> Just wondering why $! in parent isn't used anywhere, even not for some |
11 |
> integrity check if the child's BASHPID actually was forked by parent. |
12 |
|
13 |
wait'ing on it can fail; roughly bash basically reaps on it's own |
14 |
(uncontrollably so), but bash still will actually do the wait, |
15 |
basically falling back to it's internal list of what it reaped. |
16 |
|
17 |
That's *roughly* what I got out of it when I wrote what vapier's |
18 |
ape'ing here, and is exactly the issue that bit me in the ass on a 48 |
19 |
core. If things are moving fast enough, sooner or later that whacky |
20 |
wait behaviour will intersect a real pid, one that isn't a direct |
21 |
child, and bash will puke a horrible error. |
22 |
|
23 |
That pretty much leaves you w/ 'wait jobspec' or 'wait' to clean up |
24 |
the bash innards. This exact issue is why the code passes the exit |
25 |
status back. |
26 |
|
27 |
~harring |