logging: non-blocking does not enqueue new messages when buffer is full

See: https://github.com/moby/moby/issues/45200

Signed-off-by: Wesley Pettit <wppttt@amazon.com>
This commit is contained in:
Wesley Pettit 2023-03-24 14:42:42 -07:00
parent e529f29707
commit 43af06b1f0
No known key found for this signature in database
GPG Key ID: 7D0AF707490C3B65
1 changed files with 3 additions and 5 deletions

View File

@ -135,8 +135,7 @@ Docker provides two modes for delivering messages from the container to the log
driver: driver:
* (default) direct, blocking delivery from container to driver * (default) direct, blocking delivery from container to driver
* non-blocking delivery that stores log messages in an intermediate per-container * non-blocking delivery that stores log messages in an intermediate per-container buffer for consumption by driver
ring buffer for consumption by driver
The `non-blocking` message delivery mode prevents applications from blocking due The `non-blocking` message delivery mode prevents applications from blocking due
to logging back pressure. Applications are likely to fail in unexpected ways when to logging back pressure. Applications are likely to fail in unexpected ways when
@ -144,15 +143,14 @@ STDERR or STDOUT streams block.
> **Warning** > **Warning**
> >
> When the buffer is full and a new message is enqueued, the oldest message in > When the buffer is full, new messages will not be enqueued. Dropping messages is often preferred to blocking the
> memory is dropped. Dropping messages is often preferred to blocking the
> log-writing process of an application. > log-writing process of an application.
{: .warning} {: .warning}
The `mode` log option controls whether to use the `blocking` (default) or The `mode` log option controls whether to use the `blocking` (default) or
`non-blocking` message delivery. `non-blocking` message delivery.
The `max-buffer-size` log option controls the size of the ring buffer used for The `max-buffer-size` log option controls the size of the buffer used for
intermediate message storage when `mode` is set to `non-blocking`. `max-buffer-size` intermediate message storage when `mode` is set to `non-blocking`. `max-buffer-size`
defaults to 1 megabyte. defaults to 1 megabyte.