summaryrefslogtreecommitdiff
path: root/eventlet
Commit message (Collapse)AuthorAgeFilesLines
* wsgi: Fix handling partial writes on Python 3partial-write-fix-2Jakub Stasiak2016-02-092-8/+30
| | | | | | | | | | | | | 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.
* v0.18.1 releasev0.18.1Sergey Shepelev2016-01-251-1/+1
|
* patcher: certain order of import subprocess and monkey_patch breaks ↵issue-290Sergey Shepelev2016-01-241-1/+3
| | | | | | .communicate() https://github.com/eventlet/eventlet/issues/290
* greenio: Fix "TypeError: an integer is required" in sendto()Jakub Stasiak2016-01-241-2/+2
| | | | | | | | | | | | | | | | | 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
* v0.18.0 releasev0.18.0Sergey Shepelev2016-01-231-1/+1
|
* greenio: Remove sendall-like semantincs from GreenSocket.sendJakub Stasiak2016-01-231-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* patcher: Eliminate some redundancyJakub Stasiak2016-01-121-21/+13
| | | | | All those code blocks do the same thing so I decided to extract the logic into a one place.
* Fix whitespace to conform to our linting testsJakub Stasiak2016-01-121-1/+1
| | | | | | I completely missed those two. Fixes: 24d283cfdb3cb9e6f0b4cad3d676940b4a3ce252
* backdoor: Add Unix and IPv6 socket supportbackdoorEric Urban2016-01-111-5/+27
| | | | | BitBucket: https://github.com/eventlet/eventlet/issues/157 GitHub: https://github.com/eventlet/eventlet/pull/56
* green selectors: Override DefaultSelector as wellJakub Stasiak2016-01-111-0/+3
| | | | | | | | | | | | 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
* green select: Make sure devpoll method is removedJakub Stasiak2016-01-111-1/+1
| | | | | | | | 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
* green selectors: Remove non-green selectorsJakub Stasiak2016-01-111-12/+12
| | | | | | | | | | | | | | | | 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
* greenio: Fix missing bufsize parameter for GreenPipePhus Lu2016-01-111-1/+1
| | | | Signed-off-by: Phus Lu phuslu@hotmail.com
* greenio: Add some explanation regarding recving 0 bytesJakub Stasiak2016-01-101-0/+6
|
* gh-274: Handle blocking I/O errors in GreenSocketVictor Stinner2016-01-101-31/+35
| | | | | | | | | | 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
* Revert "gh-274: Handle blocking I/O errors in GreenSocket"Jakub Stasiak2016-01-071-21/+26
| | | | | | | | | | | | | | | | 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
* gh-274: Handle blocking I/O errors in GreenSocketVictor Stinner2016-01-071-26/+21
| | | | | | | | | | 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
* green select: Delete unpatched methodsJakub Stasiak2016-01-072-0/+5
| | | | Explanation in the comment in the code.
* green.ssl don't monkey-patch at import timeDavid Szotten2016-01-061-9/+27
| | | | https://github.com/eventlet/eventlet/issues/240
* Fix HTTPServer.serve_forever blocking whole processJakub Stasiak2016-01-062-1/+27
| | | | | | | | | | | | 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
* Revert "greenio: Remove sendall-like semantincs from GreenSocket.send"Jakub Stasiak2015-11-231-1/+9
| | | | | | | | | | | | | | | | 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.
* Temporarily revert build breaker.Sergey Shepelev2015-11-232-27/+1
| | | | | | Revert "Fix HTTPServer.serve_forever blocking whole process" This reverts commit 801e7dd65cbd7e6e527457412a75736b5702c9c4.
* Fix HTTPServer.serve_forever blocking whole processJakub Stasiak2015-11-222-1/+27
| | | | | | Original report: https://github.com/eventlet/eventlet/issues/249 Explanation is in the comments in the code.
* greenio: Remove sendall-like semantincs from GreenSocket.sendJakub Stasiak2015-11-221-9/+1
| | | | | | | | | | | | | | 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.
* wsgi: document default value for max_size (1024); Thanks to ashutosh-mishrap262ashutosh-mishra2015-11-111-0/+1
|
* subprocess: Fix Python 3.5 mswindows regressionJakub Stasiak2015-11-051-2/+3
| | | | | | 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.
* python3: Stdlib_Queue from six.movesSergey Shepelev2015-10-131-1/+1
|
* GH #248: Fix GreenFileIO.write()Victor Stinner2015-10-131-4/+9
| | | | | | | | | | | | | | | 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.
* Fix docstring which pointed to wrong QueueqdocRamakrishnan G2015-10-131-7/+9
| | | | | | This commit fixes the docstring which pointed to the wrong class eventlet.queue.Queue instead of the one in standard library.
* wsgi: don't buffer empty strings from the applicationSamuel Merritt2015-10-121-2/+3
|
* wsgi: suppress output of 0-byte chunksSamuel Merritt2015-10-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* subprocess: support universal_newlinesSergey Shepelev2015-09-161-2/+13
| | | | https://github.com/eventlet/eventlet/issues/243
* Python 3 compat: Fix TypeError on empty websocket messagemui2015-09-151-1/+1
|
* wsgi: improved request body discardwsgi-drop-invalidSergey Shepelev2015-09-071-16/+24
| | | | | | | | - 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
* greenio: socket.recv() could return str; Thanks to jerzyksocket_recv_strSergey Shepelev2015-09-061-1/+1
| | | | | It must always return bytes. https://github.com/eventlet/eventlet/issues/245
* wsgi: better error for chunk read failuresSamuel Merritt2015-08-101-1/+8
| | | | | | | | | | | | 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.
* support buflen=-1 and readall like FileIO doesdavidszotten-greenfileio_readallDavid Szotten2015-07-241-2/+18
| | | | | | required to make pytest work with an active eventlet.monkey_patch() on py3 https://github.com/eventlet/eventlet/pull/239
* Port eventlet.green.OpenSSL to Python 3py3_opensslVictor Stinner2015-06-301-5/+5
| | | | | * Fix import syntax for Python 3: use relative imports * Add unit test
* wsgi: UNIX socket address was trimmed in "wsgi starting" log; Thanks to Ihar ↵gh-235Sergey Shepelev2015-06-021-13/+20
| | | | | | | | | | 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
* greenio: send() was running empty loop on ENOTCONN; Thanks to Seyeong Kimgh-192Sergey Shepelev2015-05-151-1/+2
| | | | https://github.com/eventlet/eventlet/issues/192
* v0.17.4 releasev0.17.4Sergey Shepelev2015-05-091-1/+1
|
* ssl: incorrect initalization of default context; Thanks to stuart-mclarengh-226Sergey Shepelev2015-05-021-1/+1
| | | | https://github.com/eventlet/eventlet/issues/226
* v0.17.3 releasev0.17.3Sergey Shepelev2015-04-091-1/+1
|
* Issue #223: Fix threading monkey-patching on py3.4Victor Stinner2015-04-091-3/+13
| | | | | | 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.
* Disable the thread state lockpr/187Victor Stinner2015-04-051-0/+14
|
* Fix threading.Condition with monkey-patchingVictor Stinner2015-04-051-0/+7
| | | | | | | | 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.
* Semaphore.acquire() accepts timeout=-1Victor Stinner2015-04-051-2/+10
|
* v0.17.2 releasev0.17.2Sergey Shepelev2015-04-031-1/+1
|
* Use _socket_nodns and select in dnspython supportTim Simmons2015-04-031-3/+16
| | | | | | * 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
* wsgi: Provide python logging compatibilitywsgi-logging-gh-75Sean Dague2015-03-311-14/+40
| | | | | | | | | | | | | | 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