It seems that we get a different behavior whether stdout is closed
in the parent process or not when it comes to buffering. If it's
closed we don't get the last line flushed out to the file, if it's
not closed we do. This was seen in the trove pg fail.
A complete shot in the dark, but I'd like to see if this is fixed
with being explicit with printing to the log before stdout.
Change-Id: Ie37299dbc88d549d34d85731e571a5b7ef181311
| ... | ... |
@@ -538,10 +538,10 @@ if [[ -n "$LOGFILE" ]]; then |
| 538 | 538 |
cmd | getline now |
| 539 | 539 |
close("date +\"%Y-%m-%d %H:%M:%S.%3N | \"")
|
| 540 | 540 |
sub(/^/, now) |
| 541 |
|
|
| 542 | 541 |
print > logfile |
| 543 |
- fflush("")
|
|
| 544 | 542 |
fflush(logfile) |
| 543 |
|
|
| 544 |
+ fflush("")
|
|
| 545 | 545 |
}' ) 2>&1 |
| 546 | 546 |
# Set up a second fd for output |
| 547 | 547 |
exec 6> >( tee "${SUMFILE}" )
|