Arne Goedeke wrote:
Commit 20d1fa961d0059657d471d700ce63bcb3ab9d3ca mentions that there is a bug in the Stdio.Buffer support in Stdio.File()->write() (I assume). Stephen, can you explain how it is broken? Do you have a test case? Does it have something to do with the fact that you are using a subclass of Stdio.Buffer?
Yes, I subclass Stdio.Buffer, but I don't think it's an inherit-related bug.
Inside that reverted commit you can see what I did. I tried to eliminate usage of output_to() in favour of using Stdio.File()->write(Stdio.Buffer) instead.
Literally here:
consume(socket->write(this));
this points to a Stdio.Buffer inherited object.
As to what exactly goes wrong... What I can report is that using that commit, it mostly works, until the scheduling gets tight. I.e. under intense pgsql query load, things go wrong. So that suggests that there might be issues that occur when in one thread the write(Stdio.Buffer) runs, and while simultaneously in a different thread bytes are added to that very same Stdio.Buffer.
It's hard to give you a concise broken case. Maybe a case can be synthesised using the above speculation.