Stefan Fuhrmann <stefan.fuhrm...@wandisco.com> writes:

>> The original commit begins using svn_stream_wrap_buffered_read() during
>> svnadmin load-revprops and svnfsfs load-index.  This patch, however, does
>> something entirely different and adds buffering to *every* stdin.
>
> Sorry for the confusion. I did not intend to actually change the
> implementation of svn_stream_for_stdin this way but simply tried to
> demonstrate a problem with APR buffer reads for "streamy" file handles.

Thank you for the explanation.

> The underlying problem is still present: If stdin can't deliver data fast
> enough (e.g. some hick-up / long latency on the producer side of a dump |
> load), a buffered APR file will error out while a non-buffered one will
> simply wait & retry.
>
> However, I have yet to try and provoke the error specifically for the
> dump | load scenario.

I think that this problem is nonexistent.

A program doesn't need to handle EAGAIN during read() unless it puts the file
into the non-blocking mode with O_NONBLOCK [1].  We don't do that for STDIN,
and, irrespectively of what happens with the data on the other side of the
pipe, read() is going to block until the requested data is available.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html


Regards,
Evgeny Kotkov

Reply via email to