On Wed, Jan 10, 2024 at 11:51:22PM +0100, Manolis Stamatogiannakis wrote: > But I take this as a good opportunity to learn a bit about io_uring, so > I'll give it a shot myself. From my first experiments, it appears that the > code is deadlocking somewhere in IOUringEngine::finish().
Anything else would be surprising, given that this is the part that talks to io_uring. io_uring is fairly straightforward; you put out a request and then eventually it comes back with a result. The challenge for plocate is that you want to have a balance between throughput and latency; the optimal for throughput would probably be to just send every single request down to io_uring at once, but since results need to be printed in-order (anything else would be very hard to interpret for the user), that would risk showing nothing at screen before very late on, since there is no internal prioritization between the results. So plocate tries to keep only a given number of requests in flight to ensure that earlier requests are not starved by later ones, and then delay printing results until it's sure that it has the correct result up to a given point (i.e., all requests that could print something earlier have come back). This is the source of most of the complexity in there. (Also, things like path traversal that needs multiple semi-dependent requests...) > I have temporarily cloned the repo on GH [1] if you have time to check it > out. I cannot debug your debugging code, sorry. /* Steinar */ -- Homepage: https://www.sesse.net/