| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Closes https://github.com/eventlet/eventlet/issues/295 (in the wsgi
module we use a custom writelines implementation now).
Those write() calls might write only part of the data (and even if they
don't - it's more readable to make sure all data is written
explicitly).
I changed the test code so that the write() implementation returns the
number of characters logged and it cooperates nicely with writeall()
now.
|
| | |
|
| |
|
|
|
|
| |
.communicate()
https://github.com/eventlet/eventlet/issues/290
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The sendto() interface as defined in Python documentation:
socket.sendto(string, address)
socket.sendto(string, flags, address)
I didn't catch the fact that [1] broke this, this patch fixes it and add
a sendto/recvfrom test to make sure it doesn't happen again (turns out
we didn't have any).
GitHub issue: https://github.com/eventlet/eventlet/issues/290
Fixes: bc4d1b5 - gh-274: Handle blocking I/O errors in GreenSocket
[1] bc4d1b5d362e5baaeded35b1e339b9db08172dd2
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a socket timeout was set the sendall-like semantics was resulting
in losing information about sent data and raising socket.timeout exception.
The previous GreenSocket.send() implementation used to call fd.send() in a
loop until all data was sent. The issue would manifest if at least one
fd.send() call succeeded and was followed by a fd.send() call that would
block and a trampoline that timed out. The client code would see
socket.timeout being raised and would rightfully assume that no data was
sent which would be incorrect.
Discussed at https://github.com/eventlet/eventlet/issues/260.
The original commit[1] has been reverted because it broke the
test_multiple_readers test. After some debugging I believe I more or
less know what's going on:
The test uses sendall() which calls send() in a loop if send() reports
only part of the data sent. Previously sendall() would call send() only
one anyway because send() had sendall-like semantics; send has an
internal loop on its own and, previously, it'd call the underlying
socket object send() and, in case of partial write, call trampoline
mechanism which would switch to another greenthread ready to run.
After the change partial writes no longer result in trampoline mechanism
being called which means that during this test it's likely that
sendall() doesn't yield control to the hub even once. Similarly the
current recv() implementation - it attemps to read from a socket first
and only yields control to the hub if there's nothing to read at the
moment; when one of the readers obtained control it's likely it'd manage
to read all the data from the socket without yielding control to the hub
and letting the other reader receive any data.
The test changes the sending code so that it not only yields to the hub
but also waits a bit so that both the readers have to yield to the hub
when trying to read and there's no data available; the tests confirmed
this lets both the readers receive some data from the socket which is
the purpose of the test.
[1] 4656eadfa5ae1237036a63ad4004dbee4572debf
|
| |
|
|
|
| |
All those code blocks do the same thing so I decided to extract the
logic into a one place.
|
| |
|
|
|
|
| |
I completely missed those two.
Fixes: 24d283cfdb3cb9e6f0b4cad3d676940b4a3ce252
|
| |
|
|
|
| |
BitBucket: https://github.com/eventlet/eventlet/issues/157
GitHub: https://github.com/eventlet/eventlet/pull/56
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The original patch[1] missed one thing which I just discovered - there's
selectors.DefaultSelector alias for the "the most efficient implementation
available on the current platform"[2].
Before this patch a non-green selector class would be obtained when
DefaultSelector was used.
[1] 0d509ef7d2eea3ed4f8ade35d5d09918c811b56c
[2] https://docs.python.org/3.5/library/selectors.html#selectors.DefaultSelector
|
| |
|
|
|
|
|
|
| |
devpoll is another polling method, added in Python 3.3. We don't have
a green version of it so we better remove it too (see [1] for more
details).
[1] f63165c0e3c85699ebdb454878d1eaea13e90553
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code pretending that all the selector classes exist and
"implementing" them using SelectSelector was added in [1] because there
was no facility to easily remove things from green version of modules
(as far as I understand) - the facility has been added in [2] thus
allowing us to make this change.
As mentioned in the code I believe this approach is likely to be less
confusing than the previous one (SelectSelector doesn't expose fileno()
method that the other selectors have so it's not fully API-compatible
with them).
[1] 0d509ef7d2eea3ed4f8ade35d5d09918c811b56c
[2] f63165c0e3c85699ebdb454878d1eaea13e90553
|
| |
|
|
| |
Signed-off-by: Phus Lu phuslu@hotmail.com
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Fix recv_into(), recvfrom(), recvfrom_into() and sendto() methods of
GreenSocket to handle blocking I/O errors (ex: BlockingIOError on
Python 3). Even if the trampoline was called, the socket method can
still fails with an I/O errors for various reasons (see manual pages
of the C functions for examples).
Ref: https://github.com/eventlet/eventlet/issues/274
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The commit broke tests on Python 3[1]:
======================================================================
FAIL: test_recv_into_timeout (tests.greenio_test.TestGreenSocket)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/build/eventlet/eventlet/tests/greenio_test.py", line 192, in test_recv_into_timeout
self.fail("socket.timeout not raised")
AssertionError: socket.timeout not raised
This reverts commit 19035b10185e10719a2d34bf911d52967a8c6d08.
[1] https://travis-ci.org/eventlet/eventlet/jobs/100720347
|
| |
|
|
|
|
|
|
|
|
| |
Fix recv_into(), recvfrom(), recvfrom_into() and sendto() methods of
GreenSocket to handle blocking I/O errors (ex: BlockingIOError on
Python 3). Even if the trampoline was called, the socket method can
still fails with an I/O errors for various reasons (see manual pages
of the C functions for examples).
Ref: https://github.com/eventlet/eventlet/issues/274
|
| |
|
|
| |
Explanation in the comment in the code.
|
| |
|
|
| |
https://github.com/eventlet/eventlet/issues/240
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Original report: https://github.com/eventlet/eventlet/issues/249
Explanation is in the comments in the code.
Originally reverted[1] because a commit preceding it[2] broke the build
but it wasn't clear what commit was responsible.
[1] 02b693a45db96bd2baf27c1d5128a8bcedb8fbfc
[2] 4656eadfa5ae1237036a63ad4004dbee4572debf
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Travis CI it breaks the build with:
======================================================================
FAIL: test_multiple_readers (tests.greenio_test.TestGreenIoLong)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/build/eventlet/eventlet/tests/__init__.py", line 71, in wrapped
return func(*a, **kw)
File "/home/travis/build/eventlet/eventlet/tests/greenio_test.py", line 836, in test_multiple_readers
assert len(results2) > 0
AssertionError
This reverts commit 4656eadfa5ae1237036a63ad4004dbee4572debf.
|
| |
|
|
|
|
| |
Revert "Fix HTTPServer.serve_forever blocking whole process"
This reverts commit 801e7dd65cbd7e6e527457412a75736b5702c9c4.
|
| |
|
|
|
|
| |
Original report: https://github.com/eventlet/eventlet/issues/249
Explanation is in the comments in the code.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a socket timeout was set the sendall-like semantics was resulting
in losing information about sent data and raising socket.timeout exception.
The previous GreenSocket.send() implementation used to call fd.send() in a
loop until all data was sent. The issue would manifest if at least one
fd.send() call succeeded and was followed by a fd.send() call that would
block and a trampoline that timed out. The client code would see
socket.timeout being raised and would rightfully assume that no data was
sent which would be incorrect.
Discussed at https://github.com/eventlet/eventlet/issues/260.
|
| | |
|
| |
|
|
|
|
| |
In Python 3.5 subprocess.mswindows no longer exists. It is renamed to
subprocess._mswindows, I decided we don't really have to access that
now "private" attribute in order to know if we're on MS Windows.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Python 3, GreenFileIO.write() now always write all bytes using a
loop, to have the same behaviour than GreenPipe.write() on Python 2.
Before, the write() could be partial, write less bytes than expected.
On Python 2, GreenPipe.write() doesn't allow partial writes, it
always write all bytes, even if the user requested an unbuffered pipe
(ex: by calling os.fdopen(fd, 'wb', 0)).
Modifying Python 2 to be pedantic and allow partial writes for
unbuffered pipes will likely break a lot of applications. It's
simpler to modify Python 3 GreenFileIO to behave the same than Python
2 GreenPipe.
|
| |
|
|
|
|
| |
This commit fixes the docstring which pointed
to the wrong class eventlet.queue.Queue instead
of the one in standard library.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under certain conditions, if the WSGI iterable yields an empty string,
it can cause the response to be terminated.
The conditions are as follows:
* no minimum chunk size (eventlet.wsgi.server() was called with
minimum_chunk_size=0, or
env['eventlet.minimum_write_chunk_size'] = 0)
* chunked transfer-encoding on the response
In this case, if the WSGI iterable yields an empty string, then
eventlet.wsgi obligingly turns that into "0\r\n\r\n" and writes that
to the socket. This, of course, terminates the response as far as the
client is concerned. However, eventlet.wsgi doesn't notice, so it'll
happily keep calling next(app_iter) and sending the chunks.
If Connection: keep-alive is set, the client might then send the next
request, read some chunked response body, fail to parse it, and then
disconnect.
In other cases, either the 0-byte chunk is saved in the chunk buffer
until the minimum chunk size is met, or 0 bytes get written to the
socket. Those are both no-ops.
This commit discards 0-byte chunks from the WSGI iterable.
|
| |
|
|
| |
https://github.com/eventlet/eventlet/issues/243
|
| | |
|
| |
|
|
|
|
|
|
| |
- skip request body discarding when connection was to be closed anyway
- handle ChunkReadError while discarding, write to log, close connection
https://github.com/eventlet/eventlet/issues/27
https://github.com/eventlet/eventlet/issues/242
|
| |
|
|
|
| |
It must always return bytes.
https://github.com/eventlet/eventlet/issues/245
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When a client is sending a chunked request body and disconnects
between chunks, wsgi.Input.read() raises a ValueError. That's fine if
you can remember to wrap every single call to read/readline in a
try/except, but it's bad for a higher-level error handler because so
many things raise ValueError.
This adds in a new error class wsgi.ChunkReadError and raises that
instead. It inherits from ValueError so anyone catching ValueError
should continue to work.
|
| |
|
|
|
|
| |
required to make pytest work with an active eventlet.monkey_patch() on py3
https://github.com/eventlet/eventlet/pull/239
|
| |
|
|
|
| |
* Fix import syntax for Python 3: use relative imports
* Add unit test
|
| |
|
|
|
|
|
|
|
|
| |
Hrachyshka
For UNIX sockets, getsockname() returns a string, not a 2-tuple, that
represents the file path that is assigned to it. That's why we need a
special handling for the socket type.
https://github.com/eventlet/eventlet/issues/235
|
| |
|
|
| |
https://github.com/eventlet/eventlet/issues/192
|
| | |
|
| |
|
|
| |
https://github.com/eventlet/eventlet/issues/226
|
| | |
|
| |
|
|
|
|
| |
Fix the monkey-patching of the threading module on Python 3.4. Instead
of removing the thread state lock, patch the _bootstrap_inner() method
to release it.
|
| | |
|
| |
|
|
|
|
|
|
| |
For the Python implementation of threading.RLock because the new C
implementation of threading.RLock of Python 3.3 is not compatible with
eventlet monkey patching.
Fix the issue #185.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
* I ran into issues where, when passing DNS messages through a proxy with
eventlet 0.17.1 sockets would be prematurely closed. This was not the case in 0.16.1.
This fixes the issue
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Provide a compatibility layer in eventlet.wsgi that allows you
to hand a python logger as the log parameter instead of a
filehandle.
If an object that looks like a python logger is passed, we use
it as expected. If not, we assume this is a fileobject that
implements the write() call, and wrap it in a compatiblity layer
that lets us user log() and debug() calls on it, including
optional *args.
https://github.com/eventlet/eventlet/pull/75
|