1 |
Commented on the bug due to reasoning behind this patch. Essentially, SIGTERM |
2 |
is sent to "tee", a WNOHANG waitpid() is performed followed by SIGKILL if it |
3 |
hasn't exited. So if tee doesn't exit immediately upon getting the SIGTERM, |
4 |
its buffers won't get a chance to get to disk due to it being killed. This |
5 |
patch simply adds a 1 second window between the SIGTERM and the SIGKILL. |
6 |
|
7 |
One question; is the waitpid(x,0) necessary in the case where SIGKILL wasn't |
8 |
sent? Is waitpid(x,os.NOHANG) enough to clean up the zombie when SIGTERM |
9 |
succeeds? If so, the waitpid(x,0) could be indented into the "if not |
10 |
timeout:" block. |
11 |
|
12 |
-- |
13 |
Jason Stubbs |