ringbahn / ringbahn

safe bindings to io-uring

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is the DemoDriver releasing every completed event?

withoutboats opened this issue · comments

@twissel reports issues with driver freezes which they believe are caused by failure to release every blocked access. #26 was supposed to fix this problem, but they report it still persists.

I'm going to try to reproduce locally and see if I can identify how we are not releasing every access we block in the current demo driver.

@twissel ran your test repeatedly, found a hang which helpfully also reported:

thread '<unnamed>' panicked at 'explicit panic', src/completion.rs:104:44

If this is the same bug you've been encountering, this would not be related to the access queue at all, but rather somehow we have double completed a CQE. No idea how that would be happening.

@withoutboats , it's just hangs for me, without any panics.

@twissel I'll keep running tests and see if I can reproduce that. To be clear: in the situation I encountered, the background that processes completion thread panicked, but the test as a whole just hangs once that thread panics. But I would expect that you would see a panic message if that happens, so you've probably encountered a different issue.

@twissel I have reproduced your hang as well. Both the hang and the panic are very intermitent for me (on the order of 1 in 100 test runs), will need more logging to figure out what state the driver has gotten into (but you are right that the accessqueue accidentally running out of accesses is a very likely culprit for the hang).

I'm going to focus on the issues causing the write hangs in Ring first, because a) those happen every single time and so Ring's write impl is flat out wrong, b) these bugs seem to be in the DemoDriver which is in some way periphery to the core API of ringbahn.

Great, no worries about demo driver, I discovered this bug while was experimenting with not so demo driver (but it was using AccessQueue as well)