[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAEf4BzbniQyBw2W=SR9gVh+7KHb9p6f6=45GUDBUXoP=59kxLw@mail.gmail.com>
Date: Wed, 11 Mar 2020 15:24:09 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Stanislav Fomichev <sdf@...ichev.me>
Cc: Andrii Nakryiko <andriin@...com>, bpf <bpf@...r.kernel.org>,
Networking <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...com>,
Daniel Borkmann <daniel@...earbox.net>,
Stanislav Fomichev <sdf@...gle.com>,
Kernel Team <kernel-team@...com>
Subject: Re: [PATCH bpf-next] selftests/bpf: make tcp_rtt test more robust to failures
On Wed, Mar 11, 2020 at 3:14 PM Stanislav Fomichev <sdf@...ichev.me> wrote:
>
> On 03/11, Andrii Nakryiko wrote:
> > On Wed, Mar 11, 2020 at 1:41 PM Stanislav Fomichev <sdf@...ichev.me> wrote:
> > >
> > > On 03/11, Andrii Nakryiko wrote:
> > > [..]
> > > > + pthread_join(tid, &server_res);
> > > > + CHECK_FAIL(IS_ERR(server_res));
> > >
> > > I wonder if we add (move) close(server_fd) before pthread_join(), can we
> > > fix this issue without using non-blocking socket? The accept() should
> > > return as soon as server_fd is closed so it's essentially your
> > > 'server_done'.
> >
> > That was my first attempt. Amazingly, closing listening socket FD
> > doesn't unblock accept()...
> Ugh :-(
>
> In this case, feel free to slap:
> Reviewed-by: Stanislav Fomichev <sdf@...gle.com>
>
> My only other (minor) suggestion was to add a small delay in the first
> loop:
>
> while (!server_done) {
> accept()
> if (!err) {
> udelay(50) <--
> continue
> }
> }
>
> But I suppose that shouldn't be that big of a deal..
It's actually bad, I'll fix it. Not sure how I missed that one... Thanks!
Powered by blists - more mailing lists