[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] Testing NBD server implementations for correctness



On Sun, Sep 25, 2016 at 01:58:06PM +0100, Alex Bligh wrote:
> 
> > On 25 Sep 2016, at 12:24, Wouter Verhelst <w@...112...> wrote:
> > 
> >>> 
> >>> From memory "make check" runs all the tests, though I think it
> >> skips the 'huge' integrity test.
> > 
> > Indeed, because that sometimes deadlocks.
> 
> Really? I thought it merely took ages. I'd be interested to
> know why it deadlocks, and whether that's a server bug
> or a test bug.

Probably fixed by now, actually -- at least with the reference
implementation.

The client and the server were both single-threaded, and would only swap
between "reading from socket" and "writing to socket" once a read or
write operation was completely finished. As such, if one side filled up
its TCP buffer, it would block until the other side would start to read
from it. Since both sides do so, the possibility exists for both sides
to end up in a blocking state.

But with the GThreadPool thing, the server can now read and write at the
same time (in different threads, obviously), which means that that
deadlock should be gone.

I'll probably enable the integrityhuge test for Debian with my next
upload; if it doesn't break, I'll enable it for master, too.

> I rewrote that test suite more comprehensibly in golang for
> gonbdserver if you are interested.

What do you mean by "more comprehensively"?

(also, not sure if switching the test suite to a whole different
language is necessarily a good idea, but I can probably be convinced
otherwise...

-- 
< ron> I mean, the main *practical* problem with C++, is there's like a dozen
       people in the world who think they really understand all of its rules,
       and pretty much all of them are just lying to themselves too.
 -- #debian-devel, OFTC, 2016-02-12



Reply to: