sociomantic-tsunami / dlsproto

Distributed Log Store protocol definition, client, fake node, and tests
Boost Software License 1.0
3 stars 18 forks source link

Make double buffer works with the empty batches #63

Closed nemanja-boric-sociomantic closed 6 years ago

nemanja-boric-sociomantic commented 6 years ago

DoubleBuffer.empty() method was used to see if there are more batches to process. However, since it would work solely by looking into the buffer's length, that meant that DoubleBuffer could not detect that there's an empty batch to process. This lead to the dead lock when the node was waiting acknowledgement from the client that the batch was received, but the client didn't know that there was a batch, never acknowledging this.

Fixes #62

gavin-norman-sociomantic commented 6 years ago

What I don't understand is why the node would send an empty batch. Isn't that meaningless?

nemanja-boric-sociomantic commented 6 years ago

Yes, it is. I think it's just an implementation detail, I'll restrict that (to kill the client via the protocol error) and I'll make node not send empty data.

nemanja-boric-sociomantic commented 6 years ago

Replaced by #64