qemu/nbd
Eric Blake efd3dda312 nbd-server: Silence server warnings on port probes
While testing the use of qemu-nbd in a Pod of a Kubernetes cluster, I
got LOTS of log messages of the forms:

qemu-nbd: option negotiation failed: Failed to read flags: Unexpected end-of-file before all data were read
qemu-nbd: option negotiation failed: Failed to read flags: Unable to read from socket: Connection reset by peer

While it is nice to warn about clients that aren't following protocol
(in case it helps diagnosing bugs in those clients), a mere port probe
(where the client never write()s any bytes, and where we might even
hit EPIPE in trying to send our greeting to the client) is NOT
abnormal, but merely serves to pollute the log.  And Kubernetes
_really_ likes to do port probes to determine whether a given Pod is
up and running.

Easy ways to demonstrate the above port probes:
$ qemu-nbd -r -f raw path/to/file &
$ nc localhost 10809 </dev/null
$ bash -c 'exec </dev/tcp/localhost/10809'
$ kill $!

Silence the noise by not capturing errors until after our first
successful read() from a client.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-ID: <20241115195638.1132007-2-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
2024-11-18 09:06:17 -06:00
..
client-connection.c nbd: fix -Werror=maybe-uninitialized false-positive 2024-10-02 16:14:29 +04:00
client.c nbd/server: do not poll within a coroutine context 2024-04-25 07:56:16 -05:00
common.c nbd/server: do not poll within a coroutine context 2024-04-25 07:56:16 -05:00
meson.build nbd: move connection code from block/nbd to nbd/client-connection 2021-06-18 10:59:53 -05:00
nbd-internal.h nbd/server: do not poll within a coroutine context 2024-04-25 07:56:16 -05:00
server.c nbd-server: Silence server warnings on port probes 2024-11-18 09:06:17 -06:00
trace-events nbd/server: CVE-2024-7409: Drop non-negotiating clients 2024-08-08 16:25:33 -05:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00