mirror of
https://github.com/docker/compose.git
synced 2026-09-01 07:11:06 +00:00
A failing service hook returns only its exit code:
dependency failed to start: db hook exited with status 1
The output that explains why is not there, and for a hook running without a
listener it does not exist anywhere: runHook created the exec with
AttachStdout/AttachStderr false, so the daemon discarded both streams and
runWaitExec only polled for the exit code. There was nothing left to look at
afterwards.
Now stdout and stderr are always attached, and the last lines of them are kept
in a bounded buffer. On non-zero exit that tail goes into the error:
db hook exited with status 1: SQLSTATE[42S02]: Base table or view not found
A successful hook is unchanged - output goes to the listener as before, nothing
is added anywhere. With a listener the lines still stream out, the buffer just
tees them.
The buffer keeps the last 10 lines and 2 KiB, drops the oldest content and never
short-writes, so a chatty hook cannot block on it and cannot grow it.
runWaitExec is removed: it existed only for the unattached branch, and that
branch is what threw the output away.
Signed-off-by: Deniss Solnce <dennis.lapchenko@gmail.com>
|
||
|---|---|---|
| .. | ||
| api | ||
| bridge | ||
| compose | ||
| dryrun | ||
| e2e | ||
| mocks | ||
| remote | ||
| utils | ||
| watch | ||