[pypy-commit] [OPEN] Pull request #12 for pypy/pypy: Don't lose data when doing non-blocking I/O

Bitbucket pullrequests-noreply at bitbucket.org
Sun Oct 23 18:03:00 CEST 2011


A new pull request has been opened by Stefano Rivera.

stefanor/pypy has changes to be pulled into pypy/pypy.

https://bitbucket.org/pypy/pypy/pull-request/12/dont-lose-data-when-doing-non-blocking-i-o

Title: Don't lose data when doing non-blocking I/O

Continuing on from 3f96afe7cdc2, I looked for all other possible data loss, when EAGAIN's could be thrown.

The common scenario is that many layers of the stream stack temporarily cache read data, while read()ing in a loop, and then return the data, concatenated. This breaks when you receive an EAGAIN.

I started by auditing the code to find possible problems, then writing tests that could expose them, then fixing the bugs. There isn't a strict relationship between tests and patches, rather, vaguley-comprehensive tests.

The tests are a bit ugly, I can't see any way to avoid massive code duplication or multiple asserts per test. Suggestions welcome :)

Changes to be pulled:

2f16a8889242 by Stefano Rivera: "Merge default"
f07445d2e8d2 by Stefano Rivera: "Catch EAGAIN in Stream.readline()"
808debcd8f67 by Stefano Rivera: "Catch EAGAIN in TextCRLFFilter.read()"
220c023da717 by Stefano Rivera: "Add AppTestCRLFFilterNonblocking to test TextCRLFilter on non-Windows"
0f58b4a9bb8b by Stefano Rivera: "Catch EAGAIN in W_File.direct_readline()"
3b966a3257d5 by Stefano Rivera: "Extend AppTestNonblocking to exercise limited size readlines()s, and reads that …"
52f9fa5f396a by Stefano Rivera: "Catch EAGAIN in W_File.direct_read()"
ca15c5b74132 by Stefano Rivera: "Catch EAGAIN in BufferingInputStream.readline()"
71219b370d01 by Stefano Rivera: "Catch EAGAIN in BufferingInputStream.read()"
c3e17ec33491 by Stefano Rivera: "Extend AppTestNonblocking to exercise limited size read()s"
bf0c77b5c906 by Stefano Rivera: "Catch EAGAIN in TextInputFilter.readline()"
e5179b65e805 by Stefano Rivera: "Extend AppTestNonblocking to create a larger variety of test file objects (excer…"
30fe8615eee1 by Stefano Rivera: "Handle EAGAIN correctly for unbuffered files too"
a2025a6c6031 by Stefano Rivera: "Handle EAGAIN correctly for unbuffered files too"


--
This is an issue notification from bitbucket.org.
You are receiving this either because you are the participating
in a pull request, or you are following it.



More information about the pypy-commit mailing list