[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <22e262a7-d7e7-f020-f98b-55d7512660f5@iogearbox.net>
Date: Fri, 13 Mar 2020 23:35:14 +0100
From: Daniel Borkmann <daniel@...earbox.net>
To: Andrii Nakryiko <andrii.nakryiko@...il.com>,
Jakub Sitnicki <jakub@...udflare.com>,
Stanislav Fomichev <sdf@...gle.com>
Cc: bpf <bpf@...r.kernel.org>, Networking <netdev@...r.kernel.org>,
kernel-team@...udflare.com
Subject: Re: [PATCH bpf-next v2] selftests/bpf: Fix spurious failures in
accept due to EAGAIN
On 3/13/20 8:01 PM, Andrii Nakryiko wrote:
> On Fri, Mar 13, 2020 at 9:10 AM Jakub Sitnicki <jakub@...udflare.com> wrote:
>> Andrii Nakryiko reports that sockmap_listen test suite is frequently
>> failing due to accept() calls erroring out with EAGAIN:
>>
>> ./test_progs:connect_accept_thread:733: accept: Resource temporarily unavailable
>> connect_accept_thread:FAIL:733
>>
>> This is because we are using a non-blocking listening TCP socket to
>> accept() connections without polling on the socket.
>>
>> While at first switching to blocking mode seems like the right thing to do,
>> this could lead to test process blocking indefinitely in face of a network
>> issue, like loopback interface being down, as Andrii pointed out.
>>
>> Hence, stick to non-blocking mode for TCP listening sockets but with
>> polling for incoming connection for a limited time before giving up.
>>
>> Apply this approach to all socket I/O calls in the test suite that we
>> expect to block indefinitely, that is accept() for TCP and recv() for UDP.
>>
>> Fixes: 44d28be2b8d4 ("selftests/bpf: Tests for sockmap/sockhash holding listening sockets")
>> Reported-by: Andrii Nakryiko <andrii.nakryiko@...il.com>
>> Signed-off-by: Jakub Sitnicki <jakub@...udflare.com>
>
> This looks good. Unfortunately can't repro the issue locally anymore.
> But once this gets into bpf-next and we update libbpf in Github, I'll
> enable sockmap_listen tests again and see if it's still flaky. Thanks
> for following up!
Ok, applied, thanks!
Powered by blists - more mailing lists