summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tests: getaddrinfo(host, 0) is not supported on OpenIndiana platformHEADmasterSergey Shepelev2023-03-271-7/+7
| | | | https://github.com/eventlet/eventlet/issues/791
* dep: greenlet>=1.0 removing unused clear_sys_exc_info stubSergey Shepelev2023-03-279-24/+2
| | | | fixes https://github.com/eventlet/eventlet/issues/763
* build: include tox.ini and repo docs in PyPI packageSergey Shepelev2023-03-011-1/+1
| | | | fixes https://github.com/eventlet/eventlet/issues/790
* wsgi: Allow keepalive option to be a timeoutTim Burke2023-02-222-3/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes the server pool fills up; all max_size greenthreads are already in use with other connections. One more connection gets accept()ed, but then has to wait for a slot to open up to actually be handled. This works out fine if your clients tend to make a single request then close the connection upon receiving a response. It works out OK-ish when clients are continually pipelining requests; the new connection still has to wait, but at least there's plenty of work getting processed -- it's defensible. It can work out pretty terribly if clients tend to hold on to connections "just in case" -- we're ignoring fresh work from a new client just so we can be ready-to-go if an existing connection wakes up. There are a couple existing tunings we can use, but they can each have downsides: - Increasing max_size is nice for dealing with idle connections, but can cause hub contention and high latency variance when all those connections are actually busy. - socket_timeout can be used to limit the idle socket time, but it *also* impacts send/recv operations while processing a request, which may not be desirable. - keepalive can be set to False, disabling request pipelining entirely. Change the keepalive option to wsgi.server so it can be the timeout to use while waiting for a new request, separate from socket_timeout. By default, socket_timeout continues to be used.
* dns: support host as bytes in getaddrinfo, resolveGorka Eguileor2023-02-022-1/+30
| | | | | | | | | | | | | | | Relevant traceback: ``` File "dns/resolver.py", line 858, in query if qname.is_absolute(): AttributeError: 'bytes' object has no attribute 'is_absolute' ``` Fixes https://github.com/eventlet/eventlet/issues/599 Co-authored-by: Sergey Shepelev <temotor@gmail.com> Co-authored-by: Tim Burke <tim.burke@gmail.com>
* green.http: collections.Iterable alias removed in Python 3.10, CI 3.10, drop ↵Sergey Shepelev2023-01-223-20/+28
| | | | | | | | non-essential CI against 2.7 to 3.6 fixes https://github.com/eventlet/eventlet/issues/740 related to https://github.com/eventlet/eventlet/pull/715
* hubs: drop pyevent hubSergey Shepelev2023-01-2220-326/+43
| | | | https://github.com/eventlet/eventlet/pull/657
* doc: fix sys.path for shared sphinx-buildTomasz Kłoczko2023-01-201-1/+1
| | | | | | https://github.com/eventlet/eventlet/issues/785 Signed-off-by: Sergey Shepelev <temotor@gmail.com>
* chore: CI upgrades, pycodestyle fix 2 empty lines after class/defSergey Shepelev2023-01-1829-39/+75
| | | | | | - github actions ubuntu-latest switched to 22.04 with python3>=3.7 - tool: pep8 was renamed and upgraded to pycodestyle 2.1, fixed 2 empty lines after class/def - common github actions upgrade to v3 https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
* Change ssl to return a socket.timeout exception on timeout instead of an ↵Bas Zoetekouw2023-01-181-1/+1
| | | | | | | | | | | | | | | SSLError Back in Python 3.2, ssl.SSLError used to be a subclass of socket.error (see https://docs.python.org/3/library/ssl.html#exceptions), so timeouts on monkeypatched ssl sockets would be properly caught by socket.timeout excpetion handlers in applications. However, since Python 3.3 ssl.SSLerror is a subclass of OSError, which signifies a different (typically fatal) type of error that is usually not handled gracefully by applications. By changing the timeout excpetion back to socket.timeout, libraries such as pymysql and redis will again properly support TLS-connections in monkeypatched apoplications.
* green.http: https connections were blockingSergey Shepelev2023-01-181-1/+1
| | | | fixes https://github.com/eventlet/eventlet/issues/457
* Fix WSGI testTim Burke2023-01-181-1/+7
|
* Fix tox errorTim Burke2023-01-181-1/+3
| | | | | | | | | | | | tox>=4.0.0 changed passenv from a space-separated list to a comma-separated list. tox>=4.0.6 made it a hard error to include spaces, complaining pass_env values cannot contain whitespace, use comma to have multiple values in a single line Switch to using multiple lines for the multiple variables to be compatible with both tox3 and tox4.
* v0.33.3 releasev0.33.3Sergey Shepelev2023-01-182-1/+5
|
* Fix greendns for dnspython 2.3.0+Tim Burke2023-01-171-2/+8
| | | | | | | | | | | | | dnspython added more type annotations in 2.3.0 -- because of how we reimport the package piece by piece, though, not all of the types would be available during reimport, leading to AttributeErrors like module 'dns.rdtypes' has no attribute 'ANY' Now, do all of our rdtypes special-handling *first*, before reimporting any other submodules. Addresses #781
* v0.33.2 releasev0.33.2Sergey Shepelev2022-11-172-1/+5
|
* Stop using deprecated threading APIsTim Burke2022-07-261-2/+2
| | | | | | | Way back in py26, snake_case alternatives were added for the old camelCase APIs. py310 started emitting DeprecationWarnings about them; presumably they'll look to remove the old APIs eventually. See https://github.com/python/cpython/commit/9825bdfb
* test: GreenPipe with mode w+, a+wuming02022-07-081-0/+20
| | | https://github.com/eventlet/eventlet/issues/757
* greenio: GreenPipe/fdopen() with 'a' in mode raised io.UnsupportedOperation: ↵wuming02022-06-273-1/+46
| | | | | | | | | File or stream is not writable https://github.com/eventlet/eventlet/pull/758 https://github.com/eventlet/eventlet/issues/757 Co-authored-by: Sergey Shepelev <temotor@gmail.com>
* v0.33.1 releasev0.33.1Sergey Shepelev2022-05-132-1/+5
|
* add GitHub URL for PyPiAndrii Oriekhov2022-03-021-0/+3
|
* ci: remove redundant basepython decls from tox.iniMichał Górny2022-02-241-9/+0
| | | | | | | Remove basepython declarations from tox.ini where they match what tox already infers from the environment name. This is NFC for existing testenvs, and it makes it possible to run tests on newer Python targets, e.g. py310-*.
* Prevent deadlock on logging._lockTim Burke2022-01-071-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Or at least, reduce the likelihood of it. We've seen deadlocks when GC runs while in the process of releasing an RLock; it results in a stack that looks like File ".../logging/__init__.py", line 232, in _releaseLock _lock.release() File ".../threading.py", line 189, in release self._block.release() File ".../eventlet/lock.py", line 24, in release return super(Lock, self).release(blocking=blocking) File ".../logging/__init__.py", line 831, in _removeHandlerRef acquire() File ".../logging/__init__.py", line 225, in _acquireLock _lock.acquire() That is, we try to release the lock, but in between clearing the RLock ownership information and releasing the underlying Lock, GC runs and invokes a weakref callback, which in turn tries to acquire the RLock. Since the ownership information has already been cleared, the lock's no longer re-entrant and everything seizes. This seems to have become more of a problem since we separated Lock and Semaphore; apparently the extra stack frame makes it much more likely that GC can sneak in during that critical moment. So, inline the release inside of Lock rather than punting to Semaphore; the implementation is simple anyway, and hasn't changed for at least 12 years (since Semaphore was pulled out to its own module). Closes #742
* v0.33.0 releasev0.33.0Sergey Shepelev2021-11-162-1/+9
|
* Create a DNS resolver lazily rather than on import (fixes #736)Dmitry Tantsur2021-11-162-1/+18
| | | | | Creating a DNS resolver on import results in a failure in environments where DNS is not available (containers, service ramdisks, etc).
* green.thread: unlocked Lock().release() should raise exception, returned TrueMichael Wright2021-10-285-28/+55
| | | | | | | https://github.com/eventlet/eventlet/issues/697 https://github.com/eventlet/eventlet/pull/721 Co-authored-by: Sergey Shepelev <temotor@gmail.com> Co-authored-by: Tim Burke <tim.burke@gmail.com>
* setup.cfg: Replace dashes with underscoresArthur Zamarin2021-10-121-1/+1
| | | | | | | | | | | | | | | | Setuptools v54.1.0 introduces a warning that the use of dash-separated options in 'setup.cfg' will not be supported in a future version [1]. Get ahead of the issue by replacing the dashes with underscores. Without this, we see 'UserWarning' messages like the following on new enough versions of setuptools: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead [1] https://github.com/pypa/setuptools/commit/a2e9ae4cb Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Python 3.10 partial supportTim Burke2021-10-085-6/+20
| | | | | | | | | | | | | | | | | Everything below is specific to changes in Python 3.10. https://github.com/eventlet/eventlet/pull/715 - Only wrap socket.timeout on Python < 3.10 socket.timeout is TimeoutError, which our is_timeout() helper func already knows. fixes https://github.com/eventlet/eventlet/issues/687 - Working greenio._open _pyio.open is now a staticmethod, so we've got to go down to _pyio.open.__wrapped__ to get to the python function object. - Test using eventlet.is_timeout rather than requiring an is_timeout attribute on errors. TimeoutErrors (which are covered by is_timeout) can't necessarily have attributes added to them. - Fix backdoor tests Skip build info line at interpreter startup. Also, start printing the banner as we read it to aid in future debugging. - Tolerate __builtins__ being a dict (rather than module) in is_timeout (@tipabu) still not sure how this happens, but somehow it does in socket_test.test_error_is_timeout.
* ssl: GreenSSLContext minimum_version and maximum_version settersBob Haddleton2021-09-293-0/+26
| | | | | https://github.com/eventlet/eventlet/pull/727 Co-authored-by: Sergey Shepelev <temotor@gmail.com>
* wsgi: Don't break HTTP framing during 100-continue handlingTim Burke2021-09-132-10/+110
| | | | | | | | | | | | | | | | | | | | | | | Expect: 100-continue is a funny beast -- the client sends it to indicate that it's willing to wait for an early error, but - the client has no guarantee that the server supports 100 Continue, - the server gets no indication of how long the client's willing to wait for the go/no-go response, and - even if it did, the server has no way of knowing that the response it *emitted* within that time was actually *received* within that time - so the client may have started sending the body regardless of what the server's done. As a result, the server only has two options when it *does not* send the 100 Continue response: - close the socket - read and discard the request body Previously, we did neither of these things; as a result, a request body could be interpreted as a new request. Now, close out the connection, including sending a `Connection: close` header when practical.
* v0.32.0 releasev0.32.0Sergey Shepelev2021-09-012-1/+7
|
* codecov: allow 3% threshold to pass status checkSergey Shepelev2021-09-011-0/+5
|
* greendns: compatibility with dnspython v2Felix Yan2021-09-016-14/+84
| | | | | | | | | | | | Compatibility with dnspython v2: - `_compute_expiration` was replaced by `_compute_times` - `dns.query.{tcp,udp}` take new arguments Main issue for tracking: https://github.com/eventlet/eventlet/issues/619 This patch discussion: https://github.com/eventlet/eventlet/pull/722 This patch deprecates dnspython<2 pin: https://github.com/eventlet/eventlet/issues/629 Co-authored-by: John Vandenberg <jayvdb@gmail.com> Co-authored-by: Rodolfo Alonso Hernandez <ralonsoh@redhat.com>
* websocket: Do not send compressed control framesOnno Kortmann2021-08-161-1/+11
| | | | | | | | | This disables compression for the control frames sent by the websocket. As per RFC 7692, Section 6.1: An endpoint MUST NOT set the "Per-Message Compressed" bit of control frames and non-first fragments of a data message.
* docs: fix a few simple typosTim Gates2021-08-163-3/+3
| | | | | | | | | | | | | | There are small typos in: - eventlet/zipkin/client.py - tests/hub_test.py - tests/wsgi_test.py Fixes: - Should read `propagating` rather than `propogating`. - Should read `implementation` rather than `implementaiton`. - Should read `address` rather than `addoress`. Closes #710
* Fixed wrap_socket missing ciphers parameter bug.Jerry Wu2021-07-171-0/+1
|
* v0.31.1 releasev0.31.1Sergey Shepelev2021-07-122-1/+5
|
* ci: cache pip/tox; faster tox with `skipdist` and `usedevelop`Sergey Shepelev2021-05-133-3/+41
|
* Add classifiers for py38 and py39Tim Burke2021-05-121-0/+2
|
* ssl: py3.6 using client certificates raised ValueError: check_hostname needs ↵Paul Lockaby2021-05-112-1/+25
| | | | | | | server_hostname argument https://github.com/eventlet/eventlet/issues/567 https://github.com/eventlet/eventlet/pull/575
* tests: extend default mysqldb test timeout to 5sSergey Shepelev2021-05-111-0/+2
|
* replace Travis with Github (actions) CISergey Shepelev2021-05-106-81/+108
|
* v0.31.0 releasev0.31.0Sergey Shepelev2021-05-052-1/+5
|
* websocket: Limit maximum uncompressed frame length to 8MiBOnno Kortmann2021-05-052-7/+86
| | | | | | | This fixes a memory exhaustion DOS attack vector. References: GHSA-9p9m-jm8w-94p2 https://github.com/eventlet/eventlet/security/advisories/GHSA-9p9m-jm8w-94p2
* v0.30.3 releasev0.30.3Sergey Shepelev2021-05-052-1/+8
|
* wsgi: websocket ALREADY_HANDLED flag on corolocalChoi Geonu2021-05-024-22/+47
| | | https://github.com/eventlet/eventlet/issues/543
* green.ssl: Set suppress_ragged_eofs default based on SSLSocket defaultsreese-allison2021-04-121-1/+1
| | | | | | | Error: `EOF occurred in violation of protocol (_ssl.c:2570)` in some HTTPS `connection: close` scenario. This is a result of suppress_ragged_eofs defaulting to True in SSLSocket, but defaulting to None in GreenSSLSocket when monkey_patched. This only occurs in Python 3.7+. https://github.com/eventlet/eventlet/pull/695
* Security Policysecurity-policySergey Shepelev2021-03-311-0/+19
|
* greenio: socket.connect_ex returned None instead of 0 on success696-connect_exSergey Shepelev2021-03-252-0/+10
| | | | | | https://github.com/eventlet/eventlet/issues/696 Co-authored-by: Skyline124 <gregoire2011dumas@gmail.com>
* Use _imp instead of deprecated impOndřej Nový2021-03-172-2/+8
| | | | | | Module imp is deprecated in favour of importlib. But importlib doesn't support acquire_lock/release_lock/lock_held. Use internal _imp module instead.