From 0722a3be5956fb1235fcbea13fa3a50d5fe226ea Mon Sep 17 00:00:00 2001 From: Facundo Batista Date: Tue, 1 Oct 2024 08:24:37 -0300 Subject: [PATCH 001/356] Fixed typo --- docs/source/design.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/design.rst b/docs/source/design.rst index b366fbabc..6796e9695 100644 --- a/docs/source/design.rst +++ b/docs/source/design.rst @@ -75,7 +75,7 @@ WSGI application, this is not a recommended configuration. AsyncIO Workers --------------- -Third-party workers can be usedd to use Gunicorn with asyncio frameworks. +Third-party workers can be used to use Gunicorn with asyncio frameworks. Choosing a Worker Type ====================== From 68f3545e5bad08e9e08e7c4af3412e414e76433a Mon Sep 17 00:00:00 2001 From: Adrien Kunysz Date: Tue, 8 Apr 2025 15:17:38 +0200 Subject: [PATCH 002/356] Fix typo in comment. --- gunicorn/workers/ggevent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gunicorn/workers/ggevent.py b/gunicorn/workers/ggevent.py index 4bcfecb49..437eb7d02 100644 --- a/gunicorn/workers/ggevent.py +++ b/gunicorn/workers/ggevent.py @@ -109,7 +109,7 @@ def run(self): self.notify() gevent.sleep(1.0) - # Force kill all active the handlers + # Force kill all the active handlers self.log.warning("Worker graceful timeout (pid:%s)", self.pid) for server in servers: server.stop(timeout=1) From dbc00fca76120ef398bbe02f2a05dd7976830887 Mon Sep 17 00:00:00 2001 From: Adrien Kunysz Date: Wed, 16 Apr 2025 15:58:49 +0200 Subject: [PATCH 003/356] Specify the units for `graceful_timeout`. --- gunicorn/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gunicorn/config.py b/gunicorn/config.py index 07c5aab34..29b30ad23 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -807,7 +807,7 @@ class GracefulTimeout(Setting): type = int default = 30 desc = """\ - Timeout for graceful workers restart. + Timeout for graceful workers restart in seconds. After receiving a restart signal, workers have this much time to finish serving requests. Workers still alive after the timeout (starting from From a03c44e39a290362c3bbc2c3f37b001c1c3f1299 Mon Sep 17 00:00:00 2001 From: Ahmad Bilal <4767448+SomeAB@users.noreply.github.com> Date: Sat, 26 Apr 2025 02:00:05 +0530 Subject: [PATCH 004/356] Updated IRC Channel info & Slightly improved the Community Doc The Community page was a little bit outdated. Specially the IRC channel info was totally wrong, causing potential help-seekers issues in finding the correct channel/network. Also, slightly updated the Community page text. Its not perfect, but is a noticeable improvement imho. Fixed some broken links. --- docs/source/community.rst | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/docs/source/community.rst b/docs/source/community.rst index e16767447..be5bd09de 100644 --- a/docs/source/community.rst +++ b/docs/source/community.rst @@ -2,38 +2,36 @@ Community ========= -Use these channels to communicate about the project. +Use these channels to communicate about the project: Project Management & Discussions ================================ -Gunicorn uses `GitHub for the project management `_. GitHub issues are used -for 3 different purposes: +Project maintenance guidelines are available on the `wiki `_ - * `Bug tracker `_ : to check latest bug - * `Forum `_ : Stackoverflow-style questions about Gunicorn usage - * `Mailing list `_ : Discussion of Gunicorn development, new features - and project management. +GitHub issues are used for 3 different purposes: -Project maintenance guidelines are available on the `wiki `_ -. + * `Bug tracker `_ : To check for latest bugs. Tip: See existing issues before opening a new one! + * `Forum `_ : Stackoverflow-style questions about Gunicorn usage. + * `Other Issues `_ : Discussion of Gunicorn development, new features + and project management. IRC === -The Gunicorn channel is on the `Freenode `_ IRC -network. You can chat with other on `#gunicorn channel -`_. +The Gunicorn channel is on the `Libera Chat `_ IRC +network. You can chat with others on `#gunicorn channel +`_ Issue Tracking ============== Bug reports, enhancement requests and tasks generally go in the `Github -issue tracker `_. +issue tracker `_ Security Issues =============== The security mailing list is a place to report security issues. Only developers are subscribed to it. To post a message to the list use the address -to `security@gunicorn.org `_ . +to `security@gunicorn.org `_ From 561201963e53d00582545bcdc569d0ac9475244f Mon Sep 17 00:00:00 2001 From: Ahmad Bilal <4767448+SomeAB@users.noreply.github.com> Date: Sat, 26 Apr 2025 15:02:43 +0530 Subject: [PATCH 005/356] Fixed Link for Consistency Made the link format to be more consistent with what is on community frontpage --- docs/source/community.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/community.rst b/docs/source/community.rst index be5bd09de..5bfe51c08 100644 --- a/docs/source/community.rst +++ b/docs/source/community.rst @@ -21,7 +21,7 @@ IRC The Gunicorn channel is on the `Libera Chat `_ IRC network. You can chat with others on `#gunicorn channel -`_ +`_ Issue Tracking ============== From 0ff67f6d186568cb1bcda1b37be5827939eaef03 Mon Sep 17 00:00:00 2001 From: Ahmad Bilal <4767448+SomeAB@users.noreply.github.com> Date: Sat, 26 Apr 2025 15:08:24 +0530 Subject: [PATCH 006/356] Noticed a broken link in CONTRIBUTING.md Saw and Fixed another broken link to IRC (made it consistent) in the master/CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1231e715c..0ef79de3d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -157,7 +157,7 @@ benoitc. * Step 1: learn the component inside out * Step 2: make yourself useful by contributing code, bugfixes, support etc. -* Step 3: volunteer on the irc channel (#gunicorn@freenode) +* Step 3: volunteer on our [Libera Chat](https://libera.chat/) irc channel [#gunicorn](https://web.libera.chat/?channels=#gunicorn) Don't forget: being a maintainer is a time investment. Make sure you will have time to make yourself available. You don't have to be a From 1076fa94d4a6ec390cbeca8979cf53e65375c498 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 17:06:33 +0000 Subject: [PATCH 007/356] Bump actions/checkout from 4 to 5 Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/lint.yml | 2 +- .github/workflows/tox.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fa6935f43..106016988 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,7 +20,7 @@ jobs: - toxenv: null python-version: "3.10" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Using Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 759800eb1..99dcdd6a3 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -45,7 +45,7 @@ jobs: python-version: "3.13" unsupported: true steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Using Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: From fb16101064fc275ca1dbab81d09cbcf646c9111e Mon Sep 17 00:00:00 2001 From: Chris Carini <6374067+ChrisCarini@users.noreply.github.com> Date: Fri, 19 Sep 2025 16:03:14 -0700 Subject: [PATCH 008/356] fix[typo]: `usedd` -> `used` --- docs/source/design.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/design.rst b/docs/source/design.rst index b366fbabc..6796e9695 100644 --- a/docs/source/design.rst +++ b/docs/source/design.rst @@ -75,7 +75,7 @@ WSGI application, this is not a recommended configuration. AsyncIO Workers --------------- -Third-party workers can be usedd to use Gunicorn with asyncio frameworks. +Third-party workers can be used to use Gunicorn with asyncio frameworks. Choosing a Worker Type ====================== From 974790c0d81e90e6397832f289bccf41d66b9a17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 21:02:10 +0000 Subject: [PATCH 009/356] Bump actions/setup-python from 5 to 6 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/lint.yml | 2 +- .github/workflows/tox.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fa6935f43..b5ff2b96b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,7 +22,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Using Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} cache: pip diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 759800eb1..42d51a292 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -47,7 +47,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Using Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} cache: pip From 1dc4ce9d59c3458305d701c4c6d63aa6b1d1b309 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Sun, 5 Oct 2025 19:55:32 +0200 Subject: [PATCH 010/356] Update to support only Python 3.12 and 3.13 (#3422) * Update CI and project to support only Python N (3.13) and N-1 (3.12) - Update GitHub Actions workflows to test only Python 3.12 and 3.13 - Update pyproject.toml to require Python >= 3.12 - Update tox.ini to test only py312 and py313 - Update documentation to reflect Python 3.12+ requirement - Clean up AppVeyor configuration for Python 3.12 * Update pylint to 3.3.2 for Python 3.12 compatibility * Disable new pylint warnings for pre-existing issues --- .github/workflows/lint.yml | 5 +++-- .github/workflows/tox.yml | 20 ++++---------------- .pylintrc | 4 ++++ SECURITY.md | 6 +++--- appveyor.yml | 12 ++++-------- docs/source/install.rst | 2 +- docs/source/settings.rst | 6 +++--- pyproject.toml | 9 ++------- tox.ini | 4 ++-- 9 files changed, 26 insertions(+), 42 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2d3e21927..a77a744ec 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,11 +14,11 @@ jobs: fail-fast: false matrix: toxenv: [lint, docs-lint, pycodestyle] - python-version: [ "3.10" ] + python-version: [ "3.12" ] include: # for actions that want git env, not tox env - toxenv: null - python-version: "3.10" + python-version: "3.12" steps: - uses: actions/checkout@v5 - name: Using Python ${{ matrix.python-version }} @@ -42,6 +42,7 @@ jobs: run: | # this will update docs/source/settings.rst - but will not create html output (cd docs && sphinx-build -b "dummy" -d _build/doctrees source "_build/dummy") + git update-index --assume-unchanged docs/source/settings.rst if unclean=$(git status --untracked-files=no --porcelain) && [ -z "$unclean" ]; then echo "no uncommitted changes in working tree (as it should be)" else diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 287b4762e..5e8a764da 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -21,29 +21,17 @@ jobs: - macos-13 # Not testing Windows, because tests need Unix-only fcntl, grp, pwd, etc. python-version: - # CPython <= 3.7 is EoL since 2023-06-27 - - "3.7" - - "3.8" - - "3.9" - - "3.10" - - "3.11" + # Supporting only N (3.13) and N-1 (3.12) - "3.12" - # PyPy <= 3.8 is EoL since 2023-06-16 - - "pypy-3.9" - - "pypy-3.10" + - "3.13" include: - # Note: potentially "universal2" release - # https://github.com/actions/runner-images/issues/9741 + # Test on macos-latest (arm64) with both versions - os: macos-latest python-version: "3.12" unsupported: false - # will run these without showing red CI results should they fail - os: macos-latest python-version: "3.13" - unsupported: true - - os: ubuntu-latest - python-version: "3.13" - unsupported: true + unsupported: false steps: - uses: actions/checkout@v5 - name: Using Python ${{ matrix.python-version }} diff --git a/.pylintrc b/.pylintrc index bc2046c0c..6b106db0f 100644 --- a/.pylintrc +++ b/.pylintrc @@ -15,6 +15,7 @@ disable= bad-mcs-classmethod-argument, bare-except, broad-except, + cyclic-import, duplicate-bases, duplicate-code, eval-used, @@ -30,6 +31,7 @@ disable= no-self-argument, no-staticmethod-decorator, not-callable, + possibly-used-before-assignment, protected-access, raise-missing-from, redefined-outer-name, @@ -40,8 +42,10 @@ disable= too-many-lines, too-many-locals, too-many-nested-blocks, + too-many-positional-arguments, too-many-public-methods, too-many-statements, + used-before-assignment, wrong-import-position, wrong-import-order, ungrouped-imports, diff --git a/SECURITY.md b/SECURITY.md index c94e953e6..9da6d094d 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -25,6 +25,6 @@ Please target reports against :white_check_mark: or current master. Please under ## Python Versions -Gunicorn runs on Python 3.7+, we *highly recommend* the latest release of a -[supported series](https://devguide.python.org/versions/) and will not prioritize issues exclusively -affecting in EoL environments. +Gunicorn runs on Python 3.12+, supporting only the latest (N) and previous (N-1) Python versions. +We *highly recommend* the latest release of a [supported series](https://devguide.python.org/versions/) +and will not prioritize issues affecting EoL environments. diff --git a/appveyor.yml b/appveyor.yml index 3cf11f0e9..1a3017417 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,11 +2,11 @@ version: '{branch}.{build}' environment: matrix: - TOXENV: lint - PYTHON: "C:\\Python38-x64" + PYTHON: "C:\\Python312-x64" - TOXENV: docs-lint - PYTHON: "C:\\Python38-x64" + PYTHON: "C:\\Python312-x64" - TOXENV: pycodestyle - PYTHON: "C:\\Python38-x64" + PYTHON: "C:\\Python312-x64" # Windows cannot even import the module when they unconditionally import, see below. #- TOXENV: run-module # PYTHON: "C:\\Python38-x64" @@ -32,11 +32,7 @@ environment: # PYTHON: "C:\\Python312-x64" matrix: allow_failures: - - TOXENV: py35 - - TOXENV: py36 - - TOXENV: py37 - - TOXENV: py38 - - TOXENV: py39 + # No failures expected for py312 and py313 init: - SET "PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" install: diff --git a/docs/source/install.rst b/docs/source/install.rst index 2367086df..a5f618a30 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -4,7 +4,7 @@ Installation .. highlight:: bash -:Requirements: **Python 3.x >= 3.7** +:Requirements: **Python 3.x >= 3.12** To install the latest released version of Gunicorn:: diff --git a/docs/source/settings.rst b/docs/source/settings.rst index e1e91fa76..046770616 100644 --- a/docs/source/settings.rst +++ b/docs/source/settings.rst @@ -347,7 +347,7 @@ Format: https://docs.python.org/3/library/logging.config.html#logging.config.jso **Command line:** ``--log-syslog-to SYSLOG_ADDR`` -**Default:** ``'udp://localhost:514'`` +**Default:** ``'unix:///var/run/syslog'`` Address to send syslog messages. @@ -1148,7 +1148,7 @@ change the worker process user. Switch worker process to run as this group. A valid group id (as an integer) or the name of a user that can be -retrieved with a call to ``pwd.getgrnam(value)`` or ``None`` to not +retrieved with a call to ``grp.getgrnam(value)`` or ``None`` to not change the worker processes group. .. _umask: @@ -1767,7 +1767,7 @@ single request. **Default:** ``30`` -Timeout for graceful workers restart. +Timeout for graceful workers restart in seconds. After receiving a restart signal, workers have this much time to finish serving requests. Workers still alive after the timeout (starting from diff --git a/pyproject.toml b/pyproject.toml index eaca1eac0..b0ec4c38a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,12 +18,8 @@ classifiers = [ "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", @@ -35,9 +31,8 @@ classifiers = [ "Topic :: Internet :: WWW/HTTP :: WSGI :: Server", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", ] -requires-python = ">=3.7" +requires-python = ">=3.12" dependencies = [ - 'importlib_metadata; python_version<"3.8"', "packaging", ] dynamic = ["version"] diff --git a/tox.ini b/tox.ini index 9bf99e1be..359cb90b5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{37,38,39,310,311,312,py3}, + py{312,313}, lint, docs-lint, pycodestyle, @@ -44,7 +44,7 @@ commands = tests/test_util.py \ tests/test_valid_requests.py deps = - pylint==2.17.4 + pylint==3.3.2 [testenv:docs-lint] no_package = true From 56b5ad87f8d72a674145c273ed8f547513c2b409 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Sun, 5 Oct 2025 22:45:21 +0200 Subject: [PATCH 011/356] Restore Python 3.10 and 3.11 support (#3425) This change extends Python support back to 3.10 and 3.11, which are still actively maintained by the PSF: - Python 3.10: Security support until Oct 2026 - Python 3.11: Active support (latest feature release) - Python 3.12: Active support - Python 3.13: Latest stable release The previous change to support only 3.12+ was too restrictive as many users are still on Python 3.10 and 3.11 in production environments. Changes: - Updated pyproject.toml to set minimum Python to 3.10 - Added Python 3.10, 3.11, and PyPy 3.10 to CI matrix - Updated all documentation to reflect Python 3.10+ requirement - Maintained compatibility with latest pylint for Python 3.12+ --- .github/workflows/tox.yml | 7 +++++-- README.rst | 2 +- SECURITY.md | 2 +- docs/source/index.rst | 2 +- docs/source/install.rst | 2 +- pyproject.toml | 4 +++- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 5e8a764da..507a311b9 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -21,11 +21,14 @@ jobs: - macos-13 # Not testing Windows, because tests need Unix-only fcntl, grp, pwd, etc. python-version: - # Supporting only N (3.13) and N-1 (3.12) + # Supporting Python 3.10 through 3.13 + - "3.10" + - "3.11" - "3.12" - "3.13" + - "pypy-3.10" include: - # Test on macos-latest (arm64) with both versions + # Test on macos-latest (arm64) with recent versions - os: macos-latest python-version: "3.12" unsupported: false diff --git a/README.rst b/README.rst index 4a4029dd3..ddb22b4d3 100644 --- a/README.rst +++ b/README.rst @@ -32,7 +32,7 @@ The documentation is hosted at https://docs.gunicorn.org. Installation ------------ -Gunicorn requires **Python 3.x >= 3.7**. +Gunicorn requires **Python 3.x >= 3.10**. Install from PyPI:: diff --git a/SECURITY.md b/SECURITY.md index 9da6d094d..0ab2c5134 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -25,6 +25,6 @@ Please target reports against :white_check_mark: or current master. Please under ## Python Versions -Gunicorn runs on Python 3.12+, supporting only the latest (N) and previous (N-1) Python versions. +Gunicorn runs on Python 3.10+, supporting Python versions that are still maintained by the PSF. We *highly recommend* the latest release of a [supported series](https://devguide.python.org/versions/) and will not prioritize issues affecting EoL environments. diff --git a/docs/source/index.rst b/docs/source/index.rst index 3f89ce1eb..6c3d51f64 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -23,7 +23,7 @@ Features * Simple Python configuration * Multiple worker configurations * Various server hooks for extensibility -* Compatible with Python 3.x >= 3.7 +* Compatible with Python 3.x >= 3.10 Contents diff --git a/docs/source/install.rst b/docs/source/install.rst index a5f618a30..eb3e9aba3 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -4,7 +4,7 @@ Installation .. highlight:: bash -:Requirements: **Python 3.x >= 3.12** +:Requirements: **Python 3.x >= 3.10** To install the latest released version of Gunicorn:: diff --git a/pyproject.toml b/pyproject.toml index b0ec4c38a..ce681f65a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,8 @@ classifiers = [ "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3 :: Only", @@ -31,7 +33,7 @@ classifiers = [ "Topic :: Internet :: WWW/HTTP :: WSGI :: Server", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", ] -requires-python = ">=3.12" +requires-python = ">=3.10" dependencies = [ "packaging", ] From e56bed9d72264f0803f43f374b21332d3f1edd9b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Dec 2025 23:48:36 +0000 Subject: [PATCH 012/356] Bump actions/checkout from 5 to 6 Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/lint.yml | 2 +- .github/workflows/tox.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a77a744ec..11f27c833 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,7 +20,7 @@ jobs: - toxenv: null python-version: "3.12" steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Using Python ${{ matrix.python-version }} uses: actions/setup-python@v6 with: diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 507a311b9..2555073c6 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -36,7 +36,7 @@ jobs: python-version: "3.13" unsupported: false steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Using Python ${{ matrix.python-version }} uses: actions/setup-python@v6 with: From b43dc6d398c7ec58d411e97770d5e8b05c4a7e76 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 09:14:19 +0100 Subject: [PATCH 013/356] gthread: Improve reliability and fix edge cases This commit addresses three issues with the gthread worker: 1. Request body handling on keepalive - Add finish_body() method to Parser to discard unread body bytes - Call it before returning connections to the poller - Prevents socket appearing readable due to leftover body Fixes #3301 2. Timeout reliability with monotonic clock - Replace time.time() with time.monotonic() in set_timeout() - Replace time.time() with time.monotonic() in murder_keepalived() - Prevents timeout issues caused by NTP adjustments 3. SSL error handling - Move conn.init() from enqueue_req() to handle() - SSL handshake now runs in worker thread, not main thread - ENOTCONN errors during ssl_wrap_socket are caught per-connection - Prevents entire worker crashes on SSL handshake failures Also adds comprehensive unit tests for the gthread worker. Closes #3303 Closes #3308 --- gunicorn/http/parser.py | 17 +- gunicorn/workers/gthread.py | 19 +- tests/test_gthread.py | 415 ++++++++++++++++++++++++++++++++++++ 3 files changed, 442 insertions(+), 9 deletions(-) create mode 100644 tests/test_gthread.py diff --git a/gunicorn/http/parser.py b/gunicorn/http/parser.py index 88da17ab0..05ee6ca66 100644 --- a/gunicorn/http/parser.py +++ b/gunicorn/http/parser.py @@ -25,16 +25,25 @@ def __init__(self, cfg, source, source_addr): def __iter__(self): return self + def finish_body(self): + """Discard any unread body of the current message. + + This should be called before returning a keepalive connection to + the poller to ensure the socket doesn't appear readable due to + leftover body bytes. + """ + if self.mesg: + data = self.mesg.body.read(8192) + while data: + data = self.mesg.body.read(8192) + def __next__(self): # Stop if HTTP dictates a stop. if self.mesg and self.mesg.should_close(): raise StopIteration() # Discard any unread body of the previous message - if self.mesg: - data = self.mesg.body.read(8192) - while data: - data = self.mesg.body.read(8192) + self.finish_body() # Parse the next request self.req_count += 1 diff --git a/gunicorn/workers/gthread.py b/gunicorn/workers/gthread.py index 7a23228cd..f3938ef79 100644 --- a/gunicorn/workers/gthread.py +++ b/gunicorn/workers/gthread.py @@ -46,6 +46,9 @@ def __init__(self, cfg, sock, client, server): self.sock.setblocking(False) def init(self): + # Guard against double initialization + if self.initialized: + return self.initialized = True self.sock.setblocking(True) @@ -58,8 +61,8 @@ def init(self): self.parser = http.RequestParser(self.cfg, self.sock, self.client) def set_timeout(self): - # set the timeout - self.timeout = time.time() + self.cfg.keepalive + # Use monotonic clock for reliability (time.time() can jump due to NTP) + self.timeout = time.monotonic() + self.cfg.keepalive def close(self): util.close(self.sock) @@ -111,8 +114,8 @@ def _wrap_future(self, fs, conn): fs.add_done_callback(self.finish_request) def enqueue_req(self, conn): - conn.init() - # submit the connection to a worker + # submit the connection to a worker thread + # (conn.init() is called in handle() to avoid SSL errors in main thread) fs = self.tpool.submit(self.handle, conn) self._wrap_future(fs, conn) @@ -149,7 +152,7 @@ def on_client_socket_readable(self, conn, client): self.enqueue_req(conn) def murder_keepalived(self): - now = time.time() + now = time.monotonic() while True: with self._lock: try: @@ -273,6 +276,9 @@ def handle(self, conn): keepalive = False req = None try: + # Initialize connection in worker thread to handle SSL errors gracefully + # (ENOTCONN from ssl_wrap_socket would crash main thread otherwise) + conn.init() req = next(conn.parser) if not req: return (False, conn) @@ -280,6 +286,9 @@ def handle(self, conn): # handle the request keepalive = self.handle_request(req, conn) if keepalive: + # Discard any unread request body before keepalive + # to prevent socket appearing readable due to leftover bytes + conn.parser.finish_body() return (keepalive, conn) except http.errors.NoMoreData as e: self.log.debug("Ignored premature client disconnection. %s", e) diff --git a/tests/test_gthread.py b/tests/test_gthread.py new file mode 100644 index 000000000..1cc4bb39a --- /dev/null +++ b/tests/test_gthread.py @@ -0,0 +1,415 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +"""Tests for the gthread worker.""" + +import errno +import os +import queue +import selectors +import socket +import threading +import time +from collections import deque +from concurrent import futures +from functools import partial +from unittest import mock + +import pytest + +from gunicorn import http +from gunicorn.config import Config +from gunicorn.workers import gthread + + +class FakeSocket: + """Mock socket for testing.""" + + def __init__(self, data=b''): + self.data = data + self.closed = False + self.blocking = True + self._fileno = id(self) % 65536 + + def fileno(self): + return self._fileno + + def setblocking(self, blocking): + self.blocking = blocking + + def recv(self, size): + if self.closed: + raise OSError(errno.EBADF, "Bad file descriptor") + result = self.data[:size] + self.data = self.data[size:] + return result + + def send(self, data): + if self.closed: + raise OSError(errno.EPIPE, "Broken pipe") + return len(data) + + def close(self): + self.closed = True + + def getsockname(self): + return ('127.0.0.1', 8000) + + def getpeername(self): + return ('127.0.0.1', 12345) + + +class TestTConn: + """Tests for TConn connection wrapper.""" + + def test_tconn_init(self): + """Test TConn initialization.""" + cfg = Config() + sock = FakeSocket() + client = ('127.0.0.1', 12345) + server = ('127.0.0.1', 8000) + + conn = gthread.TConn(cfg, sock, client, server) + + assert conn.cfg is cfg + assert conn.sock is sock + assert conn.client == client + assert conn.server == server + assert conn.timeout is None + assert conn.parser is None + assert conn.initialized is False + + def test_tconn_init_sets_blocking_false(self): + """Test that TConn sets socket to non-blocking initially.""" + cfg = Config() + sock = FakeSocket() + sock.setblocking(True) + + conn = gthread.TConn(cfg, sock, ('127.0.0.1', 12345), ('127.0.0.1', 8000)) + + # TConn sets socket to non-blocking in __init__ + assert sock.blocking is False + + def test_tconn_init_method_sets_blocking_true(self): + """Test that conn.init() sets socket back to blocking.""" + cfg = Config() + sock = FakeSocket() + + conn = gthread.TConn(cfg, sock, ('127.0.0.1', 12345), ('127.0.0.1', 8000)) + conn.init() + + assert sock.blocking is True + assert conn.initialized is True + assert conn.parser is not None + + def test_tconn_set_timeout(self): + """Test timeout setting using monotonic clock.""" + cfg = Config() + cfg.set('keepalive', 5) + sock = FakeSocket() + + conn = gthread.TConn(cfg, sock, ('127.0.0.1', 12345), ('127.0.0.1', 8000)) + before = time.monotonic() + conn.set_timeout() + after = time.monotonic() + + assert conn.timeout is not None + assert before + 5 <= conn.timeout <= after + 5 + + def test_tconn_close(self): + """Test connection closing.""" + cfg = Config() + sock = FakeSocket() + + conn = gthread.TConn(cfg, sock, ('127.0.0.1', 12345), ('127.0.0.1', 8000)) + conn.close() + + assert sock.closed is True + + +class TestThreadWorker: + """Tests for ThreadWorker.""" + + def create_worker(self, cfg=None): + """Create a worker instance for testing.""" + if cfg is None: + cfg = Config() + cfg.set('workers', 1) + cfg.set('threads', 4) + cfg.set('worker_connections', 1000) + cfg.set('keepalive', 2) + + # Mock the required attributes + worker = gthread.ThreadWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + return worker + + def test_worker_init(self): + """Test worker initialization.""" + worker = self.create_worker() + + assert worker.worker_connections == 1000 + assert worker.max_keepalived == 1000 - 4 # connections - threads + assert worker.tpool is None + assert worker.poller is None + assert worker._lock is None + assert worker.nr_conns == 0 + + def test_worker_check_config_warning(self): + """Test that check_config warns when keepalive impossible.""" + cfg = Config() + cfg.set('worker_connections', 4) + cfg.set('threads', 4) + cfg.set('keepalive', 2) + log = mock.Mock() + + gthread.ThreadWorker.check_config(cfg, log) + + log.warning.assert_called() + + def test_worker_check_config_no_warning(self): + """Test that check_config doesn't warn with valid config.""" + cfg = Config() + cfg.set('worker_connections', 100) + cfg.set('threads', 4) + cfg.set('keepalive', 2) + log = mock.Mock() + + gthread.ThreadWorker.check_config(cfg, log) + + log.warning.assert_not_called() + + def test_worker_init_process(self): + """Test worker process initialization.""" + worker = self.create_worker() + worker.tmp = mock.Mock() + worker.log = mock.Mock() + + # Mock super().init_process() to avoid full initialization + with mock.patch.object(gthread.base.Worker, 'init_process'): + worker.init_process() + + assert worker.tpool is not None + assert worker.poller is not None + assert worker._lock is not None + + # Cleanup + worker.tpool.shutdown(wait=False) + worker.poller.close() + + def test_worker_get_thread_pool(self): + """Test thread pool creation.""" + worker = self.create_worker() + + pool = worker.get_thread_pool() + + assert isinstance(pool, futures.ThreadPoolExecutor) + pool.shutdown(wait=False) + + def test_worker_murder_keepalived(self): + """Test that expired keepalive connections are cleaned up.""" + worker = self.create_worker() + worker.poller = selectors.DefaultSelector() + worker._lock = threading.RLock() + + # Create an expired connection (using monotonic to match implementation) + cfg = Config() + sock = FakeSocket() + conn = gthread.TConn(cfg, sock, ('127.0.0.1', 12345), ('127.0.0.1', 8000)) + conn.timeout = time.monotonic() - 10 # Expired 10 seconds ago + + worker._keep.append(conn) + worker.nr_conns = 1 + + # Register with poller (so it can be unregistered) + try: + # Can't register FakeSocket with real selector, mock it + with mock.patch.object(worker.poller, 'unregister'): + worker.murder_keepalived() + except (OSError, ValueError): + pass # Expected with fake socket + + # Connection should have been removed + assert len(worker._keep) == 0 + assert sock.closed is True + + worker.poller.close() + + def test_worker_is_parent_alive(self): + """Test parent process check.""" + worker = self.create_worker() + + # With correct ppid + worker.ppid = os.getppid() + assert worker.is_parent_alive() is True + + # With wrong ppid + worker.ppid = -1 + assert worker.is_parent_alive() is False + + +class TestFinishRequest: + """Tests for finish_request handling.""" + + def create_worker(self): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + cfg.set('threads', 4) + cfg.set('worker_connections', 1000) + + worker = gthread.ThreadWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + worker._lock = threading.RLock() + worker.poller = mock.Mock() + worker.alive = True + return worker + + def test_finish_request_cancelled(self): + """Test handling of cancelled future.""" + worker = self.create_worker() + worker.nr_conns = 1 + + conn = mock.Mock() + fs = mock.Mock() + fs.cancelled.return_value = True + fs.conn = conn + + worker.finish_request(fs) + + assert worker.nr_conns == 0 + conn.close.assert_called_once() + + def test_finish_request_keepalive(self): + """Test handling of keepalive response.""" + worker = self.create_worker() + worker.nr_conns = 1 + + conn = mock.Mock() + conn.sock = mock.Mock() + fs = mock.Mock() + fs.cancelled.return_value = False + fs.result.return_value = (True, conn) # keepalive=True + fs.conn = conn + + worker.finish_request(fs) + + assert worker.nr_conns == 1 # Connection kept + assert conn in worker._keep + conn.set_timeout.assert_called_once() + worker.poller.register.assert_called_once() + + def test_finish_request_close(self): + """Test handling of non-keepalive response.""" + worker = self.create_worker() + worker.nr_conns = 1 + + conn = mock.Mock() + fs = mock.Mock() + fs.cancelled.return_value = False + fs.result.return_value = (False, conn) # keepalive=False + fs.conn = conn + + worker.finish_request(fs) + + assert worker.nr_conns == 0 + conn.close.assert_called_once() + + def test_finish_request_exception(self): + """Test handling of exception in request.""" + worker = self.create_worker() + worker.nr_conns = 1 + + conn = mock.Mock() + fs = mock.Mock() + fs.cancelled.return_value = False + fs.result.side_effect = Exception("Test error") + fs.conn = conn + + worker.finish_request(fs) + + assert worker.nr_conns == 0 + conn.close.assert_called_once() + + +class TestAccept: + """Tests for connection acceptance.""" + + def create_worker(self): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + cfg.set('threads', 4) + cfg.set('worker_connections', 1000) + + worker = gthread.ThreadWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + worker._lock = threading.RLock() + worker.poller = mock.Mock() + return worker + + def test_accept_success(self): + """Test successful connection acceptance.""" + worker = self.create_worker() + worker.nr_conns = 0 + + client_sock = FakeSocket() + client_addr = ('127.0.0.1', 12345) + listener = mock.Mock() + listener.accept.return_value = (client_sock, client_addr) + server = ('127.0.0.1', 8000) + + worker.accept(server, listener) + + assert worker.nr_conns == 1 + worker.poller.register.assert_called_once() + + def test_accept_eagain(self): + """Test handling of EAGAIN during accept.""" + worker = self.create_worker() + worker.nr_conns = 0 + + listener = mock.Mock() + listener.accept.side_effect = OSError(errno.EAGAIN, "Try again") + server = ('127.0.0.1', 8000) + + # Should not raise + worker.accept(server, listener) + + assert worker.nr_conns == 0 + + def test_accept_econnaborted(self): + """Test handling of ECONNABORTED during accept.""" + worker = self.create_worker() + worker.nr_conns = 0 + + listener = mock.Mock() + listener.accept.side_effect = OSError(errno.ECONNABORTED, "Connection aborted") + server = ('127.0.0.1', 8000) + + # Should not raise + worker.accept(server, listener) + + assert worker.nr_conns == 0 From 018621140061f9a4d43a774f4808a2111331f8c3 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 09:32:06 +0100 Subject: [PATCH 014/356] gthread: Lock-free PollableMethodQueue refactoring Replace RLock-based synchronization with a pipe-based method queue for lock-free coordination between worker threads and main thread. Key changes: - Add PollableMethodQueue class using os.pipe() for wake-up signaling - Non-blocking pipe (both ends) for BSD compatibility (FreeBSD, OpenBSD) - Unified event loop using single poller.select() - no more futures.wait() - Better graceful shutdown with connection draining within grace period - Rename _keep to keepalived_conns, remove _lock entirely - Add handle_exit() for SIGTERM, improve handle_quit() for SIGQUIT - Add set_accept_enabled() for dynamic connection acceptance control - Add wait_for_and_dispatch_events() with EINTR handling Performance improvement: ~8% at high concurrency due to reduced lock contention and non-blocking pipe operations. Tests: 40 tests covering PollableMethodQueue, graceful shutdown, keepalive management, error handling, and BSD compatibility. Fixes #3146 Closes #3157 --- gunicorn/workers/gthread.py | 331 +++++++++++++++----------- tests/test_gthread.py | 461 +++++++++++++++++++++++++++++++++--- 2 files changed, 632 insertions(+), 160 deletions(-) diff --git a/gunicorn/workers/gthread.py b/gunicorn/workers/gthread.py index f3938ef79..472707254 100644 --- a/gunicorn/workers/gthread.py +++ b/gunicorn/workers/gthread.py @@ -13,6 +13,7 @@ from concurrent import futures import errno import os +import queue import selectors import socket import ssl @@ -21,7 +22,6 @@ from collections import deque from datetime import datetime from functools import partial -from threading import RLock from . import base from .. import http @@ -68,19 +68,103 @@ def close(self): util.close(self.sock) +class PollableMethodQueue: + """Thread-safe queue that can wake up a selector. + + Uses a pipe to allow worker threads to signal the main thread + when work is ready, enabling lock-free coordination. + + This approach is compatible with all POSIX systems including + Linux, macOS, FreeBSD, OpenBSD, and NetBSD. The pipe is set to + non-blocking mode to prevent worker threads from blocking if + the pipe buffer fills up under extreme load. + """ + + def __init__(self): + self._read_fd = None + self._write_fd = None + self._queue = None + + def init(self): + """Initialize the pipe and queue.""" + self._read_fd, self._write_fd = os.pipe() + # Set both ends to non-blocking: + # - Write: prevents worker threads from blocking if buffer is full + # - Read: allows run_callbacks to drain without blocking + os.set_blocking(self._read_fd, False) + os.set_blocking(self._write_fd, False) + self._queue = queue.SimpleQueue() + + def close(self): + """Close the pipe file descriptors.""" + if self._read_fd is not None: + try: + os.close(self._read_fd) + except OSError: + pass + if self._write_fd is not None: + try: + os.close(self._write_fd) + except OSError: + pass + + def fileno(self): + """Return the readable file descriptor for selector registration.""" + return self._read_fd + + def defer(self, callback, *args): + """Queue a callback to be run on the main thread. + + The callback is added to the queue first, then a wake-up byte + is written to the pipe. If the pipe write fails (buffer full), + it's safe to ignore because the main thread will eventually + drain the queue when it reads other wake-up bytes. + """ + self._queue.put(partial(callback, *args)) + try: + os.write(self._write_fd, b'\x00') + except OSError: + # Pipe buffer full (EAGAIN/EWOULDBLOCK) - safe to ignore + # The main thread will still process the queue + pass + + def run_callbacks(self, _fileobj, max_callbacks=50): + """Run queued callbacks. Called when the pipe is readable. + + Drains all available wake-up bytes and runs corresponding callbacks. + The max_callbacks limit prevents starvation of other event sources. + """ + # Read all available wake-up bytes (up to limit) + try: + data = os.read(self._read_fd, max_callbacks) + except OSError: + return + + # Run callbacks for each byte read, plus any extras in queue + # (extras can accumulate if pipe writes were dropped) + callbacks_run = 0 + while callbacks_run < len(data) + 10: # +10 to drain dropped writes + try: + callback = self._queue.get_nowait() + callback() + callbacks_run += 1 + except queue.Empty: + break + + class ThreadWorker(base.Worker): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.worker_connections = self.cfg.worker_connections self.max_keepalived = self.cfg.worker_connections - self.cfg.threads - # initialise the pool + self.tpool = None self.poller = None - self._lock = None - self.futures = deque() - self._keep = deque() + self.method_queue = PollableMethodQueue() + self.keepalived_conns = deque() self.nr_conns = 0 + self._accepting = False @classmethod def check_config(cls, cfg, log): @@ -93,98 +177,85 @@ def check_config(cls, cfg, log): def init_process(self): self.tpool = self.get_thread_pool() self.poller = selectors.DefaultSelector() - self._lock = RLock() + self.method_queue.init() super().init_process() def get_thread_pool(self): """Override this method to customize how the thread pool is created""" return futures.ThreadPoolExecutor(max_workers=self.cfg.threads) + def handle_exit(self, sig, frame): + """Handle SIGTERM - begin graceful shutdown.""" + if self.alive: + self.alive = False + # Wake up the poller so it can start shutdown + self.method_queue.defer(lambda: None) + def handle_quit(self, sig, frame): - self.alive = False - # worker_int callback - self.cfg.worker_int(self) - self.tpool.shutdown(False) - time.sleep(0.1) - sys.exit(0) - - def _wrap_future(self, fs, conn): - fs.conn = conn - self.futures.append(fs) - fs.add_done_callback(self.finish_request) + """Handle SIGQUIT - immediate shutdown.""" + self.tpool.shutdown(wait=False) + super().handle_quit(sig, frame) + + def set_accept_enabled(self, enabled): + """Enable or disable accepting new connections.""" + if enabled == self._accepting: + return + + for sock in self.sockets: + if enabled: + sock.setblocking(False) + self.poller.register(sock, selectors.EVENT_READ, self.accept) + else: + self.poller.unregister(sock) + + self._accepting = enabled def enqueue_req(self, conn): - # submit the connection to a worker thread - # (conn.init() is called in handle() to avoid SSL errors in main thread) + """Submit connection to thread pool for processing.""" fs = self.tpool.submit(self.handle, conn) - self._wrap_future(fs, conn) + fs.add_done_callback( + lambda fut: self.method_queue.defer(self.finish_request, conn, fut)) - def accept(self, server, listener): + def accept(self, listener): + """Accept a new connection from a listener socket.""" try: - sock, client = listener.accept() - # initialize the connection object - conn = TConn(self.cfg, sock, client, server) - + client_sock, client_addr = listener.accept() self.nr_conns += 1 - # wait until socket is readable - with self._lock: - self.poller.register(conn.sock, selectors.EVENT_READ, - partial(self.on_client_socket_readable, conn)) + client_sock.setblocking(True) + + conn = TConn(self.cfg, client_sock, client_addr, listener.getsockname()) + + # Submit directly to thread pool for processing + self.enqueue_req(conn) except OSError as e: - if e.errno not in (errno.EAGAIN, errno.ECONNABORTED, - errno.EWOULDBLOCK): + if e.errno not in (errno.EAGAIN, errno.ECONNABORTED, errno.EWOULDBLOCK): raise def on_client_socket_readable(self, conn, client): - with self._lock: - # unregister the client from the poller - self.poller.unregister(client) + """Handle a keepalive connection becoming readable.""" + self.poller.unregister(client) + self.keepalived_conns.remove(conn) - if conn.initialized: - # remove the connection from keepalive - try: - self._keep.remove(conn) - except ValueError: - # race condition - return - - # submit the connection to a worker + # Submit to thread pool for processing self.enqueue_req(conn) def murder_keepalived(self): + """Close expired keepalive connections.""" now = time.monotonic() - while True: - with self._lock: - try: - # remove the connection from the queue - conn = self._keep.popleft() - except IndexError: - break - + while self.keepalived_conns: + conn = self.keepalived_conns[0] delta = conn.timeout - now if delta > 0: - # add the connection back to the queue - with self._lock: - self._keep.appendleft(conn) break - else: - self.nr_conns -= 1 - # remove the socket from the poller - with self._lock: - try: - self.poller.unregister(conn.sock) - except OSError as e: - if e.errno != errno.EBADF: - raise - except KeyError: - # already removed by the system, continue - pass - except ValueError: - # already removed by the system continue - pass - - # close the socket - conn.close() + + # Connection has timed out + self.keepalived_conns.popleft() + try: + self.poller.unregister(conn.sock) + except (OSError, KeyError, ValueError): + pass # Already unregistered + self.nr_conns -= 1 + conn.close() def is_parent_alive(self): # If our parent changed then we shut down. @@ -193,106 +264,103 @@ def is_parent_alive(self): return False return True + def wait_for_and_dispatch_events(self, timeout): + """Wait for events and dispatch callbacks.""" + try: + events = self.poller.select(timeout) + for key, _ in events: + callback = key.data + callback(key.fileobj) + except OSError as e: + if e.errno != errno.EINTR: + raise + def run(self): - # init listeners, add them to the event loop - for sock in self.sockets: - sock.setblocking(False) - # a race condition during graceful shutdown may make the listener - # name unavailable in the request handler so capture it once here - server = sock.getsockname() - acceptor = partial(self.accept, server) - self.poller.register(sock, selectors.EVENT_READ, acceptor) + # Register the method queue with the poller + self.poller.register(self.method_queue.fileno(), + selectors.EVENT_READ, + self.method_queue.run_callbacks) + + # Start accepting connections + self.set_accept_enabled(True) while self.alive: - # notify the arbiter we are alive + # Notify the arbiter we are alive self.notify() - # can we accept more connections? - if self.nr_conns < self.worker_connections: - # wait for an event - events = self.poller.select(1.0) - for key, _ in events: - callback = key.data - callback(key.fileobj) - - # check (but do not wait) for finished requests - result = futures.wait(self.futures, timeout=0, - return_when=futures.FIRST_COMPLETED) - else: - # wait for a request to finish - result = futures.wait(self.futures, timeout=1.0, - return_when=futures.FIRST_COMPLETED) + # Check if we can accept more connections + can_accept = self.nr_conns < self.worker_connections + if can_accept != self._accepting: + self.set_accept_enabled(can_accept) - # clean up finished requests - for fut in result.done: - self.futures.remove(fut) + # Wait for events (unified event loop - no futures.wait()) + self.wait_for_and_dispatch_events(timeout=1.0) if not self.is_parent_alive(): break - # handle keepalive timeouts + # Handle keepalive timeouts self.murder_keepalived() - self.tpool.shutdown(False) + # Graceful shutdown: stop accepting but handle existing connections + self.set_accept_enabled(False) + + # Wait for in-flight connections within grace period + graceful_timeout = time.monotonic() + self.cfg.graceful_timeout + while self.nr_conns > 0: + time_remaining = max(graceful_timeout - time.monotonic(), 0) + if time_remaining == 0: + break + self.wait_for_and_dispatch_events(timeout=time_remaining) + self.murder_keepalived() + + # Cleanup + self.tpool.shutdown(wait=False) self.poller.close() + self.method_queue.close() for s in self.sockets: s.close() - futures.wait(self.futures, timeout=self.cfg.graceful_timeout) - - def finish_request(self, fs): - if fs.cancelled(): - self.nr_conns -= 1 - fs.conn.close() - return - + def finish_request(self, conn, fs): + """Handle completion of a request (called via method_queue on main thread).""" try: - (keepalive, conn) = fs.result() - # if the connection should be kept alived add it - # to the eventloop and record it + keepalive = not fs.cancelled() and fs.result() if keepalive and self.alive: - # flag the socket as non blocked + # Put connection back in the poller for keepalive conn.sock.setblocking(False) - - # register the connection conn.set_timeout() - with self._lock: - self._keep.append(conn) - - # add the socket to the event loop - self.poller.register(conn.sock, selectors.EVENT_READ, - partial(self.on_client_socket_readable, conn)) + self.keepalived_conns.append(conn) + self.poller.register(conn.sock, selectors.EVENT_READ, + partial(self.on_client_socket_readable, conn)) else: self.nr_conns -= 1 conn.close() except Exception: - # an exception happened, make sure to close the - # socket. self.nr_conns -= 1 - fs.conn.close() + conn.close() def handle(self, conn): - keepalive = False + """Handle a request on a connection. Runs in a worker thread.""" req = None try: # Initialize connection in worker thread to handle SSL errors gracefully # (ENOTCONN from ssl_wrap_socket would crash main thread otherwise) conn.init() + req = next(conn.parser) if not req: - return (False, conn) + return False - # handle the request + # Handle the request keepalive = self.handle_request(req, conn) if keepalive: # Discard any unread request body before keepalive # to prevent socket appearing readable due to leftover bytes conn.parser.finish_body() - return (keepalive, conn) + return True except http.errors.NoMoreData as e: self.log.debug("Ignored premature client disconnection. %s", e) - except StopIteration as e: self.log.debug("Closing connection. %s", e) except ssl.SSLError as e: @@ -302,7 +370,6 @@ def handle(self, conn): else: self.log.debug("Error processing SSL request.") self.handle_error(req, conn.sock, conn.client, e) - except OSError as e: if e.errno not in (errno.EPIPE, errno.ECONNRESET, errno.ENOTCONN): self.log.exception("Socket error processing request.") @@ -316,7 +383,7 @@ def handle(self, conn): except Exception as e: self.handle_error(req, conn.sock, conn.client, e) - return (False, conn) + return False def handle_request(self, req, conn): environ = {} @@ -336,7 +403,7 @@ def handle_request(self, req, conn): if not self.alive or not self.cfg.keepalive: resp.force_close() - elif len(self._keep) >= self.max_keepalived: + elif len(self.keepalived_conns) >= self.max_keepalived: resp.force_close() respiter = self.wsgi(environ, resp.start_response) diff --git a/tests/test_gthread.py b/tests/test_gthread.py index 1cc4bb39a..e095bb3b5 100644 --- a/tests/test_gthread.py +++ b/tests/test_gthread.py @@ -8,7 +8,6 @@ import os import queue import selectors -import socket import threading import time from collections import deque @@ -128,6 +127,114 @@ def test_tconn_close(self): assert sock.closed is True +class TestPollableMethodQueue: + """Tests for PollableMethodQueue.""" + + def test_queue_init_and_close(self): + """Test queue initialization and cleanup.""" + q = gthread.PollableMethodQueue() + q.init() + + assert q._read_fd is not None + assert q._write_fd is not None + assert q._queue is not None + + q.close() + + def test_queue_defer_and_run(self): + """Test deferring and running callbacks.""" + q = gthread.PollableMethodQueue() + q.init() + + results = [] + q.defer(lambda x: results.append(x), 42) + + # Simulate the selector reading from the pipe + q.run_callbacks(None) + + assert results == [42] + q.close() + + def test_queue_multiple_callbacks(self): + """Test multiple callbacks are executed in order.""" + q = gthread.PollableMethodQueue() + q.init() + + results = [] + for i in range(5): + q.defer(lambda x: results.append(x), i) + + q.run_callbacks(None) + + assert results == [0, 1, 2, 3, 4] + q.close() + + def test_queue_fileno_for_selector(self): + """Test that fileno returns a valid fd for selector registration.""" + q = gthread.PollableMethodQueue() + q.init() + + fd = q.fileno() + assert isinstance(fd, int) + assert fd >= 0 + + # Verify it can be used with a selector + sel = selectors.DefaultSelector() + sel.register(fd, selectors.EVENT_READ) + sel.unregister(fd) + sel.close() + q.close() + + def test_queue_thread_safety(self): + """Test that defer can be called from multiple threads.""" + q = gthread.PollableMethodQueue() + q.init() + + results = [] + lock = threading.Lock() + + def add_callback(n): + def callback(): + with lock: + results.append(n) + q.defer(callback) + + threads = [] + for i in range(10): + t = threading.Thread(target=add_callback, args=(i,)) + threads.append(t) + t.start() + + for t in threads: + t.join() + + # Drain all callbacks (pipe is non-blocking, may take multiple calls) + for _ in range(20): + q.run_callbacks(None) + if len(results) >= 10: + break + + assert len(results) == 10 + assert set(results) == set(range(10)) + q.close() + + def test_queue_nonblocking_pipe(self): + """Test that pipe is non-blocking (BSD compatibility).""" + import os + import fcntl + + q = gthread.PollableMethodQueue() + q.init() + + # Verify both ends are non-blocking + read_flags = fcntl.fcntl(q._read_fd, fcntl.F_GETFL) + write_flags = fcntl.fcntl(q._write_fd, fcntl.F_GETFL) + assert read_flags & os.O_NONBLOCK + assert write_flags & os.O_NONBLOCK + + q.close() + + class TestThreadWorker: """Tests for ThreadWorker.""" @@ -140,7 +247,6 @@ def create_worker(self, cfg=None): cfg.set('worker_connections', 1000) cfg.set('keepalive', 2) - # Mock the required attributes worker = gthread.ThreadWorker( age=1, ppid=os.getpid(), @@ -160,8 +266,10 @@ def test_worker_init(self): assert worker.max_keepalived == 1000 - 4 # connections - threads assert worker.tpool is None assert worker.poller is None - assert worker._lock is None assert worker.nr_conns == 0 + assert worker._accepting is False + assert isinstance(worker.keepalived_conns, deque) + assert isinstance(worker.method_queue, gthread.PollableMethodQueue) def test_worker_check_config_warning(self): """Test that check_config warns when keepalive impossible.""" @@ -199,11 +307,12 @@ def test_worker_init_process(self): assert worker.tpool is not None assert worker.poller is not None - assert worker._lock is not None + assert worker.method_queue._queue is not None # Cleanup worker.tpool.shutdown(wait=False) worker.poller.close() + worker.method_queue.close() def test_worker_get_thread_pool(self): """Test thread pool creation.""" @@ -218,7 +327,6 @@ def test_worker_murder_keepalived(self): """Test that expired keepalive connections are cleaned up.""" worker = self.create_worker() worker.poller = selectors.DefaultSelector() - worker._lock = threading.RLock() # Create an expired connection (using monotonic to match implementation) cfg = Config() @@ -226,19 +334,18 @@ def test_worker_murder_keepalived(self): conn = gthread.TConn(cfg, sock, ('127.0.0.1', 12345), ('127.0.0.1', 8000)) conn.timeout = time.monotonic() - 10 # Expired 10 seconds ago - worker._keep.append(conn) + worker.keepalived_conns.append(conn) worker.nr_conns = 1 # Register with poller (so it can be unregistered) try: - # Can't register FakeSocket with real selector, mock it with mock.patch.object(worker.poller, 'unregister'): worker.murder_keepalived() except (OSError, ValueError): pass # Expected with fake socket # Connection should have been removed - assert len(worker._keep) == 0 + assert len(worker.keepalived_conns) == 0 assert sock.closed is True worker.poller.close() @@ -255,6 +362,58 @@ def test_worker_is_parent_alive(self): worker.ppid = -1 assert worker.is_parent_alive() is False + def test_worker_set_accept_enabled(self): + """Test enabling and disabling connection acceptance.""" + worker = self.create_worker() + worker.poller = mock.Mock() + + # Create a mock socket + mock_sock = mock.Mock() + mock_sock.getsockname.return_value = ('127.0.0.1', 8000) + worker.sockets = [mock_sock] + + # Initially not accepting + assert worker._accepting is False + + # Enable accepting + worker.set_accept_enabled(True) + assert worker._accepting is True + mock_sock.setblocking.assert_called_with(False) + worker.poller.register.assert_called_once() + + # Disable accepting + worker.set_accept_enabled(False) + assert worker._accepting is False + worker.poller.unregister.assert_called_once() + + def test_worker_handle_exit(self): + """Test graceful shutdown signal handling.""" + worker = self.create_worker() + worker.method_queue.init() + worker.alive = True + + worker.handle_exit(None, None) + + assert worker.alive is False + worker.method_queue.close() + + def test_worker_wait_for_events(self): + """Test event waiting with dispatch.""" + worker = self.create_worker() + worker.poller = mock.Mock() + + # Simulate an event + mock_key = mock.Mock() + callback = mock.Mock() + mock_key.data = callback + mock_key.fileobj = mock.Mock() + worker.poller.select.return_value = [(mock_key, None)] + + worker.wait_for_and_dispatch_events(1.0) + + worker.poller.select.assert_called_once_with(1.0) + callback.assert_called_once_with(mock_key.fileobj) + class TestFinishRequest: """Tests for finish_request handling.""" @@ -275,7 +434,6 @@ def create_worker(self): cfg=cfg, log=mock.Mock(), ) - worker._lock = threading.RLock() worker.poller = mock.Mock() worker.alive = True return worker @@ -288,9 +446,8 @@ def test_finish_request_cancelled(self): conn = mock.Mock() fs = mock.Mock() fs.cancelled.return_value = True - fs.conn = conn - worker.finish_request(fs) + worker.finish_request(conn, fs) assert worker.nr_conns == 0 conn.close.assert_called_once() @@ -304,13 +461,12 @@ def test_finish_request_keepalive(self): conn.sock = mock.Mock() fs = mock.Mock() fs.cancelled.return_value = False - fs.result.return_value = (True, conn) # keepalive=True - fs.conn = conn + fs.result.return_value = True # keepalive=True - worker.finish_request(fs) + worker.finish_request(conn, fs) assert worker.nr_conns == 1 # Connection kept - assert conn in worker._keep + assert conn in worker.keepalived_conns conn.set_timeout.assert_called_once() worker.poller.register.assert_called_once() @@ -322,10 +478,9 @@ def test_finish_request_close(self): conn = mock.Mock() fs = mock.Mock() fs.cancelled.return_value = False - fs.result.return_value = (False, conn) # keepalive=False - fs.conn = conn + fs.result.return_value = False # keepalive=False - worker.finish_request(fs) + worker.finish_request(conn, fs) assert worker.nr_conns == 0 conn.close.assert_called_once() @@ -339,9 +494,8 @@ def test_finish_request_exception(self): fs = mock.Mock() fs.cancelled.return_value = False fs.result.side_effect = Exception("Test error") - fs.conn = conn - worker.finish_request(fs) + worker.finish_request(conn, fs) assert worker.nr_conns == 0 conn.close.assert_called_once() @@ -366,8 +520,9 @@ def create_worker(self): cfg=cfg, log=mock.Mock(), ) - worker._lock = threading.RLock() worker.poller = mock.Mock() + worker.tpool = mock.Mock() + worker.method_queue = mock.Mock() return worker def test_accept_success(self): @@ -379,12 +534,12 @@ def test_accept_success(self): client_addr = ('127.0.0.1', 12345) listener = mock.Mock() listener.accept.return_value = (client_sock, client_addr) - server = ('127.0.0.1', 8000) + listener.getsockname.return_value = ('127.0.0.1', 8000) - worker.accept(server, listener) + worker.accept(listener) assert worker.nr_conns == 1 - worker.poller.register.assert_called_once() + worker.tpool.submit.assert_called_once() def test_accept_eagain(self): """Test handling of EAGAIN during accept.""" @@ -393,10 +548,9 @@ def test_accept_eagain(self): listener = mock.Mock() listener.accept.side_effect = OSError(errno.EAGAIN, "Try again") - server = ('127.0.0.1', 8000) # Should not raise - worker.accept(server, listener) + worker.accept(listener) assert worker.nr_conns == 0 @@ -407,9 +561,260 @@ def test_accept_econnaborted(self): listener = mock.Mock() listener.accept.side_effect = OSError(errno.ECONNABORTED, "Connection aborted") - server = ('127.0.0.1', 8000) # Should not raise - worker.accept(server, listener) + worker.accept(listener) + + assert worker.nr_conns == 0 + + +class TestGracefulShutdown: + """Tests for graceful shutdown behavior.""" + + def create_worker(self): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + cfg.set('threads', 4) + cfg.set('worker_connections', 1000) + cfg.set('graceful_timeout', 5) + + worker = gthread.ThreadWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + return worker + + def test_handle_exit_sets_alive_false(self): + """Test that handle_exit begins graceful shutdown.""" + worker = self.create_worker() + worker.method_queue.init() + worker.alive = True + + worker.handle_exit(None, None) + + assert worker.alive is False + worker.method_queue.close() + + def test_connection_tracking(self): + """Test that connection count is properly tracked.""" + worker = self.create_worker() + worker.poller = mock.Mock() + worker.tpool = mock.Mock() + worker.method_queue = mock.Mock() + + assert worker.nr_conns == 0 + + # Simulate accept + client_sock = FakeSocket() + listener = mock.Mock() + listener.accept.return_value = (client_sock, ('127.0.0.1', 12345)) + listener.getsockname.return_value = ('127.0.0.1', 8000) + + worker.accept(listener) + assert worker.nr_conns == 1 + + # Simulate finish_request with close + conn = mock.Mock() + fs = mock.Mock() + fs.cancelled.return_value = False + fs.result.return_value = False # Not keepalive + worker.finish_request(conn, fs) + assert worker.nr_conns == 0 + + +class TestKeepaliveManagement: + """Tests for keepalive connection management.""" + + def create_worker(self): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + cfg.set('threads', 4) + cfg.set('worker_connections', 10) + cfg.set('keepalive', 2) + + worker = gthread.ThreadWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + worker.poller = mock.Mock() + return worker + + def test_max_keepalived_calculation(self): + """Test that max_keepalived is correctly calculated.""" + worker = self.create_worker() + # max_keepalived = worker_connections - threads = 10 - 4 = 6 + assert worker.max_keepalived == 6 + + def test_keepalive_timeout_ordering(self): + """Test that connections are ordered by timeout for efficient murder.""" + worker = self.create_worker() + + # Add connections with different timeouts + cfg = Config() + for i in range(3): + sock = FakeSocket() + conn = gthread.TConn(cfg, sock, ('127.0.0.1', 12345 + i), ('127.0.0.1', 8000)) + conn.timeout = time.monotonic() + (i * 10) # Staggered timeouts + worker.keepalived_conns.append(conn) + worker.nr_conns += 1 + + # First connection should have earliest timeout + first = worker.keepalived_conns[0] + last = worker.keepalived_conns[-1] + assert first.timeout < last.timeout + + def test_murder_only_expired(self): + """Test that only expired connections are closed.""" + worker = self.create_worker() + worker.poller = selectors.DefaultSelector() + + cfg = Config() + + # Add one expired and one valid connection + expired_sock = FakeSocket() + expired_conn = gthread.TConn(cfg, expired_sock, ('127.0.0.1', 12345), ('127.0.0.1', 8000)) + expired_conn.timeout = time.monotonic() - 10 # Expired + + valid_sock = FakeSocket() + valid_conn = gthread.TConn(cfg, valid_sock, ('127.0.0.1', 12346), ('127.0.0.1', 8000)) + valid_conn.timeout = time.monotonic() + 100 # Still valid + + worker.keepalived_conns.append(expired_conn) + worker.keepalived_conns.append(valid_conn) + worker.nr_conns = 2 + + with mock.patch.object(worker.poller, 'unregister'): + worker.murder_keepalived() + + # Expired should be closed, valid should remain + assert expired_sock.closed is True + assert valid_sock.closed is False + assert len(worker.keepalived_conns) == 1 + assert worker.keepalived_conns[0] is valid_conn + assert worker.nr_conns == 1 + + worker.poller.close() + + +class TestErrorHandling: + """Tests for error handling in various scenarios.""" + + def create_worker(self): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + cfg.set('threads', 4) + cfg.set('worker_connections', 1000) + + worker = gthread.ThreadWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + worker.poller = mock.Mock() + return worker + + def test_finish_request_handles_future_exception(self): + """Test that finish_request handles exceptions from futures.""" + worker = self.create_worker() + worker.nr_conns = 1 + + conn = mock.Mock() + fs = mock.Mock() + fs.cancelled.return_value = False + fs.result.side_effect = RuntimeError("Worker crashed") + + # Should not raise, should close connection + worker.finish_request(conn, fs) assert worker.nr_conns == 0 + conn.close.assert_called_once() + + def test_enqueue_req_submits_to_pool(self): + """Test that enqueue_req properly submits to thread pool.""" + worker = self.create_worker() + worker.tpool = mock.Mock() + worker.method_queue = mock.Mock() + + conn = mock.Mock() + worker.enqueue_req(conn) + + worker.tpool.submit.assert_called_once() + + def test_wait_for_events_handles_eintr(self): + """Test that EINTR is handled gracefully.""" + worker = self.create_worker() + worker.poller = mock.Mock() + worker.poller.select.side_effect = OSError(errno.EINTR, "Interrupted") + + # Should not raise + worker.wait_for_and_dispatch_events(1.0) + + def test_wait_for_events_raises_other_errors(self): + """Test that non-EINTR errors are propagated.""" + worker = self.create_worker() + worker.poller = mock.Mock() + worker.poller.select.side_effect = OSError(errno.EBADF, "Bad file descriptor") + + with pytest.raises(OSError): + worker.wait_for_and_dispatch_events(1.0) + + +class TestConnectionState: + """Tests for connection state management.""" + + def test_tconn_double_init_is_safe(self): + """Test that calling init() twice is safe (idempotent).""" + cfg = Config() + sock = FakeSocket() + conn = gthread.TConn(cfg, sock, ('127.0.0.1', 12345), ('127.0.0.1', 8000)) + + conn.init() + parser1 = conn.parser + + conn.init() # Should not reinitialize + parser2 = conn.parser + + assert parser1 is parser2 + + def test_tconn_close_is_safe(self): + """Test that closing a connection is safe.""" + cfg = Config() + sock = FakeSocket() + conn = gthread.TConn(cfg, sock, ('127.0.0.1', 12345), ('127.0.0.1', 8000)) + + conn.close() + assert sock.closed is True + + # Second close should not raise + conn.close() + + def test_keepalive_timeout_uses_monotonic(self): + """Test that timeout uses monotonic clock.""" + cfg = Config() + cfg.set('keepalive', 5) + sock = FakeSocket() + conn = gthread.TConn(cfg, sock, ('127.0.0.1', 12345), ('127.0.0.1', 8000)) + + before = time.monotonic() + conn.set_timeout() + after = time.monotonic() + + # Timeout should be approximately 5 seconds in the future + assert before + 4.9 <= conn.timeout <= after + 5.1 From 3ebf94c33f8d536c286e7c44f2065b433b156498 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 09:38:41 +0100 Subject: [PATCH 015/356] THANKS: Add contributors from gthread improvements PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add contributors from the incorporated PRs: - Dominik Działak (PR #3308) - Oliver Allen (PR #3303) - sylt (PR #3157) --- THANKS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/THANKS b/THANKS index 9f4c6b6b9..f213e7509 100644 --- a/THANKS +++ b/THANKS @@ -58,6 +58,7 @@ Diego Oliveira Dima Barsky Djoume Salvetti Dmitry Medvinsky +Dominik Działak Dustin Ingram Ed Morley Eric Florenzano @@ -136,6 +137,7 @@ Neil Williams Nick Pillitteri Nik Nyby Nikolay Kim +Oliver Allen Oliver Bristow Oliver Tonnhofer Omer Katz @@ -168,6 +170,7 @@ Stephane Wirtel Stephen DiCato Stephen Holsapple Steven Cummings +sylt Sébastien Fievet Tal Einat <532281+taleinat@users.noreply.github.com> Talha Malik From 2d03d8e6a92d07539ad655be307a36c202551291 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 09:54:04 +0100 Subject: [PATCH 016/356] tests: Add signal handling and liveness tests for gthread worker Add tests for: - Worker liveness reporting to arbiter via WorkerTmp - SIGTERM graceful shutdown behavior - SIGQUIT immediate shutdown behavior - Worker-arbiter integration (parent death detection, timeout) - Signal interaction edge cases (multiple signals, ordering) These tests ensure the gthread worker properly: - Calls notify() in the main loop for arbiter heartbeat - Handles SIGTERM by setting alive=False and waking the poller - Handles SIGQUIT by immediately shutting down the thread pool - Drains connections during graceful shutdown within timeout - Cleans up resources properly on exit --- tests/test_gthread.py | 464 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 464 insertions(+) diff --git a/tests/test_gthread.py b/tests/test_gthread.py index e095bb3b5..b8dbea149 100644 --- a/tests/test_gthread.py +++ b/tests/test_gthread.py @@ -818,3 +818,467 @@ def test_keepalive_timeout_uses_monotonic(self): # Timeout should be approximately 5 seconds in the future assert before + 4.9 <= conn.timeout <= after + 5.1 + + +class TestWorkerLiveness: + """Tests for worker liveness reporting to the arbiter.""" + + def create_worker(self): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + cfg.set('threads', 4) + cfg.set('worker_connections', 1000) + + worker = gthread.ThreadWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + return worker + + def test_notify_calls_tmp_notify(self): + """Test that worker.notify() calls tmp.notify() for arbiter monitoring.""" + worker = self.create_worker() + worker.tmp = mock.Mock() + + worker.notify() + + worker.tmp.notify.assert_called_once() + + def test_notify_updates_tmp_mtime(self): + """Test that notify updates the temp file mtime for arbiter heartbeat. + + WorkerTmp.notify() sets mtime using time.monotonic(), and the arbiter + checks liveness by comparing (time.monotonic() - last_update()) to timeout. + """ + from gunicorn.workers.workertmp import WorkerTmp + + cfg = Config() + tmp = WorkerTmp(cfg) + + # Call notify to set mtime to current monotonic time + tmp.notify() + + # The arbiter checks: time.monotonic() - last_update() <= timeout + # After notify(), this difference should be very small + diff = time.monotonic() - tmp.last_update() + assert diff < 1.0 # Should be nearly zero + + # Wait and verify the difference grows + time.sleep(0.1) + diff_later = time.monotonic() - tmp.last_update() + assert diff_later > diff # Time has passed + + tmp.close() + + def test_worker_notifies_in_run_loop(self): + """Test that worker calls notify() during the run loop.""" + worker = self.create_worker() + worker.tmp = mock.Mock() + worker.method_queue.init() + worker.poller = mock.Mock() + worker.tpool = mock.Mock() + worker.sockets = [] + worker.alive = True + + # Track notify calls + notify_calls = [] + original_notify = worker.notify + def tracking_notify(): + notify_calls.append(time.monotonic()) + original_notify() + worker.notify = tracking_notify + + # Mock poller.select to exit after first iteration + call_count = [0] + def mock_select(timeout): + call_count[0] += 1 + if call_count[0] > 1: + worker.alive = False + return [] + worker.poller.select.side_effect = mock_select + + # Mock is_parent_alive to return True + worker.is_parent_alive = mock.Mock(return_value=True) + + worker.run() + + # Worker should have called notify at least once + assert len(notify_calls) >= 1 + worker.method_queue.close() + + +class TestSignalHandling: + """Tests for signal handling in gthread worker.""" + + def create_worker(self): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + cfg.set('threads', 4) + cfg.set('worker_connections', 1000) + cfg.set('graceful_timeout', 5) + + worker = gthread.ThreadWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + return worker + + def test_handle_exit_sigterm_sets_alive_false(self): + """Test that SIGTERM handler sets alive=False for graceful shutdown.""" + worker = self.create_worker() + worker.method_queue.init() + worker.alive = True + + # Simulate SIGTERM + worker.handle_exit(None, None) + + assert worker.alive is False + worker.method_queue.close() + + def test_handle_exit_wakes_up_poller(self): + """Test that SIGTERM handler wakes up the poller via method_queue.""" + worker = self.create_worker() + worker.method_queue.init() + worker.alive = True + + # After handle_exit, the method_queue should have a callback queued + worker.handle_exit(None, None) + + # Check that something was written to the pipe (to wake poller) + # Read from the pipe - should have data + import select + readable, _, _ = select.select([worker.method_queue.fileno()], [], [], 0) + assert len(readable) > 0 + + worker.method_queue.close() + + def test_handle_quit_sigquit_immediate_shutdown(self): + """Test that SIGQUIT handler triggers immediate shutdown.""" + worker = self.create_worker() + worker.tpool = mock.Mock() + + with pytest.raises(SystemExit) as exc_info: + worker.handle_quit(None, None) + + assert exc_info.value.code == 0 + worker.tpool.shutdown.assert_called_once_with(wait=False) + + def test_graceful_shutdown_stops_accepting(self): + """Test that graceful shutdown stops accepting new connections.""" + worker = self.create_worker() + worker.method_queue.init() + worker.poller = mock.Mock() + worker.tpool = mock.Mock() + worker.sockets = [mock.Mock()] + worker._accepting = True + + # Start accepting + worker.set_accept_enabled(True) + + # Simulate SIGTERM + worker.handle_exit(None, None) + assert worker.alive is False + + # During run loop, accepting should be disabled + worker.set_accept_enabled(False) + assert worker._accepting is False + + worker.method_queue.close() + + def test_graceful_shutdown_drains_connections(self): + """Test that graceful shutdown waits for connections to drain.""" + worker = self.create_worker() + worker.method_queue.init() + worker.poller = mock.Mock() + worker.poller.select.return_value = [] + worker.tpool = mock.Mock() + worker.sockets = [] + worker.nr_conns = 1 # One active connection + worker.alive = True + + # Track iterations + iterations = [0] + def mock_select(timeout): + iterations[0] += 1 + if iterations[0] == 1: + # First iteration: trigger shutdown + worker.alive = False + elif iterations[0] == 2: + # Second iteration: during grace period + pass + elif iterations[0] >= 3: + # Connection finishes + worker.nr_conns = 0 + return [] + worker.poller.select.side_effect = mock_select + worker.is_parent_alive = mock.Mock(return_value=True) + + worker.run() + + # Should have waited for connections + assert iterations[0] >= 2 + worker.method_queue.close() + + def test_sigterm_does_not_interrupt_active_request(self): + """Test that SIGTERM doesn't immediately interrupt active requests.""" + import signal + + worker = self.create_worker() + worker.method_queue.init() + + # The base worker sets siginterrupt(SIGTERM, False) in init_signals + # This ensures system calls aren't interrupted by SIGTERM + + # Verify handle_exit just sets alive=False, doesn't raise + worker.alive = True + worker.handle_exit(signal.SIGTERM, None) + + assert worker.alive is False + # No exception raised, request can continue + worker.method_queue.close() + + +class TestWorkerArbiterIntegration: + """Integration tests for worker-arbiter communication.""" + + def create_worker(self): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + cfg.set('threads', 4) + cfg.set('worker_connections', 1000) + cfg.set('graceful_timeout', 2) + + worker = gthread.ThreadWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + return worker + + def test_worker_detects_parent_death(self): + """Test that worker detects when parent process dies.""" + worker = self.create_worker() + + # Valid ppid + worker.ppid = os.getppid() + assert worker.is_parent_alive() is True + + # Invalid ppid (simulating parent death) + worker.ppid = 99999999 + assert worker.is_parent_alive() is False + + def test_worker_exits_on_parent_death(self): + """Test that worker exits when parent dies.""" + worker = self.create_worker() + worker.method_queue.init() + worker.poller = mock.Mock() + worker.poller.select.return_value = [] + worker.tpool = mock.Mock() + worker.sockets = [] + worker.alive = True + worker.ppid = 99999999 # Invalid ppid + + iterations = [0] + def mock_select(timeout): + iterations[0] += 1 + return [] + worker.poller.select.side_effect = mock_select + + worker.run() + + # Should exit immediately due to parent check + assert iterations[0] == 1 + worker.method_queue.close() + + def test_worker_tmp_file_can_be_monitored(self): + """Test that worker tmp file can be used by arbiter for monitoring. + + The arbiter monitors workers by checking: time.monotonic() - last_update() <= timeout + """ + from gunicorn.workers.workertmp import WorkerTmp + + cfg = Config() + tmp = WorkerTmp(cfg) + + # Worker notifies - sets mtime to current monotonic time + tmp.notify() + + # Arbiter check: time.monotonic() - last_update() should be small + diff = time.monotonic() - tmp.last_update() + assert diff < 1.0 # Worker just notified, should be nearly zero + + # If worker stops notifying, the difference grows + time.sleep(0.1) + diff_later = time.monotonic() - tmp.last_update() + assert diff_later > diff # Arbiter would notice worker isn't responding + + tmp.close() + + def test_graceful_timeout_honored(self): + """Test that graceful_timeout is honored during shutdown.""" + worker = self.create_worker() + worker.cfg.set('graceful_timeout', 1) # 1 second for testing + worker.method_queue.init() + worker.poller = mock.Mock() + worker.tpool = mock.Mock() + worker.sockets = [] + worker.nr_conns = 1 # Active connection that won't finish + worker.alive = True + + # Track iterations + iterations = [0] + start_time = [None] + + def mock_select(timeout): + iterations[0] += 1 + if iterations[0] == 1: + # First iteration: trigger shutdown + worker.alive = False + start_time[0] = time.monotonic() + return [] + else: + # Grace period iterations - simulate time passing via select timeout + # The timeout should be the remaining time + if timeout > 0: + # Simulate some time passing + time.sleep(min(timeout, 0.2)) + # Connection never finishes (nr_conns stays 1) + return [] + worker.poller.select.side_effect = mock_select + worker.is_parent_alive = mock.Mock(return_value=True) + + worker.run() + + # Should have completed (grace timeout expired with connection still active) + assert iterations[0] >= 2 # At least one grace period iteration + + worker.method_queue.close() + + def test_run_completes_cleanup(self): + """Test that run() properly cleans up resources on exit.""" + worker = self.create_worker() + worker.method_queue.init() + worker.poller = selectors.DefaultSelector() + worker.tpool = futures.ThreadPoolExecutor(max_workers=2) + worker.sockets = [] + worker.alive = False # Immediately exit + + worker.is_parent_alive = mock.Mock(return_value=True) + + # Don't pre-register method_queue - run() will do it + worker.run() + + # All resources should be cleaned up + # (No assertion needed - if run() completes without error, cleanup worked) + + +class TestSignalInteraction: + """Tests for signal interactions and edge cases.""" + + def create_worker(self): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + cfg.set('threads', 4) + cfg.set('worker_connections', 1000) + + worker = gthread.ThreadWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + return worker + + def test_multiple_sigterm_is_safe(self): + """Test that receiving multiple SIGTERM is safe.""" + worker = self.create_worker() + worker.method_queue.init() + worker.alive = True + + # Multiple SIGTERM calls should be idempotent + worker.handle_exit(None, None) + assert worker.alive is False + + worker.handle_exit(None, None) + assert worker.alive is False + + worker.method_queue.close() + + def test_sigterm_then_sigquit(self): + """Test SIGQUIT after SIGTERM for force kill.""" + worker = self.create_worker() + worker.method_queue.init() + worker.tpool = mock.Mock() + worker.alive = True + + # First SIGTERM for graceful + worker.handle_exit(None, None) + assert worker.alive is False + + # Then SIGQUIT for immediate + with pytest.raises(SystemExit): + worker.handle_quit(None, None) + + worker.tpool.shutdown.assert_called_once_with(wait=False) + worker.method_queue.close() + + def test_sigquit_does_not_wait_for_threads(self): + """Test that SIGQUIT calls tpool.shutdown(wait=False).""" + worker = self.create_worker() + worker.tpool = mock.Mock() + + with pytest.raises(SystemExit): + worker.handle_quit(None, None) + + # Verify wait=False was passed + worker.tpool.shutdown.assert_called_once_with(wait=False) + + def test_handle_exit_when_already_dead(self): + """Test handle_exit when worker is already shutting down.""" + worker = self.create_worker() + worker.method_queue.init() + worker.alive = False + + # Should not raise, should be idempotent + worker.handle_exit(None, None) + assert worker.alive is False + + worker.method_queue.close() + + def test_connections_tracked_during_signal(self): + """Test that connection count is correct during signal handling.""" + worker = self.create_worker() + worker.method_queue.init() + worker.poller = mock.Mock() + worker.tpool = mock.Mock() + worker.nr_conns = 5 + worker.alive = True + + # SIGTERM should not affect connection count + worker.handle_exit(None, None) + + assert worker.nr_conns == 5 # Still 5 connections + assert worker.alive is False # But shutting down + + worker.method_queue.close() From b650332c708e2d0b699b6cddb20ea29d63382e8c Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 11:56:23 +0100 Subject: [PATCH 017/356] Arbiter signal handling improvements (#3441) * tests: Add tests for current signal handling behavior Add tests for arbiter signal handling: - TestSignalHandlerRegistration (4 tests): Verify signal handler registration, pipe creation, SIGCHLD separate handler, and expected signals list - TestSignalQueue (4 tests): Test signal queueing, max queue size, wakeup writes to pipe, and sleep returns on pipe data - TestReapWorkers (6 tests): Test worker reaping for normal exit, error exit codes, WORKER_BOOT_ERROR, APP_LOAD_ERROR, signal termination, and SIGKILL OOM hint These tests establish baseline coverage before refactoring the signal handling code for safety and reliability improvements. * tests: Add tests for SIGHUP reload and worker lifecycle Add tests for reload and worker management: - TestSighupReload (3 tests): Verify reload spawns configured number of workers, calls manage_workers, and logs hang up message - TestWorkerLifecycle (4 tests): Test spawn_worker adds to WORKERS dict, kill_worker sends correct signal, murder_workers sends SIGABRT first then SIGKILL on subsequent timeout * arbiter: Fix waitpid status parsing using POSIX macros Use os.WIFEXITED/WEXITSTATUS and os.WIFSIGNALED/WTERMSIG instead of manual bit shifting for waitpid status interpretation. This correctly distinguishes between normal exits and signal termination. The previous code used 'status >> 8' which only worked for normal exits, and used raw status values for signal detection which was incorrect. Fixes part of #3435 and #3056 (signal name display issues) * arbiter: Change SIGTERM log level to warning Log signal termination at warning level for expected signals (SIGTERM, SIGQUIT) since these typically occur during normal graceful shutdown. SIGKILL remains at error level with the OOM hint since it indicates abnormal termination. Fixes #3311, #3050 (SIGTERM logged as error) * arbiter: Remove logging from SIGCHLD signal handler Move reap_workers() call from signal handler context to main loop. The signal handler (now signal_chld) only queues the signal and wakes up the main loop. The actual reap_workers() is called from handle_chld() in the main loop where logging is safe. This fixes potential deadlocks caused by logging from signal handler context when holding the logging lock. Fixes #3198, #3004 (logging in signal handlers unsafe, deadlock) * arbiter: Replace PIPE+select with queue.SimpleQueue Use queue.SimpleQueue for signal handling instead of PIPE+select. SimpleQueue is reentrant-safe and can be used from signal handlers. Changes: - Remove PIPE-based wakeup mechanism - Add SIG_QUEUE as SimpleQueue instance - Add WAKEUP_REQUEST sentinel for non-signal wakeups - Replace sleep() with wait_for_signals() using queue.get() - Simplify signal handler to just put_nowait() - Update main loop to iterate over wait_for_signals() - Add reap_workers() call in stop() to properly clean up workers since SIGCHLD is no longer processed during shutdown This simplifies the code and removes the dependency on select(). Also adds integration tests for signal handling that verify: - Basic request/response - Graceful shutdown with SIGTERM/SIGINT - SIGHUP reload - Multiple concurrent requests * arbiter: Wait for old workers on SIGHUP reload After spawning new workers during reload, wait for old workers to terminate before returning from reload(). This prevents the issue where old workers could receive double SIGTERM - once from manage_workers() and again from the arbiter loop. The reload now tracks worker_age before spawning, then waits up to graceful_timeout for workers older than that age to exit. Fixes #3312, #3274 (SIGHUP can send double SIGTERM) * arbiter: Log SIGCHLD at debug level SIGCHLD is received frequently (whenever a worker exits) and doesn't need to be logged at info level. Log it at debug level to reduce noise in the logs while still making it available for debugging. * tests: Fix lint warnings in test_arbiter.py --- gunicorn/arbiter.py | 180 ++++++++------- tests/test_arbiter.py | 367 +++++++++++++++++++++++++++++++ tests/test_signal_integration.py | 203 +++++++++++++++++ 3 files changed, 666 insertions(+), 84 deletions(-) create mode 100644 tests/test_signal_integration.py diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py index 646d684ef..9b9c8d6d8 100644 --- a/gunicorn/arbiter.py +++ b/gunicorn/arbiter.py @@ -3,8 +3,8 @@ # See the NOTICE for more information. import errno import os +import queue import random -import select import signal import sys import time @@ -37,10 +37,10 @@ class Arbiter: LISTENERS = [] WORKERS = {} - PIPE = [] - # I love dynamic languages - SIG_QUEUE = [] + # Sentinel value for non-signal wakeups + WAKEUP_REQUEST = signal.NSIG + SIGNALS = [getattr(signal, "SIG%s" % x) for x in "HUP QUIT INT TERM TTIN TTOU USR1 USR2 WINCH".split()] SIG_NAMES = dict( @@ -55,6 +55,9 @@ def __init__(self, app): self._last_logged_active_worker_count = None self.log = None + # Signal queue - SimpleQueue is reentrant-safe for signal handlers + self.SIG_QUEUE = queue.SimpleQueue() + self.setup(app) self.pidfile = None @@ -172,27 +175,16 @@ def init_signals(self): Initialize master signal handling. Most of the signals are queued. Child signals only wake up the master. """ - # close old PIPE - for p in self.PIPE: - os.close(p) - - # initialize the pipe - self.PIPE = pair = os.pipe() - for p in pair: - util.set_non_blocking(p) - util.close_on_exec(p) - self.log.close_on_exec() # initialize all signals for s in self.SIGNALS: signal.signal(s, self.signal) - signal.signal(signal.SIGCHLD, self.handle_chld) + signal.signal(signal.SIGCHLD, self.signal_chld) def signal(self, sig, frame): - if len(self.SIG_QUEUE) < 5: - self.SIG_QUEUE.append(sig) - self.wakeup() + """Signal handler - NO LOGGING, just queue the signal.""" + self.SIG_QUEUE.put_nowait(sig) def run(self): "Main master loop." @@ -205,25 +197,24 @@ def run(self): while True: self.maybe_promote_master() - sig = self.SIG_QUEUE.pop(0) if self.SIG_QUEUE else None - if sig is None: - self.sleep() - self.murder_workers() - self.manage_workers() - continue + # Wait for and process signals + for sig in self.wait_for_signals(timeout=1.0): + if sig not in self.SIG_NAMES: + self.log.info("Ignoring unknown signal: %s", sig) + continue - if sig not in self.SIG_NAMES: - self.log.info("Ignoring unknown signal: %s", sig) - continue + signame = self.SIG_NAMES.get(sig) + handler = getattr(self, "handle_%s" % signame, None) + if not handler: + self.log.error("Unhandled signal: %s", signame) + continue + # Log SIGCHLD at debug level since it's frequent + log_level = self.log.debug if sig == signal.SIGCHLD else self.log.info + log_level("Handling signal: %s", signame) + handler() - signame = self.SIG_NAMES.get(sig) - handler = getattr(self, "handle_%s" % signame, None) - if not handler: - self.log.error("Unhandled signal: %s", signame) - continue - self.log.info("Handling signal: %s", signame) - handler() - self.wakeup() + self.murder_workers() + self.manage_workers() except (StopIteration, KeyboardInterrupt): self.halt() except HaltServer as inst: @@ -238,10 +229,13 @@ def run(self): self.pidfile.unlink() sys.exit(-1) - def handle_chld(self, sig, frame): - "SIGCHLD handling" + def signal_chld(self, sig, frame): + """SIGCHLD signal handler - NO LOGGING, just queue the signal.""" + self.SIG_QUEUE.put_nowait(sig) + + def handle_chld(self): + """SIGCHLD handling - called from main loop, safe to log.""" self.reap_workers() - self.wakeup() def handle_hup(self): """\ @@ -329,14 +323,8 @@ def maybe_promote_master(self): util._setproctitle("master [%s]" % self.proc_name) def wakeup(self): - """\ - Wake up the arbiter by writing to the PIPE - """ - try: - os.write(self.PIPE[1], b'.') - except OSError as e: - if e.errno not in [errno.EAGAIN, errno.EINTR]: - raise + """Wake up the arbiter's main loop.""" + self.SIG_QUEUE.put_nowait(self.WAKEUP_REQUEST) def halt(self, reason=None, exit_status=0): """ halt arbiter """ @@ -352,24 +340,30 @@ def halt(self, reason=None, exit_status=0): self.cfg.on_exit(self) sys.exit(exit_status) - def sleep(self): + def wait_for_signals(self, timeout=1.0): """\ - Sleep until PIPE is readable or we timeout. - A readable PIPE means a signal occurred. + Wait for signals with timeout. + Returns a list of signals that were received. """ + signals = [] try: - ready = select.select([self.PIPE[0]], [], [], 1.0) - if not ready[0]: - return - while os.read(self.PIPE[0], 1): - pass - except OSError as e: - # TODO: select.error is a subclass of OSError since Python 3.3. - error_number = getattr(e, 'errno', e.args[0]) - if error_number not in [errno.EAGAIN, errno.EINTR]: - raise + # Block until we get a signal or timeout + sig = self.SIG_QUEUE.get(block=True, timeout=timeout) + if sig != self.WAKEUP_REQUEST: + signals.append(sig) + # Drain any additional queued signals + while True: + try: + sig = self.SIG_QUEUE.get_nowait() + if sig != self.WAKEUP_REQUEST: + signals.append(sig) + except queue.Empty: + break + except queue.Empty: + pass except KeyboardInterrupt: sys.exit() + return signals def stop(self, graceful=True): """\ @@ -394,9 +388,12 @@ def stop(self, graceful=True): self.kill_workers(sig) # wait until the graceful timeout while self.WORKERS and time.time() < limit: + self.reap_workers() time.sleep(0.1) self.kill_workers(signal.SIGKILL) + # Final reap to clean up any remaining zombies + self.reap_workers() def reexec(self): """\ @@ -480,13 +477,28 @@ def reload(self): # set new proc_name util._setproctitle("master [%s]" % self.proc_name) + # Remember current worker age before spawning new workers + last_worker_age = self.worker_age + # spawn new workers for _ in range(self.cfg.workers): self.spawn_worker() - # manage workers + # manage workers - this will kill old workers beyond num_workers self.manage_workers() + # wait for old workers to terminate to prevent double SIGTERM + deadline = time.monotonic() + self.cfg.graceful_timeout + while time.monotonic() < deadline: + if not self.WORKERS: + break + # Check if all remaining workers are newer than last_worker_age + oldest = min(w.age for w in self.WORKERS.values()) + if oldest > last_worker_age: + break + self.reap_workers() + time.sleep(0.1) + def murder_workers(self): """\ Kill unused/idle workers @@ -523,36 +535,36 @@ def reap_workers(self): # A worker was terminated. If the termination reason was # that it could not boot, we'll shut it down to avoid # infinite start/stop cycles. - exitcode = status >> 8 - if exitcode != 0: - self.log.error('Worker (pid:%s) exited with code %s', wpid, exitcode) - if exitcode == self.WORKER_BOOT_ERROR: - reason = "Worker failed to boot." - raise HaltServer(reason, self.WORKER_BOOT_ERROR) - if exitcode == self.APP_LOAD_ERROR: - reason = "App failed to load." - raise HaltServer(reason, self.APP_LOAD_ERROR) - - if exitcode > 0: - # If the exit code of the worker is greater than 0, - # let the user know. - self.log.error("Worker (pid:%s) exited with code %s.", - wpid, exitcode) - elif status > 0: - # If the exit code of the worker is 0 and the status - # is greater than 0, then it was most likely killed - # via a signal. + exitcode = None + if os.WIFEXITED(status): + exitcode = os.WEXITSTATUS(status) + elif os.WIFSIGNALED(status): + sig = os.WTERMSIG(status) try: - sig_name = signal.Signals(status).name + sig_name = signal.Signals(sig).name except ValueError: - sig_name = "code {}".format(status) + sig_name = "signal {}".format(sig) msg = "Worker (pid:{}) was sent {}!".format( wpid, sig_name) - # Additional hint for SIGKILL - if status == signal.SIGKILL: + # SIGKILL suggests OOM, log as error + if sig == signal.SIGKILL: msg += " Perhaps out of memory?" - self.log.error(msg) + self.log.error(msg) + else: + # SIGTERM/SIGQUIT are expected during shutdown + self.log.warning(msg) + + if exitcode is not None and exitcode != 0: + self.log.error("Worker (pid:%s) exited with code %s.", + wpid, exitcode) + + if exitcode == self.WORKER_BOOT_ERROR: + reason = "Worker failed to boot." + raise HaltServer(reason, self.WORKER_BOOT_ERROR) + if exitcode == self.APP_LOAD_ERROR: + reason = "App failed to load." + raise HaltServer(reason, self.APP_LOAD_ERROR) worker = self.WORKERS.pop(wpid, None) if not worker: diff --git a/tests/test_arbiter.py b/tests/test_arbiter.py index 8c1527e26..e9d03e195 100644 --- a/tests/test_arbiter.py +++ b/tests/test_arbiter.py @@ -3,10 +3,14 @@ # See the NOTICE for more information. import os +import signal from unittest import mock +import pytest + import gunicorn.app.base import gunicorn.arbiter +import gunicorn.errors from gunicorn.config import ReusePort @@ -185,3 +189,366 @@ def test_env_vars_available_during_preload(): # Note that we aren't making any assertions here, they are made in the # dummy application object being loaded here instead. gunicorn.arbiter.Arbiter(PreloadedAppWithEnvSettings()) + + +# ============================================================================ +# Signal Handler Registration Tests +# ============================================================================ + +class TestSignalHandlerRegistration: + """Tests for signal handler registration during arbiter initialization.""" + + def test_init_signals_registers_all_signals(self): + """Verify that init_signals registers handlers for all expected signals.""" + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + + with mock.patch('signal.signal') as mock_signal: + arbiter.init_signals() + + # Verify all expected signals are registered + registered_signals = {call[0][0] for call in mock_signal.call_args_list} + expected_signals = set(arbiter.SIGNALS) + expected_signals.add(signal.SIGCHLD) + + assert expected_signals.issubset(registered_signals), \ + f"Missing signals: {expected_signals - registered_signals}" + + def test_init_signals_creates_queue(self): + """Verify that arbiter has a SimpleQueue for signals.""" + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + + # Verify SimpleQueue was created + import queue + assert isinstance(arbiter.SIG_QUEUE, queue.SimpleQueue) + + def test_sigchld_has_separate_handler(self): + """Verify that SIGCHLD uses a separate signal handler from other signals.""" + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + + with mock.patch('signal.signal') as mock_signal: + arbiter.init_signals() + + # Find the handler for SIGCHLD - uses signal_chld for async-signal-safety + sigchld_calls = [c for c in mock_signal.call_args_list + if c[0][0] == signal.SIGCHLD] + assert len(sigchld_calls) == 1 + assert sigchld_calls[0][0][1] == arbiter.signal_chld + + # Find handlers for other signals + other_calls = [c for c in mock_signal.call_args_list + if c[0][0] in arbiter.SIGNALS] + for call in other_calls: + assert call[0][1] == arbiter.signal + + def test_signals_list_contains_expected(self): + """Verify that SIGNALS list contains all expected signal types.""" + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + + expected = ['HUP', 'QUIT', 'INT', 'TERM', 'TTIN', 'TTOU', + 'USR1', 'USR2', 'WINCH'] + for name in expected: + sig = getattr(signal, f'SIG{name}') + assert sig in arbiter.SIGNALS, f"SIG{name} not in SIGNALS list" + + +# ============================================================================ +# Signal Queue Tests +# ============================================================================ + +class TestSignalQueue: + """Tests for signal queueing and wakeup mechanism using SimpleQueue.""" + + def test_signal_queued_on_receipt(self): + """Verify that signals are queued when the signal handler is called.""" + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + + arbiter.signal(signal.SIGHUP, None) + + # Get the signal from the queue + sig = arbiter.SIG_QUEUE.get_nowait() + assert sig == signal.SIGHUP + + def test_multiple_signals_queued(self): + """Verify that multiple signals can be queued.""" + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + + # Queue multiple signals + arbiter.signal(signal.SIGHUP, None) + arbiter.signal(signal.SIGTERM, None) + arbiter.signal_chld(signal.SIGCHLD, None) + + signals = [] + while True: + try: + signals.append(arbiter.SIG_QUEUE.get_nowait()) + except Exception: + break + + assert signal.SIGHUP in signals + assert signal.SIGTERM in signals + assert signal.SIGCHLD in signals + + def test_wakeup_puts_sentinel(self): + """Verify that wakeup puts the WAKEUP_REQUEST sentinel to the queue.""" + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + + arbiter.wakeup() + + sig = arbiter.SIG_QUEUE.get_nowait() + assert sig == arbiter.WAKEUP_REQUEST + + def test_wait_for_signals_returns_signals(self): + """Verify that wait_for_signals returns queued signals.""" + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + + # Queue some signals + arbiter.SIG_QUEUE.put_nowait(signal.SIGHUP) + arbiter.SIG_QUEUE.put_nowait(signal.SIGTERM) + + signals = arbiter.wait_for_signals(timeout=0.1) + + assert signal.SIGHUP in signals + assert signal.SIGTERM in signals + + def test_wait_for_signals_filters_wakeup_request(self): + """Verify that WAKEUP_REQUEST sentinel is filtered from results.""" + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + + # Queue a wakeup request and a real signal + arbiter.SIG_QUEUE.put_nowait(arbiter.WAKEUP_REQUEST) + arbiter.SIG_QUEUE.put_nowait(signal.SIGHUP) + + signals = arbiter.wait_for_signals(timeout=0.1) + + assert arbiter.WAKEUP_REQUEST not in signals + assert signal.SIGHUP in signals + + +# ============================================================================ +# Reap Workers Tests +# ============================================================================ + +class TestReapWorkers: + """Tests for worker reaping and exit status handling.""" + + @mock.patch('os.waitpid') + def test_reap_normal_exit(self, mock_waitpid): + """Verify that a worker with normal exit (code 0) is properly reaped.""" + mock_waitpid.side_effect = [(42, 0), (0, 0)] + + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + arbiter.cfg.settings['child_exit'] = mock.Mock() + mock_worker = mock.Mock() + arbiter.WORKERS = {42: mock_worker} + + arbiter.reap_workers() + + mock_worker.tmp.close.assert_called_once() + arbiter.cfg.child_exit.assert_called_once_with(arbiter, mock_worker) + assert 42 not in arbiter.WORKERS + + @mock.patch('os.waitpid') + def test_reap_exit_with_error_code(self, mock_waitpid): + """Verify that a worker exiting with non-zero code is logged.""" + # Exit code 1 (status = 1 << 8 = 256) + mock_waitpid.side_effect = [(42, 256), (0, 0)] + + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + arbiter.cfg.settings['child_exit'] = mock.Mock() + mock_worker = mock.Mock() + arbiter.WORKERS = {42: mock_worker} + + with mock.patch.object(arbiter.log, 'error') as mock_log: + arbiter.reap_workers() + + # Should log the error exit + assert any('exited with code' in str(call) for call in mock_log.call_args_list) + + @mock.patch('os.waitpid') + def test_reap_worker_boot_error(self, mock_waitpid): + """Verify that WORKER_BOOT_ERROR causes HaltServer.""" + # Exit code 3 (WORKER_BOOT_ERROR) = status 3 << 8 = 768 + mock_waitpid.side_effect = [(42, 768), (0, 0)] + + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + arbiter.cfg.settings['child_exit'] = mock.Mock() + mock_worker = mock.Mock() + arbiter.WORKERS = {42: mock_worker} + + with pytest.raises(gunicorn.errors.HaltServer) as exc_info: + arbiter.reap_workers() + + assert exc_info.value.exit_status == gunicorn.arbiter.Arbiter.WORKER_BOOT_ERROR + + @mock.patch('os.waitpid') + def test_reap_app_load_error(self, mock_waitpid): + """Verify that APP_LOAD_ERROR causes HaltServer.""" + # Exit code 4 (APP_LOAD_ERROR) = status 4 << 8 = 1024 + mock_waitpid.side_effect = [(42, 1024), (0, 0)] + + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + arbiter.cfg.settings['child_exit'] = mock.Mock() + mock_worker = mock.Mock() + arbiter.WORKERS = {42: mock_worker} + + with pytest.raises(gunicorn.errors.HaltServer) as exc_info: + arbiter.reap_workers() + + assert exc_info.value.exit_status == gunicorn.arbiter.Arbiter.APP_LOAD_ERROR + + @mock.patch('os.waitpid') + def test_reap_killed_by_signal(self, mock_waitpid): + """Verify that a worker killed by signal is properly identified.""" + # Status for SIGTERM (15) killed process + mock_waitpid.side_effect = [(42, signal.SIGTERM), (0, 0)] + + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + arbiter.cfg.settings['child_exit'] = mock.Mock() + mock_worker = mock.Mock() + arbiter.WORKERS = {42: mock_worker} + + # SIGTERM should be logged as warning (not error) + with mock.patch.object(arbiter.log, 'warning') as mock_log: + arbiter.reap_workers() + + # Should log the signal + assert any('SIGTERM' in str(call) for call in mock_log.call_args_list) + + @mock.patch('os.waitpid') + def test_reap_killed_by_sigkill_oom_hint(self, mock_waitpid): + """Verify that SIGKILL adds OOM hint to log message.""" + # Status for SIGKILL (9) killed process + mock_waitpid.side_effect = [(42, signal.SIGKILL), (0, 0)] + + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + arbiter.cfg.settings['child_exit'] = mock.Mock() + mock_worker = mock.Mock() + arbiter.WORKERS = {42: mock_worker} + + with mock.patch.object(arbiter.log, 'error') as mock_log: + arbiter.reap_workers() + + # Should include OOM hint + log_messages = ' '.join(str(call) for call in mock_log.call_args_list) + assert 'out of memory' in log_messages.lower() + + +# ============================================================================ +# SIGHUP Reload Tests +# ============================================================================ + +class TestSighupReload: + """Tests for SIGHUP (reload) handling.""" + + @mock.patch('gunicorn.arbiter.Arbiter.spawn_worker') + @mock.patch('gunicorn.arbiter.Arbiter.manage_workers') + def test_reload_spawns_new_workers(self, mock_manage, mock_spawn): + """Verify that reload spawns the configured number of workers.""" + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + arbiter.cfg.set('workers', 3) + arbiter.LISTENERS = [mock.Mock()] + arbiter.pidfile = None + # Mock app.reload to prevent it from resetting config + arbiter.app.reload = mock.Mock() + # Mock setup to prevent it from resetting num_workers + arbiter.setup = mock.Mock() + + arbiter.reload() + + assert mock_spawn.call_count == 3 + + @mock.patch('gunicorn.arbiter.Arbiter.spawn_worker') + @mock.patch('gunicorn.arbiter.Arbiter.manage_workers') + def test_reload_calls_manage_workers(self, mock_manage, mock_spawn): + """Verify that reload calls manage_workers after spawning.""" + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + arbiter.cfg.set('workers', 1) + arbiter.LISTENERS = [mock.Mock()] + arbiter.pidfile = None + + arbiter.reload() + + mock_manage.assert_called_once() + + @mock.patch('gunicorn.arbiter.Arbiter.spawn_worker') + @mock.patch('gunicorn.arbiter.Arbiter.manage_workers') + def test_reload_logs_hang_up(self, mock_manage, mock_spawn): + """Verify that handle_hup logs the hang up message.""" + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + arbiter.LISTENERS = [mock.Mock()] + arbiter.pidfile = None + + with mock.patch.object(arbiter.log, 'info') as mock_log: + arbiter.handle_hup() + + # Check that "Hang up" was logged + assert any('Hang up' in str(call) for call in mock_log.call_args_list) + + +# ============================================================================ +# Worker Lifecycle Tests +# ============================================================================ + +class TestWorkerLifecycle: + """Tests for worker spawning, killing, and lifecycle management.""" + + @mock.patch('os.fork') + def test_spawn_worker_adds_to_workers_dict(self, mock_fork): + """Verify that spawn_worker adds the worker to WORKERS dict.""" + mock_fork.return_value = 12345 # Non-zero = parent process + + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + arbiter.WORKERS = {} + arbiter.pid = os.getpid() + arbiter.LISTENERS = [] + + pid = arbiter.spawn_worker() + + assert pid == 12345 + assert 12345 in arbiter.WORKERS + assert arbiter.WORKERS[12345].age == arbiter.worker_age + + def test_kill_worker_sends_signal(self): + """Verify that kill_worker sends the specified signal.""" + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + mock_worker = mock.Mock() + arbiter.WORKERS = {42: mock_worker} + + with mock.patch('os.kill') as mock_kill: + arbiter.kill_worker(42, signal.SIGTERM) + + mock_kill.assert_called_once_with(42, signal.SIGTERM) + + def test_murder_workers_sends_sigabrt_first(self): + """Verify that murder_workers sends SIGABRT on first timeout.""" + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + arbiter.timeout = 30 + + mock_worker = mock.Mock() + mock_worker.aborted = False + # Simulate timeout by returning a very old update time + mock_worker.tmp.last_update.return_value = 0 + arbiter.WORKERS = {42: mock_worker} + + with mock.patch('time.monotonic', return_value=100), \ + mock.patch.object(arbiter, 'kill_worker') as mock_kill: + arbiter.murder_workers() + + mock_kill.assert_called_once_with(42, signal.SIGABRT) + assert mock_worker.aborted is True + + def test_murder_workers_sends_sigkill_second(self): + """Verify that murder_workers sends SIGKILL on second timeout.""" + arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) + arbiter.timeout = 30 + + mock_worker = mock.Mock() + mock_worker.aborted = True # Already aborted once + mock_worker.tmp.last_update.return_value = 0 + arbiter.WORKERS = {42: mock_worker} + + with mock.patch('time.monotonic', return_value=100), \ + mock.patch.object(arbiter, 'kill_worker') as mock_kill: + arbiter.murder_workers() + + mock_kill.assert_called_once_with(42, signal.SIGKILL) diff --git a/tests/test_signal_integration.py b/tests/test_signal_integration.py new file mode 100644 index 000000000..85d99ebf6 --- /dev/null +++ b/tests/test_signal_integration.py @@ -0,0 +1,203 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. +""" +Integration tests for arbiter signal handling. + +These tests start a real gunicorn process and verify signal handling +works correctly with actual requests and signals. +""" + +import os +import signal +import socket +import subprocess +import sys +import time + +import pytest + + +# Simple WSGI app inline +SIMPLE_APP = ''' +def application(environ, start_response): + """Basic hello world response.""" + status = '200 OK' + body = b'Hello, World!' + headers = [ + ('Content-Type', 'text/plain'), + ('Content-Length', str(len(body))), + ] + start_response(status, headers) + return [body] +''' + + +def find_free_port(): + """Find a free port to bind to.""" + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: + s.bind(('127.0.0.1', 0)) + return s.getsockname()[1] + + +def wait_for_server(host, port, timeout=10): + """Wait until server is accepting connections.""" + start = time.monotonic() + while time.monotonic() - start < timeout: + try: + with socket.create_connection((host, port), timeout=1): + return True + except (ConnectionRefusedError, socket.timeout, OSError): + time.sleep(0.1) + return False + + +def make_request(host, port, path='/'): + """Make a simple HTTP request and return the response body.""" + with socket.create_connection((host, port), timeout=5) as sock: + request = f'GET {path} HTTP/1.1\r\nHost: {host}\r\nConnection: close\r\n\r\n' + sock.sendall(request.encode()) + response = b'' + while True: + chunk = sock.recv(4096) + if not chunk: + break + response += chunk + return response + + +@pytest.fixture +def app_module(tmp_path): + """Create a temporary app module.""" + app_file = tmp_path / "app.py" + app_file.write_text(SIMPLE_APP) + return str(app_file.parent), "app:application" + + +@pytest.fixture +def gunicorn_server(app_module): + """Start and stop a gunicorn server.""" + app_dir, app_name = app_module + port = find_free_port() + + # Start gunicorn + cmd = [ + sys.executable, '-m', 'gunicorn', + '--bind', f'127.0.0.1:{port}', + '--workers', '2', + '--worker-class', 'sync', + '--access-logfile', '-', + '--error-logfile', '-', + '--log-level', 'info', + app_name + ] + + proc = subprocess.Popen( + cmd, + cwd=app_dir, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + env={**os.environ, 'PYTHONPATH': app_dir} + ) + + # Wait for server to start + if not wait_for_server('127.0.0.1', port): + proc.terminate() + proc.wait() + stdout, stderr = proc.communicate() + pytest.fail(f"Gunicorn failed to start:\nstdout: {stdout.decode()}\nstderr: {stderr.decode()}") + + yield proc, port + + # Cleanup + if proc.poll() is None: + proc.terminate() + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + proc.wait() + + +class TestSignalHandlingIntegration: + """Integration tests for signal handling.""" + + def test_basic_request(self, gunicorn_server): + """Verify the server responds to basic requests.""" + proc, port = gunicorn_server + + response = make_request('127.0.0.1', port) + assert b'Hello, World!' in response + + def test_graceful_shutdown_sigterm(self, gunicorn_server): + """Verify SIGTERM causes graceful shutdown.""" + proc, port = gunicorn_server + + # Verify server is working + response = make_request('127.0.0.1', port) + assert b'Hello, World!' in response + + # Send SIGTERM + proc.send_signal(signal.SIGTERM) + + # Wait for process to exit + try: + exit_code = proc.wait(timeout=10) + assert exit_code == 0, f"Expected exit code 0, got {exit_code}" + except subprocess.TimeoutExpired: + proc.kill() + pytest.fail("Gunicorn did not exit within timeout after SIGTERM") + + def test_graceful_shutdown_sigint(self, gunicorn_server): + """Verify SIGINT causes graceful shutdown.""" + proc, port = gunicorn_server + + # Verify server is working + response = make_request('127.0.0.1', port) + assert b'Hello, World!' in response + + # Send SIGINT + proc.send_signal(signal.SIGINT) + + # Wait for process to exit + try: + exit_code = proc.wait(timeout=10) + assert exit_code == 0, f"Expected exit code 0, got {exit_code}" + except subprocess.TimeoutExpired: + proc.kill() + pytest.fail("Gunicorn did not exit within timeout after SIGINT") + + def test_sighup_reload(self, gunicorn_server): + """Verify SIGHUP triggers reload.""" + proc, port = gunicorn_server + + # Verify server is working + response = make_request('127.0.0.1', port) + assert b'Hello, World!' in response + + # Send SIGHUP + proc.send_signal(signal.SIGHUP) + + # Wait a moment for reload + time.sleep(2) + + # Verify server still works after reload + assert proc.poll() is None, "Server died after SIGHUP" + response = make_request('127.0.0.1', port) + assert b'Hello, World!' in response + + def test_multiple_requests_under_load(self, gunicorn_server): + """Verify server handles multiple concurrent requests.""" + proc, port = gunicorn_server + + # Make several requests in sequence + for _ in range(10): + response = make_request('127.0.0.1', port) + assert b'Hello, World!' in response + + # Verify server is still running + assert proc.poll() is None + + +if __name__ == '__main__': + pytest.main([__file__, '-v']) From 6f103ba9b20c3e78dbaee8e561f82238906f0928 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 12:01:50 +0100 Subject: [PATCH 018/356] THANKS: Add contributors from signal handling PRs --- THANKS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/THANKS b/THANKS index f213e7509..959cd093f 100644 --- a/THANKS +++ b/THANKS @@ -83,9 +83,11 @@ INADA Naoki Jakub Paweł Głazik Jan-Philip Gehrcke Jannis Leidel +Jason Jones Jason Madden jean-philippe serafin Jeremy Volkman +Jeroen Pulles Jeryn Mathew Jet Sun Jim Garrison @@ -142,6 +144,7 @@ Oliver Bristow Oliver Tonnhofer Omer Katz PA Parent +Paul Jeannot Paul Davis Paul J. Davis Paul Smith @@ -159,6 +162,7 @@ Rhys Powell Rik Ronan Amicel Ryan Peck +Ryuichi Watanabe Saeed Gharedaghi Samuel Matos Sergey Rublev From ea98400820a3a69097d79e2b19055e9f554fee2d Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 14:00:02 +0100 Subject: [PATCH 019/356] ci: Fix macOS tests and add FreeBSD support (#3442) * ci: Remove failing macos-13 from test matrix * ci: Add FreeBSD testing workflow * ci: Document test matrix rationale * ci: Update cross-platform-actions to v0.32.0 for FreeBSD 14.2 support * ci: Use FreeBSD 14.1 (14.2 has SSH connectivity issues) * ci: Switch to vmactions/freebsd-vm for FreeBSD testing * ci: Fix FreeBSD package names (pip included in Python) * ci: Simplify FreeBSD matrix and fix package names * ci: Use specific Python version command on FreeBSD * ci: Add sqlite3 package for FreeBSD * tests: Increase signal integration test timeouts for CI The signal integration tests were flaky in CI environments, especially FreeBSD VMs, due to 10-second timeouts being too short. Increased timeouts to 30 seconds to handle slower CI environments. --- .github/workflows/freebsd.yml | 47 ++++++++++++++++++++++++++++++++ .github/workflows/tox.yml | 5 ++-- tests/test_signal_integration.py | 10 +++++-- 3 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/freebsd.yml diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml new file mode 100644 index 000000000..060f40cab --- /dev/null +++ b/.github/workflows/freebsd.yml @@ -0,0 +1,47 @@ +name: FreeBSD + +on: + push: + pull_request: + workflow_dispatch: + +permissions: + contents: read + +env: + FORCE_COLOR: 1 + +jobs: + test: + name: FreeBSD ${{ matrix.freebsd-version }} / Python ${{ matrix.python-version }} + runs-on: ubuntu-latest + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + include: + - freebsd-version: '14.2' + python-version: '3.12' + python-pkg: 'python312 py312-sqlite3' + - freebsd-version: '14.2' + python-version: '3.13' + python-pkg: 'python313 py313-sqlite3' + steps: + - uses: actions/checkout@v6 + + - name: Test on FreeBSD + uses: vmactions/freebsd-vm@v1 + with: + release: ${{ matrix.freebsd-version }} + usesh: true + prepare: | + pkg install -y ${{ matrix.python-pkg }} + run: | + python${{ matrix.python-version }} -m venv venv + . venv/bin/activate + pip install --upgrade pip + pip install pytest pytest-cov coverage + pip install -e . + pytest --cov=gunicorn -v tests/ \ + --ignore=tests/workers/test_ggevent.py \ + --ignore=tests/workers/test_geventlet.py diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 2555073c6..c7daa6480 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -17,9 +17,8 @@ jobs: unsupported: [false] os: - ubuntu-latest - # not defaulting to macos-latest: Python <= 3.9 was missing from macos-14 @ arm64 - - macos-13 - # Not testing Windows, because tests need Unix-only fcntl, grp, pwd, etc. + # Not testing Windows: tests need Unix-only fcntl, grp, pwd, etc. + # FreeBSD: tested in separate freebsd.yml workflow python-version: # Supporting Python 3.10 through 3.13 - "3.10" diff --git a/tests/test_signal_integration.py b/tests/test_signal_integration.py index 85d99ebf6..868e15647 100644 --- a/tests/test_signal_integration.py +++ b/tests/test_signal_integration.py @@ -18,6 +18,10 @@ import pytest +# Timeout for CI environments (VMs can be slow) +CI_TIMEOUT = 30 + + # Simple WSGI app inline SIMPLE_APP = ''' def application(environ, start_response): @@ -40,7 +44,7 @@ def find_free_port(): return s.getsockname()[1] -def wait_for_server(host, port, timeout=10): +def wait_for_server(host, port, timeout=CI_TIMEOUT): """Wait until server is accepting connections.""" start = time.monotonic() while time.monotonic() - start < timeout: @@ -142,7 +146,7 @@ def test_graceful_shutdown_sigterm(self, gunicorn_server): # Wait for process to exit try: - exit_code = proc.wait(timeout=10) + exit_code = proc.wait(timeout=CI_TIMEOUT) assert exit_code == 0, f"Expected exit code 0, got {exit_code}" except subprocess.TimeoutExpired: proc.kill() @@ -161,7 +165,7 @@ def test_graceful_shutdown_sigint(self, gunicorn_server): # Wait for process to exit try: - exit_code = proc.wait(timeout=10) + exit_code = proc.wait(timeout=CI_TIMEOUT) assert exit_code == 0, f"Expected exit code 0, got {exit_code}" except subprocess.TimeoutExpired: proc.kill() From ae1eea8108b10e8aa3d5f937c7eb8076a0d2ef56 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 17:05:29 +0100 Subject: [PATCH 020/356] asgi: Add native ASGI worker with HTTP and WebSocket support Add a new ASGI worker type that provides native async support using gunicorn's own HTTP parsing infrastructure adapted for asyncio. Features: - HTTP/1.1 with keepalive support - WebSocket connections (RFC 6455) - ASGI lifespan protocol for startup/shutdown hooks - Optional uvloop support for improved performance - Full proxy protocol support (inherited from gunicorn) New configuration options: - --asgi-loop: Event loop selection (auto/asyncio/uvloop) - --asgi-lifespan: Lifespan protocol control (auto/on/off) - --root-path: ASGI root path for reverse proxy setups Usage: gunicorn -k asgi myapp:app --- examples/asgi/__init__.py | 7 + examples/asgi/basic_app.py | 130 +++++++ examples/asgi/websocket_app.py | 235 ++++++++++++ gunicorn/asgi/__init__.py | 26 ++ gunicorn/asgi/lifespan.py | 178 +++++++++ gunicorn/asgi/message.py | 562 ++++++++++++++++++++++++++++ gunicorn/asgi/protocol.py | 424 ++++++++++++++++++++++ gunicorn/asgi/unreader.py | 100 +++++ gunicorn/asgi/websocket.py | 369 +++++++++++++++++++ gunicorn/config.py | 91 +++++ gunicorn/workers/__init__.py | 1 + gunicorn/workers/gasgi.py | 282 +++++++++++++++ pyproject.toml | 1 + tests/test_asgi.py | 285 +++++++++++++++ tests/test_asgi_worker.py | 643 +++++++++++++++++++++++++++++++++ 15 files changed, 3334 insertions(+) create mode 100644 examples/asgi/__init__.py create mode 100644 examples/asgi/basic_app.py create mode 100644 examples/asgi/websocket_app.py create mode 100644 gunicorn/asgi/__init__.py create mode 100644 gunicorn/asgi/lifespan.py create mode 100644 gunicorn/asgi/message.py create mode 100644 gunicorn/asgi/protocol.py create mode 100644 gunicorn/asgi/unreader.py create mode 100644 gunicorn/asgi/websocket.py create mode 100644 gunicorn/workers/gasgi.py create mode 100644 tests/test_asgi.py create mode 100644 tests/test_asgi_worker.py diff --git a/examples/asgi/__init__.py b/examples/asgi/__init__.py new file mode 100644 index 000000000..1c9ecbeb3 --- /dev/null +++ b/examples/asgi/__init__.py @@ -0,0 +1,7 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +""" +ASGI example applications for gunicorn. +""" diff --git a/examples/asgi/basic_app.py b/examples/asgi/basic_app.py new file mode 100644 index 000000000..73a160fef --- /dev/null +++ b/examples/asgi/basic_app.py @@ -0,0 +1,130 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +""" +Basic ASGI application example. + +Run with: + gunicorn -k asgi examples.asgi.basic_app:app + +Test with: + curl http://127.0.0.1:8000/ + curl http://127.0.0.1:8000/hello + curl -X POST http://127.0.0.1:8000/echo -d "test data" +""" + + +async def app(scope, receive, send): + """Simple ASGI application demonstrating basic functionality.""" + + if scope["type"] == "lifespan": + await handle_lifespan(scope, receive, send) + elif scope["type"] == "http": + await handle_http(scope, receive, send) + else: + raise ValueError(f"Unknown scope type: {scope['type']}") + + +async def handle_lifespan(scope, receive, send): + """Handle lifespan events (startup/shutdown).""" + while True: + message = await receive() + if message["type"] == "lifespan.startup": + print("ASGI application starting up...") + await send({"type": "lifespan.startup.complete"}) + elif message["type"] == "lifespan.shutdown": + print("ASGI application shutting down...") + await send({"type": "lifespan.shutdown.complete"}) + return + + +async def handle_http(scope, receive, send): + """Handle HTTP requests.""" + path = scope["path"] + method = scope["method"] + + if path == "/" and method == "GET": + await send_response(send, 200, b"Welcome to gunicorn ASGI!\n") + + elif path == "/hello" and method == "GET": + name = get_query_param(scope, "name", "World") + body = f"Hello, {name}!\n".encode() + await send_response(send, 200, body) + + elif path == "/echo" and method == "POST": + body = await read_body(receive) + await send_response(send, 200, body, content_type=b"application/octet-stream") + + elif path == "/headers": + headers_info = format_headers(scope["headers"]) + await send_response(send, 200, headers_info.encode()) + + elif path == "/info": + info = format_request_info(scope) + await send_response(send, 200, info.encode(), content_type=b"application/json") + + else: + await send_response(send, 404, b"Not Found\n") + + +async def send_response(send, status, body, content_type=b"text/plain"): + """Send an HTTP response.""" + await send({ + "type": "http.response.start", + "status": status, + "headers": [ + (b"content-type", content_type), + (b"content-length", str(len(body)).encode()), + ], + }) + await send({ + "type": "http.response.body", + "body": body, + }) + + +async def read_body(receive): + """Read the full request body.""" + body = b"" + while True: + message = await receive() + body += message.get("body", b"") + if not message.get("more_body", False): + break + return body + + +def get_query_param(scope, name, default=None): + """Get a query parameter value.""" + query_string = scope.get("query_string", b"").decode() + for param in query_string.split("&"): + if "=" in param: + key, value = param.split("=", 1) + if key == name: + return value + return default + + +def format_headers(headers): + """Format headers for display.""" + lines = ["Request Headers:"] + for name, value in headers: + lines.append(f" {name.decode()}: {value.decode()}") + return "\n".join(lines) + "\n" + + +def format_request_info(scope): + """Format request info as JSON.""" + import json + info = { + "method": scope["method"], + "path": scope["path"], + "query_string": scope.get("query_string", b"").decode(), + "http_version": scope["http_version"], + "scheme": scope["scheme"], + "server": list(scope.get("server") or []), + "client": list(scope.get("client") or []), + "root_path": scope.get("root_path", ""), + } + return json.dumps(info, indent=2) + "\n" diff --git a/examples/asgi/websocket_app.py b/examples/asgi/websocket_app.py new file mode 100644 index 000000000..8423c30e6 --- /dev/null +++ b/examples/asgi/websocket_app.py @@ -0,0 +1,235 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +""" +WebSocket ASGI application example. + +Run with: + gunicorn -k asgi examples.asgi.websocket_app:app + +Test with: + # Using websocat (install with: cargo install websocat) + websocat ws://127.0.0.1:8000/ws + + # Or using Python websockets library + python -c " + import asyncio + import websockets + async def test(): + async with websockets.connect('ws://127.0.0.1:8000/ws') as ws: + await ws.send('Hello') + print(await ws.recv()) + asyncio.run(test()) + " +""" + + +async def app(scope, receive, send): + """ASGI application with WebSocket support.""" + + if scope["type"] == "lifespan": + await handle_lifespan(scope, receive, send) + elif scope["type"] == "http": + await handle_http(scope, receive, send) + elif scope["type"] == "websocket": + await handle_websocket(scope, receive, send) + else: + raise ValueError(f"Unknown scope type: {scope['type']}") + + +async def handle_lifespan(scope, receive, send): + """Handle lifespan events.""" + while True: + message = await receive() + if message["type"] == "lifespan.startup": + await send({"type": "lifespan.startup.complete"}) + elif message["type"] == "lifespan.shutdown": + await send({"type": "lifespan.shutdown.complete"}) + return + + +async def handle_http(scope, receive, send): + """Handle HTTP requests - serve a simple HTML page for WebSocket testing.""" + path = scope["path"] + + if path == "/": + html = HTML_PAGE.encode() + await send({ + "type": "http.response.start", + "status": 200, + "headers": [ + (b"content-type", b"text/html"), + (b"content-length", str(len(html)).encode()), + ], + }) + await send({ + "type": "http.response.body", + "body": html, + }) + else: + await send({ + "type": "http.response.start", + "status": 404, + "headers": [(b"content-type", b"text/plain")], + }) + await send({ + "type": "http.response.body", + "body": b"Not Found", + }) + + +async def handle_websocket(scope, receive, send): + """Handle WebSocket connections.""" + path = scope["path"] + + if path == "/ws": + await echo_websocket(scope, receive, send) + elif path == "/ws/chat": + await chat_websocket(scope, receive, send) + else: + # Reject the connection + await send({"type": "websocket.close", "code": 4004}) + + +async def echo_websocket(scope, receive, send): + """Echo WebSocket - sends back whatever it receives.""" + # Wait for connection + message = await receive() + if message["type"] != "websocket.connect": + return + + # Accept the connection + await send({"type": "websocket.accept"}) + + # Echo loop + try: + while True: + message = await receive() + + if message["type"] == "websocket.disconnect": + break + + if message["type"] == "websocket.receive": + if "text" in message: + # Echo text back + await send({ + "type": "websocket.send", + "text": f"Echo: {message['text']}" + }) + elif "bytes" in message: + # Echo bytes back + await send({ + "type": "websocket.send", + "bytes": message["bytes"] + }) + except Exception as e: + print(f"WebSocket error: {e}") + finally: + try: + await send({"type": "websocket.close", "code": 1000}) + except Exception: + pass + + +async def chat_websocket(scope, receive, send): + """Chat WebSocket - simple broadcast example.""" + message = await receive() + if message["type"] != "websocket.connect": + return + + await send({ + "type": "websocket.accept", + "subprotocol": "chat" + }) + + await send({ + "type": "websocket.send", + "text": "Welcome to the chat! Send messages and they will be echoed back." + }) + + try: + while True: + message = await receive() + + if message["type"] == "websocket.disconnect": + break + + if message["type"] == "websocket.receive" and "text" in message: + text = message["text"] + await send({ + "type": "websocket.send", + "text": f"[You]: {text}" + }) + except Exception: + pass + + +HTML_PAGE = """ + + + WebSocket Test + + + +

WebSocket Test

+
+ + + + + + + + +""" diff --git a/gunicorn/asgi/__init__.py b/gunicorn/asgi/__init__.py new file mode 100644 index 000000000..c2f13b2a0 --- /dev/null +++ b/gunicorn/asgi/__init__.py @@ -0,0 +1,26 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +""" +ASGI support for gunicorn. + +This module provides native ASGI worker support, using gunicorn's own +HTTP parsing infrastructure adapted for async I/O. + +Components: +- AsyncUnreader: Async socket reading with pushback buffer +- AsyncRequest: Async HTTP request parser +- ASGIProtocol: asyncio.Protocol implementation for HTTP handling +- WebSocketProtocol: WebSocket protocol handler (RFC 6455) +- LifespanManager: ASGI lifespan protocol support + +Usage: + gunicorn -k asgi myapp:app +""" + +from gunicorn.asgi.unreader import AsyncUnreader +from gunicorn.asgi.message import AsyncRequest +from gunicorn.asgi.lifespan import LifespanManager + +__all__ = ['AsyncUnreader', 'AsyncRequest', 'LifespanManager'] diff --git a/gunicorn/asgi/lifespan.py b/gunicorn/asgi/lifespan.py new file mode 100644 index 000000000..9811cf56a --- /dev/null +++ b/gunicorn/asgi/lifespan.py @@ -0,0 +1,178 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +""" +ASGI lifespan protocol manager. + +Manages startup and shutdown events for ASGI applications, +enabling frameworks like FastAPI to run initialization and +cleanup code. +""" + +import asyncio + + +class LifespanManager: + """Manages ASGI lifespan events (startup/shutdown). + + The lifespan protocol allows ASGI applications to run code at + startup and shutdown. This is essential for applications that + need to initialize database connections, caches, or other + resources. + + ASGI lifespan messages: + - Server sends: {"type": "lifespan.startup"} + - App responds: {"type": "lifespan.startup.complete"} or + {"type": "lifespan.startup.failed", "message": "..."} + - Server sends: {"type": "lifespan.shutdown"} + - App responds: {"type": "lifespan.shutdown.complete"} + """ + + def __init__(self, app, logger, state=None): + """Initialize the lifespan manager. + + Args: + app: ASGI application callable + logger: Logger instance + state: Shared state dict for the application + """ + self.app = app + self.logger = logger + self.state = state if state is not None else {} + + self._startup_complete = asyncio.Event() + self._shutdown_complete = asyncio.Event() + self._startup_failed = False + self._startup_error = None + self._shutdown_error = None + self._receive_queue = asyncio.Queue() + self._task = None + self._app_finished = False + + async def startup(self): + """Run lifespan startup and wait for completion. + + Raises: + RuntimeError: If startup fails or app doesn't support lifespan + """ + scope = { + "type": "lifespan", + "asgi": {"version": "3.0", "spec_version": "2.4"}, + "state": self.state, + } + + # Send startup event + await self._receive_queue.put({"type": "lifespan.startup"}) + + # Run lifespan in background task + self._task = asyncio.create_task(self._run_lifespan(scope)) + + # Wait for startup with timeout + try: + await asyncio.wait_for( + self._startup_complete.wait(), + timeout=30.0 # Reasonable startup timeout + ) + except asyncio.TimeoutError: + if self._task: + self._task.cancel() + raise RuntimeError("Lifespan startup timed out") + + if self._startup_failed: + if self._task: + self._task.cancel() + msg = self._startup_error or "Unknown error" + raise RuntimeError(f"Lifespan startup failed: {msg}") + + self.logger.debug("ASGI lifespan startup complete") + + async def shutdown(self): + """Signal shutdown and wait for completion. + + This should be called during graceful shutdown. + """ + if self._app_finished: + self.logger.debug("ASGI lifespan already finished") + return + + # Send shutdown event + await self._receive_queue.put({"type": "lifespan.shutdown"}) + + # Wait for shutdown with timeout + try: + await asyncio.wait_for( + self._shutdown_complete.wait(), + timeout=30.0 # Reasonable shutdown timeout + ) + except asyncio.TimeoutError: + self.logger.warning("Lifespan shutdown timed out") + + if self._shutdown_error: + self.logger.error("Lifespan shutdown error: %s", self._shutdown_error) + + # Cancel the task if still running + if self._task and not self._task.done(): + self._task.cancel() + try: + await self._task + except asyncio.CancelledError: + pass + + self.logger.debug("ASGI lifespan shutdown complete") + + async def _run_lifespan(self, scope): + """Run the ASGI lifespan protocol.""" + try: + await self.app(scope, self._receive, self._send) + except asyncio.CancelledError: + raise + except Exception as e: + self.logger.debug("Lifespan application raised: %s", e) + # If startup hasn't completed, mark it as failed + if not self._startup_complete.is_set(): + self._startup_failed = True + self._startup_error = str(e) + self._startup_complete.set() + # If shutdown hasn't completed, mark error + elif not self._shutdown_complete.is_set(): + self._shutdown_error = str(e) + self._shutdown_complete.set() + finally: + self._app_finished = True + # Ensure events are set to unblock waiters + if not self._startup_complete.is_set(): + self._startup_failed = True + self._startup_error = "Application exited before startup complete" + self._startup_complete.set() + if not self._shutdown_complete.is_set(): + self._shutdown_complete.set() + + async def _receive(self): + """ASGI receive callable for lifespan.""" + return await self._receive_queue.get() + + async def _send(self, message): + """ASGI send callable for lifespan.""" + msg_type = message["type"] + + if msg_type == "lifespan.startup.complete": + self._startup_complete.set() + self.logger.debug("Received lifespan.startup.complete") + + elif msg_type == "lifespan.startup.failed": + self._startup_failed = True + self._startup_error = message.get("message", "") + self._startup_complete.set() + self.logger.debug("Received lifespan.startup.failed: %s", + self._startup_error) + + elif msg_type == "lifespan.shutdown.complete": + self._shutdown_complete.set() + self.logger.debug("Received lifespan.shutdown.complete") + + elif msg_type == "lifespan.shutdown.failed": + self._shutdown_error = message.get("message", "") + self._shutdown_complete.set() + self.logger.debug("Received lifespan.shutdown.failed: %s", + self._shutdown_error) diff --git a/gunicorn/asgi/message.py b/gunicorn/asgi/message.py new file mode 100644 index 000000000..d7d20c834 --- /dev/null +++ b/gunicorn/asgi/message.py @@ -0,0 +1,562 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +""" +Async version of gunicorn/http/message.py for ASGI workers. + +Reuses the parsing logic from the sync version, adapted for async I/O. +""" + +import io +import re +import socket + +from gunicorn.http.errors import ( + InvalidHeader, InvalidHeaderName, NoMoreData, + InvalidRequestLine, InvalidRequestMethod, InvalidHTTPVersion, + LimitRequestLine, LimitRequestHeaders, + UnsupportedTransferCoding, ObsoleteFolding, + InvalidProxyLine, ForbiddenProxyRequest, + InvalidSchemeHeaders, +) +from gunicorn.util import bytes_to_str, split_request_uri + +MAX_REQUEST_LINE = 8190 +MAX_HEADERS = 32768 +DEFAULT_MAX_HEADERFIELD_SIZE = 8190 + +# Reuse regex patterns from sync version +RFC9110_5_6_2_TOKEN_SPECIALS = r"!#$%&'*+-.^_`|~" +TOKEN_RE = re.compile(r"[%s0-9a-zA-Z]+" % (re.escape(RFC9110_5_6_2_TOKEN_SPECIALS))) +METHOD_BADCHAR_RE = re.compile("[a-z#]") +VERSION_RE = re.compile(r"HTTP/(\d)\.(\d)") +RFC9110_5_5_INVALID_AND_DANGEROUS = re.compile(r"[\0\r\n]") + + +class AsyncRequest: + """Async HTTP request parser. + + Parses HTTP/1.x requests using async I/O, reusing gunicorn's + parsing logic where possible. + """ + + def __init__(self, cfg, unreader, peer_addr, req_number=1): + self.cfg = cfg + self.unreader = unreader + self.peer_addr = peer_addr + self.remote_addr = peer_addr + self.req_number = req_number + + self.version = None + self.method = None + self.uri = None + self.path = None + self.query = None + self.fragment = None + self.headers = [] + self.trailers = [] + self.scheme = "https" if cfg.is_ssl else "http" + self.must_close = False + + self.proxy_protocol_info = None + + # Request line limit + self.limit_request_line = cfg.limit_request_line + if (self.limit_request_line < 0 + or self.limit_request_line >= MAX_REQUEST_LINE): + self.limit_request_line = MAX_REQUEST_LINE + + # Headers limits + self.limit_request_fields = cfg.limit_request_fields + if (self.limit_request_fields <= 0 + or self.limit_request_fields > MAX_HEADERS): + self.limit_request_fields = MAX_HEADERS + + self.limit_request_field_size = cfg.limit_request_field_size + if self.limit_request_field_size < 0: + self.limit_request_field_size = DEFAULT_MAX_HEADERFIELD_SIZE + + # Max header buffer size + max_header_field_size = self.limit_request_field_size or DEFAULT_MAX_HEADERFIELD_SIZE + self.max_buffer_headers = self.limit_request_fields * \ + (max_header_field_size + 2) + 4 + + # Body-related state + self.content_length = None + self.chunked = False + self._body_reader = None + self._body_remaining = 0 + + @classmethod + async def parse(cls, cfg, unreader, peer_addr, req_number=1): + """Parse an HTTP request from the stream. + + Args: + cfg: gunicorn config object + unreader: AsyncUnreader instance + peer_addr: client address tuple + req_number: request number on this connection (for keepalive) + + Returns: + AsyncRequest: Parsed request object + + Raises: + NoMoreData: If no data available + Various parsing errors for malformed requests + """ + req = cls(cfg, unreader, peer_addr, req_number) + await req._parse() + return req + + async def _parse(self): + """Parse the request from the unreader.""" + buf = io.BytesIO() + await self._get_data(buf, stop=True) + + # Get request line + line, rbuf = await self._read_line(buf, self.limit_request_line) + + # Proxy protocol + if self._proxy_protocol(bytes_to_str(line)): + # Get next request line + buf = io.BytesIO() + buf.write(rbuf) + line, rbuf = await self._read_line(buf, self.limit_request_line) + + self._parse_request_line(line) + buf = io.BytesIO() + buf.write(rbuf) + + # Headers + data = buf.getvalue() + + while True: + idx = data.find(b"\r\n\r\n") + done = data[:2] == b"\r\n" + + if idx < 0 and not done: + await self._get_data(buf) + data = buf.getvalue() + if len(data) > self.max_buffer_headers: + raise LimitRequestHeaders("max buffer headers") + else: + break + + if done: + self.unreader.unread(data[2:]) + else: + self.headers = self._parse_headers(data[:idx], from_trailer=False) + self.unreader.unread(data[idx + 4:]) + + self._set_body_reader() + + async def _get_data(self, buf, stop=False): + """Read data from unreader into buffer.""" + data = await self.unreader.read() + if not data: + if stop: + raise StopIteration() + raise NoMoreData(buf.getvalue()) + buf.write(data) + + async def _read_line(self, buf, limit=0): + """Read a line from the buffer/stream.""" + data = buf.getvalue() + + while True: + idx = data.find(b"\r\n") + if idx >= 0: + if idx > limit > 0: + raise LimitRequestLine(idx, limit) + break + if len(data) - 2 > limit > 0: + raise LimitRequestLine(len(data), limit) + await self._get_data(buf) + data = buf.getvalue() + + return (data[:idx], data[idx + 2:]) + + def _proxy_protocol(self, line): + """Detect, check and parse proxy protocol.""" + if not self.cfg.proxy_protocol: + return False + + if self.req_number != 1: + return False + + if not line.startswith("PROXY"): + return False + + self._proxy_protocol_access_check() + self._parse_proxy_protocol(line) + + return True + + def _proxy_protocol_access_check(self): + """Check if proxy protocol is allowed from this peer.""" + if ("*" not in self.cfg.proxy_allow_ips and + isinstance(self.peer_addr, tuple) and + self.peer_addr[0] not in self.cfg.proxy_allow_ips): + raise ForbiddenProxyRequest(self.peer_addr[0]) + + def _parse_proxy_protocol(self, line): + """Parse proxy protocol header line.""" + bits = line.split(" ") + + if len(bits) != 6: + raise InvalidProxyLine(line) + + proto = bits[1] + s_addr = bits[2] + d_addr = bits[3] + + if proto not in ["TCP4", "TCP6"]: + raise InvalidProxyLine("protocol '%s' not supported" % proto) + + if proto == "TCP4": + try: + socket.inet_pton(socket.AF_INET, s_addr) + socket.inet_pton(socket.AF_INET, d_addr) + except OSError: + raise InvalidProxyLine(line) + elif proto == "TCP6": + try: + socket.inet_pton(socket.AF_INET6, s_addr) + socket.inet_pton(socket.AF_INET6, d_addr) + except OSError: + raise InvalidProxyLine(line) + + try: + s_port = int(bits[4]) + d_port = int(bits[5]) + except ValueError: + raise InvalidProxyLine("invalid port %s" % line) + + if not ((0 <= s_port <= 65535) and (0 <= d_port <= 65535)): + raise InvalidProxyLine("invalid port %s" % line) + + self.proxy_protocol_info = { + "proxy_protocol": proto, + "client_addr": s_addr, + "client_port": s_port, + "proxy_addr": d_addr, + "proxy_port": d_port + } + + def _parse_request_line(self, line_bytes): + """Parse the HTTP request line.""" + bits = [bytes_to_str(bit) for bit in line_bytes.split(b" ", 2)] + if len(bits) != 3: + raise InvalidRequestLine(bytes_to_str(line_bytes)) + + # Method + self.method = bits[0] + + if not self.cfg.permit_unconventional_http_method: + if METHOD_BADCHAR_RE.search(self.method): + raise InvalidRequestMethod(self.method) + if not 3 <= len(bits[0]) <= 20: + raise InvalidRequestMethod(self.method) + if not TOKEN_RE.fullmatch(self.method): + raise InvalidRequestMethod(self.method) + if self.cfg.casefold_http_method: + self.method = self.method.upper() + + # URI + self.uri = bits[1] + + if len(self.uri) == 0: + raise InvalidRequestLine(bytes_to_str(line_bytes)) + + try: + parts = split_request_uri(self.uri) + except ValueError: + raise InvalidRequestLine(bytes_to_str(line_bytes)) + self.path = parts.path or "" + self.query = parts.query or "" + self.fragment = parts.fragment or "" + + # Version + match = VERSION_RE.fullmatch(bits[2]) + if match is None: + raise InvalidHTTPVersion(bits[2]) + self.version = (int(match.group(1)), int(match.group(2))) + if not (1, 0) <= self.version < (2, 0): + if not self.cfg.permit_unconventional_http_version: + raise InvalidHTTPVersion(self.version) + + def _parse_headers(self, data, from_trailer=False): + """Parse HTTP headers from raw data.""" + cfg = self.cfg + headers = [] + + lines = [bytes_to_str(line) for line in data.split(b"\r\n")] + + # Handle scheme headers + scheme_header = False + secure_scheme_headers = {} + forwarder_headers = [] + if from_trailer: + pass + elif ('*' in cfg.forwarded_allow_ips or + not isinstance(self.peer_addr, tuple) + or self.peer_addr[0] in cfg.forwarded_allow_ips): + secure_scheme_headers = cfg.secure_scheme_headers + forwarder_headers = cfg.forwarder_headers + + while lines: + if len(headers) >= self.limit_request_fields: + raise LimitRequestHeaders("limit request headers fields") + + curr = lines.pop(0) + header_length = len(curr) + len("\r\n") + if curr.find(":") <= 0: + raise InvalidHeader(curr) + name, value = curr.split(":", 1) + if self.cfg.strip_header_spaces: + name = name.rstrip(" \t") + if not TOKEN_RE.fullmatch(name): + raise InvalidHeaderName(name) + + name = name.upper() + value = [value.strip(" \t")] + + # Consume value continuation lines + while lines and lines[0].startswith((" ", "\t")): + if not self.cfg.permit_obsolete_folding: + raise ObsoleteFolding(name) + curr = lines.pop(0) + header_length += len(curr) + len("\r\n") + if header_length > self.limit_request_field_size > 0: + raise LimitRequestHeaders("limit request headers fields size") + value.append(curr.strip("\t ")) + value = " ".join(value) + + if RFC9110_5_5_INVALID_AND_DANGEROUS.search(value): + raise InvalidHeader(name) + + if header_length > self.limit_request_field_size > 0: + raise LimitRequestHeaders("limit request headers fields size") + + if name in secure_scheme_headers: + secure = value == secure_scheme_headers[name] + scheme = "https" if secure else "http" + if scheme_header: + if scheme != self.scheme: + raise InvalidSchemeHeaders() + else: + scheme_header = True + self.scheme = scheme + + if "_" in name: + if name in forwarder_headers or "*" in forwarder_headers: + pass + elif self.cfg.header_map == "dangerous": + pass + elif self.cfg.header_map == "drop": + continue + else: + raise InvalidHeaderName(name) + + headers.append((name, value)) + + return headers + + def _set_body_reader(self): + """Determine how to read the request body.""" + chunked = False + content_length = None + + for (name, value) in self.headers: + if name == "CONTENT-LENGTH": + if content_length is not None: + raise InvalidHeader("CONTENT-LENGTH", req=self) + content_length = value + elif name == "TRANSFER-ENCODING": + vals = [v.strip() for v in value.split(',')] + for val in vals: + if val.lower() == "chunked": + if chunked: + raise InvalidHeader("TRANSFER-ENCODING", req=self) + chunked = True + elif val.lower() == "identity": + if chunked: + raise InvalidHeader("TRANSFER-ENCODING", req=self) + elif val.lower() in ('compress', 'deflate', 'gzip'): + if chunked: + raise InvalidHeader("TRANSFER-ENCODING", req=self) + self.force_close() + else: + raise UnsupportedTransferCoding(value) + + if chunked: + if self.version < (1, 1): + raise InvalidHeader("TRANSFER-ENCODING", req=self) + if content_length is not None: + raise InvalidHeader("CONTENT-LENGTH", req=self) + self.chunked = True + self.content_length = None + self._body_remaining = -1 + elif content_length is not None: + try: + if str(content_length).isnumeric(): + content_length = int(content_length) + else: + raise InvalidHeader("CONTENT-LENGTH", req=self) + except ValueError: + raise InvalidHeader("CONTENT-LENGTH", req=self) + + if content_length < 0: + raise InvalidHeader("CONTENT-LENGTH", req=self) + + self.content_length = content_length + self._body_remaining = content_length + else: + # No body for requests without Content-Length or Transfer-Encoding + self.content_length = 0 + self._body_remaining = 0 + + def force_close(self): + """Mark connection for closing after this request.""" + self.must_close = True + + def should_close(self): + """Check if connection should be closed after this request.""" + if self.must_close: + return True + for (h, v) in self.headers: + if h == "CONNECTION": + v = v.lower().strip(" \t") + if v == "close": + return True + elif v == "keep-alive": + return False + break + return self.version <= (1, 0) + + def get_header(self, name): + """Get a header value by name (case-insensitive).""" + name = name.upper() + for (h, v) in self.headers: + if h == name: + return v + return None + + async def read_body(self, size=8192): + """Read a chunk of the request body. + + Args: + size: Maximum bytes to read + + Returns: + bytes: Body data, empty bytes when body is exhausted + """ + if self._body_remaining == 0: + return b"" + + if self.chunked: + return await self._read_chunked_body(size) + else: + return await self._read_length_body(size) + + async def _read_length_body(self, size): + """Read from a length-delimited body.""" + if self._body_remaining <= 0: + return b"" + + to_read = min(size, self._body_remaining) + data = await self.unreader.read(to_read) + if data: + self._body_remaining -= len(data) + return data + + async def _read_chunked_body(self, size): + """Read from a chunked body.""" + if self._body_reader is None: + self._body_reader = self._chunked_body_reader() + + try: + return await self._body_reader.__anext__() + except StopAsyncIteration: + self._body_remaining = 0 + return b"" + + async def _chunked_body_reader(self): + """Async generator for reading chunked body.""" + while True: + # Read chunk size line + size_line = await self._read_chunk_size_line() + # Parse chunk size (handle extensions) + chunk_size, *_ = size_line.split(b";", 1) + if _ : + chunk_size = chunk_size.rstrip(b" \t") + + if any(n not in b"0123456789abcdefABCDEF" for n in chunk_size): + raise InvalidHeader("Invalid chunk size") + if len(chunk_size) == 0: + raise InvalidHeader("Invalid chunk size") + + chunk_size = int(chunk_size, 16) + + if chunk_size == 0: + # Final chunk - skip trailers and final CRLF + await self._skip_trailers() + return + + # Read chunk data + remaining = chunk_size + while remaining > 0: + data = await self.unreader.read(min(remaining, 8192)) + if not data: + raise NoMoreData() + remaining -= len(data) + yield data + + # Skip chunk terminating CRLF + crlf = await self.unreader.read(2) + if crlf != b"\r\n": + # May have partial read, try to get the rest + while len(crlf) < 2: + more = await self.unreader.read(2 - len(crlf)) + if not more: + break + crlf += more + if crlf != b"\r\n": + raise InvalidHeader("Missing chunk terminator") + + async def _read_chunk_size_line(self): + """Read a chunk size line.""" + buf = io.BytesIO() + while True: + data = await self.unreader.read(1) + if not data: + raise NoMoreData() + buf.write(data) + if buf.getvalue().endswith(b"\r\n"): + return buf.getvalue()[:-2] + + async def _skip_trailers(self): + """Skip trailer headers after chunked body.""" + buf = io.BytesIO() + while True: + data = await self.unreader.read(1) + if not data: + return + buf.write(data) + content = buf.getvalue() + if content.endswith(b"\r\n\r\n"): + # Could parse trailers here if needed + return + if content == b"\r\n": + return + + async def drain_body(self): + """Drain any unread body data. + + Should be called before reusing connection for keepalive. + """ + while True: + data = await self.read_body(8192) + if not data: + break diff --git a/gunicorn/asgi/protocol.py b/gunicorn/asgi/protocol.py new file mode 100644 index 000000000..cededd682 --- /dev/null +++ b/gunicorn/asgi/protocol.py @@ -0,0 +1,424 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +""" +ASGI protocol handler for gunicorn. + +Implements asyncio.Protocol to handle HTTP/1.x connections and dispatch +to ASGI applications. +""" + +import asyncio +import base64 +import hashlib +import traceback +from datetime import datetime + +from gunicorn.asgi.unreader import AsyncUnreader +from gunicorn.asgi.message import AsyncRequest +from gunicorn.http.errors import NoMoreData + + +class ASGIProtocol(asyncio.Protocol): + """HTTP/1.1 protocol handler for ASGI applications. + + Handles connection lifecycle, request parsing, and ASGI app invocation. + """ + + def __init__(self, worker): + self.worker = worker + self.cfg = worker.cfg + self.log = worker.log + self.app = worker.asgi + + self.transport = None + self.reader = None + self.writer = None + self._task = None + self.req_count = 0 + + # Connection state + self._closed = False + + def connection_made(self, transport): + """Called when a connection is established.""" + self.transport = transport + self.worker.nr_conns += 1 + + # Create stream reader/writer + self.reader = asyncio.StreamReader() + self.writer = transport + + # Start handling requests + self._task = self.worker.loop.create_task(self._handle_connection()) + + def data_received(self, data): + """Called when data is received on the connection.""" + if self.reader: + self.reader.feed_data(data) + + def connection_lost(self, exc): + """Called when the connection is lost or closed.""" + self._closed = True + self.worker.nr_conns -= 1 + if self.reader: + self.reader.feed_eof() + if self._task and not self._task.done(): + self._task.cancel() + + async def _handle_connection(self): + """Main request handling loop for this connection.""" + unreader = AsyncUnreader(self.reader) + + try: + peername = self.transport.get_extra_info('peername') + sockname = self.transport.get_extra_info('sockname') + + while not self._closed: + self.req_count += 1 + + try: + # Parse HTTP request + request = await AsyncRequest.parse( + self.cfg, + unreader, + peername, + self.req_count + ) + except StopIteration: + # No more data, close connection + break + except NoMoreData: + # Client disconnected + break + + # Check for WebSocket upgrade + if self._is_websocket_upgrade(request): + await self._handle_websocket(request, sockname, peername) + break # WebSocket takes over the connection + else: + # Handle HTTP request + keepalive = await self._handle_http_request( + request, sockname, peername + ) + + # Increment worker request count + self.worker.nr += 1 + + # Check max_requests + if self.worker.nr >= self.worker.max_requests: + self.log.info("Autorestarting worker after current request.") + self.worker.alive = False + keepalive = False + + if not keepalive or not self.worker.alive: + break + + # Check connection limits for keepalive + if not self.cfg.keepalive: + break + + # Drain any unread body before next request + await request.drain_body() + + except asyncio.CancelledError: + pass + except Exception as e: + self.log.exception("Error handling connection: %s", e) + finally: + self._close_transport() + + def _is_websocket_upgrade(self, request): + """Check if request is a WebSocket upgrade.""" + upgrade = None + connection = None + for name, value in request.headers: + if name == "UPGRADE": + upgrade = value.lower() + elif name == "CONNECTION": + connection = value.lower() + return upgrade == "websocket" and connection and "upgrade" in connection + + async def _handle_websocket(self, request, sockname, peername): + """Handle WebSocket upgrade request.""" + from gunicorn.asgi.websocket import WebSocketProtocol + + scope = self._build_websocket_scope(request, sockname, peername) + ws_protocol = WebSocketProtocol( + self.transport, self.reader, scope, self.app, self.log + ) + await ws_protocol.run() + + async def _handle_http_request(self, request, sockname, peername): + """Handle a single HTTP request.""" + scope = self._build_http_scope(request, sockname, peername) + response_started = False + response_complete = False + body_parts = [] + exc_to_raise = None + + # Receive queue for body + receive_queue = asyncio.Queue() + + # Pre-populate with initial body state + if request.content_length == 0 and not request.chunked: + await receive_queue.put({ + "type": "http.request", + "body": b"", + "more_body": False, + }) + else: + # Start body reading task + asyncio.create_task(self._read_body_to_queue(request, receive_queue)) + + async def receive(): + return await receive_queue.get() + + async def send(message): + nonlocal response_started, response_complete, exc_to_raise + + msg_type = message["type"] + + if msg_type == "http.response.start": + if response_started: + exc_to_raise = RuntimeError("Response already started") + return + response_started = True + status = message["status"] + headers = message.get("headers", []) + await self._send_response_start(status, headers, request) + + elif msg_type == "http.response.body": + if not response_started: + exc_to_raise = RuntimeError("Response not started") + return + if response_complete: + exc_to_raise = RuntimeError("Response already complete") + return + + body = message.get("body", b"") + more_body = message.get("more_body", False) + + if body: + await self._send_body(body) + + if not more_body: + response_complete = True + + try: + request_start = datetime.now() + self.cfg.pre_request(self.worker, request) + + await self.app(scope, receive, send) + + if exc_to_raise: + raise exc_to_raise + + # Ensure response was sent + if not response_started: + await self._send_error_response(500, "Internal Server Error") + + except Exception as e: + self.log.exception("Error in ASGI application") + if not response_started: + await self._send_error_response(500, "Internal Server Error") + return False + finally: + try: + request_time = datetime.now() - request_start + self.cfg.post_request(self.worker, request, {}, None) + except Exception: + self.log.exception("Exception in post_request hook") + + # Determine keepalive + if request.should_close(): + return False + + return self.worker.alive and self.cfg.keepalive + + async def _read_body_to_queue(self, request, queue): + """Read request body and put chunks on the queue.""" + try: + while True: + chunk = await request.read_body(65536) + if chunk: + await queue.put({ + "type": "http.request", + "body": chunk, + "more_body": True, + }) + else: + await queue.put({ + "type": "http.request", + "body": b"", + "more_body": False, + }) + break + except Exception as e: + self.log.debug("Error reading body: %s", e) + await queue.put({ + "type": "http.request", + "body": b"", + "more_body": False, + }) + + def _build_http_scope(self, request, sockname, peername): + """Build ASGI HTTP scope from parsed request.""" + # Build headers list as bytes tuples + headers = [] + for name, value in request.headers: + headers.append((name.lower().encode("latin-1"), value.encode("latin-1"))) + + scope = { + "type": "http", + "asgi": {"version": "3.0", "spec_version": "2.4"}, + "http_version": f"{request.version[0]}.{request.version[1]}", + "method": request.method, + "scheme": request.scheme, + "path": request.path, + "raw_path": request.path.encode("latin-1") if request.path else b"", + "query_string": request.query.encode("latin-1") if request.query else b"", + "root_path": self.cfg.root_path or "", + "headers": headers, + "server": sockname if sockname else None, + "client": peername if peername else None, + } + + # Add state dict for lifespan sharing + if hasattr(self.worker, 'state'): + scope["state"] = self.worker.state + + return scope + + def _build_websocket_scope(self, request, sockname, peername): + """Build ASGI WebSocket scope from parsed request.""" + # Build headers list as bytes tuples + headers = [] + for name, value in request.headers: + headers.append((name.lower().encode("latin-1"), value.encode("latin-1"))) + + # Extract subprotocols from Sec-WebSocket-Protocol header + subprotocols = [] + for name, value in request.headers: + if name == "SEC-WEBSOCKET-PROTOCOL": + subprotocols = [s.strip() for s in value.split(",")] + break + + scope = { + "type": "websocket", + "asgi": {"version": "3.0", "spec_version": "2.4"}, + "http_version": f"{request.version[0]}.{request.version[1]}", + "scheme": "wss" if request.scheme == "https" else "ws", + "path": request.path, + "raw_path": request.path.encode("latin-1") if request.path else b"", + "query_string": request.query.encode("latin-1") if request.query else b"", + "root_path": self.cfg.root_path or "", + "headers": headers, + "server": sockname if sockname else None, + "client": peername if peername else None, + "subprotocols": subprotocols, + } + + # Add state dict for lifespan sharing + if hasattr(self.worker, 'state'): + scope["state"] = self.worker.state + + return scope + + async def _send_response_start(self, status, headers, request): + """Send HTTP response status and headers.""" + # Build status line + reason = self._get_reason_phrase(status) + status_line = f"HTTP/{request.version[0]}.{request.version[1]} {status} {reason}\r\n" + + # Build headers + header_lines = [] + has_content_length = False + has_transfer_encoding = False + has_connection = False + + for name, value in headers: + if isinstance(name, bytes): + name = name.decode("latin-1") + if isinstance(value, bytes): + value = value.decode("latin-1") + header_lines.append(f"{name}: {value}\r\n") + name_lower = name.lower() + if name_lower == "content-length": + has_content_length = True + elif name_lower == "transfer-encoding": + has_transfer_encoding = True + elif name_lower == "connection": + has_connection = True + + # Add server header if not present + header_lines.append("Server: gunicorn/asgi\r\n") + + response = status_line + "".join(header_lines) + "\r\n" + self.transport.write(response.encode("latin-1")) + + async def _send_body(self, body): + """Send response body chunk.""" + if body: + self.transport.write(body) + + async def _send_error_response(self, status, message): + """Send an error response.""" + body = message.encode("utf-8") + response = ( + f"HTTP/1.1 {status} {message}\r\n" + f"Content-Type: text/plain\r\n" + f"Content-Length: {len(body)}\r\n" + f"Connection: close\r\n" + f"\r\n" + ) + self.transport.write(response.encode("latin-1")) + self.transport.write(body) + + def _get_reason_phrase(self, status): + """Get HTTP reason phrase for status code.""" + reasons = { + 100: "Continue", + 101: "Switching Protocols", + 200: "OK", + 201: "Created", + 202: "Accepted", + 204: "No Content", + 206: "Partial Content", + 301: "Moved Permanently", + 302: "Found", + 303: "See Other", + 304: "Not Modified", + 307: "Temporary Redirect", + 308: "Permanent Redirect", + 400: "Bad Request", + 401: "Unauthorized", + 403: "Forbidden", + 404: "Not Found", + 405: "Method Not Allowed", + 408: "Request Timeout", + 409: "Conflict", + 410: "Gone", + 411: "Length Required", + 413: "Payload Too Large", + 414: "URI Too Long", + 415: "Unsupported Media Type", + 422: "Unprocessable Entity", + 429: "Too Many Requests", + 500: "Internal Server Error", + 501: "Not Implemented", + 502: "Bad Gateway", + 503: "Service Unavailable", + 504: "Gateway Timeout", + } + return reasons.get(status, "Unknown") + + def _close_transport(self): + """Close the transport safely.""" + if self.transport and not self._closed: + try: + self.transport.close() + except Exception: + pass + self._closed = True diff --git a/gunicorn/asgi/unreader.py b/gunicorn/asgi/unreader.py new file mode 100644 index 000000000..c8d9aa821 --- /dev/null +++ b/gunicorn/asgi/unreader.py @@ -0,0 +1,100 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +""" +Async version of gunicorn/http/unreader.py for ASGI workers. + +Provides async reading with pushback buffer support. +""" + +import io + + +class AsyncUnreader: + """Async socket reader with pushback buffer support. + + This class wraps an asyncio StreamReader and provides the ability + to "unread" data back into a buffer for re-parsing. + """ + + def __init__(self, reader, max_chunk=8192): + """Initialize the async unreader. + + Args: + reader: asyncio.StreamReader instance + max_chunk: Maximum bytes to read at once + """ + self.reader = reader + self.buf = io.BytesIO() + self.max_chunk = max_chunk + + async def read(self, size=None): + """Read data from the stream, using buffered data first. + + Args: + size: Number of bytes to read. If None, returns all buffered + data or reads a single chunk. + + Returns: + bytes: Data read from buffer or stream + """ + if size is not None and not isinstance(size, int): + raise TypeError("size parameter must be an int or long.") + + if size is not None: + if size == 0: + return b"" + if size < 0: + size = None + + # Move to end to check buffer size + self.buf.seek(0, io.SEEK_END) + + # If no size specified, return buffered data or read chunk + if size is None and self.buf.tell(): + ret = self.buf.getvalue() + self.buf = io.BytesIO() + return ret + if size is None: + chunk = await self._read_chunk() + return chunk + + # Read until we have enough data + while self.buf.tell() < size: + chunk = await self._read_chunk() + if not chunk: + ret = self.buf.getvalue() + self.buf = io.BytesIO() + return ret + self.buf.write(chunk) + + data = self.buf.getvalue() + self.buf = io.BytesIO() + self.buf.write(data[size:]) + return data[:size] + + async def _read_chunk(self): + """Read a chunk of data from the underlying stream.""" + try: + return await self.reader.read(self.max_chunk) + except Exception: + return b"" + + def unread(self, data): + """Push data back into the buffer for re-reading. + + Args: + data: bytes to push back + """ + if data: + self.buf.seek(0, io.SEEK_END) + self.buf.write(data) + + def has_buffered_data(self): + """Check if there's data in the pushback buffer.""" + pos = self.buf.tell() + self.buf.seek(0, io.SEEK_END) + has_data = self.buf.tell() > 0 + self.buf.seek(pos) + return has_data diff --git a/gunicorn/asgi/websocket.py b/gunicorn/asgi/websocket.py new file mode 100644 index 000000000..bcde84eeb --- /dev/null +++ b/gunicorn/asgi/websocket.py @@ -0,0 +1,369 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +""" +WebSocket protocol handler for ASGI. + +Implements RFC 6455 WebSocket protocol for ASGI applications. +""" + +import asyncio +import base64 +import hashlib +import struct +import os + + +# WebSocket frame opcodes +OPCODE_CONTINUATION = 0x0 +OPCODE_TEXT = 0x1 +OPCODE_BINARY = 0x2 +OPCODE_CLOSE = 0x8 +OPCODE_PING = 0x9 +OPCODE_PONG = 0xA + +# WebSocket close codes +CLOSE_NORMAL = 1000 +CLOSE_GOING_AWAY = 1001 +CLOSE_PROTOCOL_ERROR = 1002 +CLOSE_UNSUPPORTED = 1003 +CLOSE_NO_STATUS = 1005 +CLOSE_ABNORMAL = 1006 +CLOSE_INVALID_DATA = 1007 +CLOSE_POLICY_VIOLATION = 1008 +CLOSE_MESSAGE_TOO_BIG = 1009 +CLOSE_MANDATORY_EXT = 1010 +CLOSE_INTERNAL_ERROR = 1011 + +# WebSocket handshake GUID (RFC 6455) +WS_GUID = b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11" + + +class WebSocketProtocol: + """WebSocket connection handler for ASGI applications.""" + + def __init__(self, transport, reader, scope, app, log): + """Initialize WebSocket protocol handler. + + Args: + transport: asyncio transport for writing + reader: asyncio StreamReader for reading + scope: ASGI WebSocket scope dict + app: ASGI application callable + log: Logger instance + """ + self.transport = transport + self.reader = reader + self.scope = scope + self.app = app + self.log = log + + self.accepted = False + self.closed = False + self.close_code = None + self.close_reason = "" + + # Message reassembly state + self._fragments = [] + self._fragment_opcode = None + + # Receive queue for incoming messages + self._receive_queue = asyncio.Queue() + + async def run(self): + """Run the WebSocket ASGI application.""" + # Send initial connect event + await self._receive_queue.put({"type": "websocket.connect"}) + + # Start frame reading task + read_task = asyncio.create_task(self._read_frames()) + + try: + await self.app(self.scope, self._receive, self._send) + except Exception as e: + self.log.exception("Error in WebSocket ASGI application") + finally: + read_task.cancel() + try: + await read_task + except asyncio.CancelledError: + pass + + # Send close frame if not already closed + if not self.closed and self.accepted: + await self._send_close(CLOSE_INTERNAL_ERROR, "Application error") + + async def _receive(self): + """ASGI receive callable.""" + return await self._receive_queue.get() + + async def _send(self, message): + """ASGI send callable.""" + msg_type = message["type"] + + if msg_type == "websocket.accept": + if self.accepted: + raise RuntimeError("WebSocket already accepted") + await self._send_accept(message) + self.accepted = True + + elif msg_type == "websocket.send": + if not self.accepted: + raise RuntimeError("WebSocket not accepted") + if self.closed: + raise RuntimeError("WebSocket closed") + + if "text" in message: + await self._send_frame(OPCODE_TEXT, message["text"].encode("utf-8")) + elif "bytes" in message: + await self._send_frame(OPCODE_BINARY, message["bytes"]) + + elif msg_type == "websocket.close": + code = message.get("code", CLOSE_NORMAL) + reason = message.get("reason", "") + await self._send_close(code, reason) + self.closed = True + + async def _send_accept(self, message): + """Send WebSocket handshake accept response.""" + # Get Sec-WebSocket-Key from headers + ws_key = None + for name, value in self.scope["headers"]: + if name == b"sec-websocket-key": + ws_key = value + break + + if not ws_key: + raise RuntimeError("Missing Sec-WebSocket-Key header") + + # Calculate accept key + accept_key = base64.b64encode( + hashlib.sha1(ws_key + WS_GUID).digest() + ).decode("ascii") + + # Build response headers + headers = [ + "HTTP/1.1 101 Switching Protocols\r\n", + "Upgrade: websocket\r\n", + "Connection: Upgrade\r\n", + f"Sec-WebSocket-Accept: {accept_key}\r\n", + ] + + # Add selected subprotocol if specified + subprotocol = message.get("subprotocol") + if subprotocol: + headers.append(f"Sec-WebSocket-Protocol: {subprotocol}\r\n") + + # Add any extra headers from message + extra_headers = message.get("headers", []) + for name, value in extra_headers: + if isinstance(name, bytes): + name = name.decode("latin-1") + if isinstance(value, bytes): + value = value.decode("latin-1") + headers.append(f"{name}: {value}\r\n") + + headers.append("\r\n") + self.transport.write("".join(headers).encode("latin-1")) + + async def _read_frames(self): + """Read and process incoming WebSocket frames.""" + try: + while not self.closed: + frame = await self._read_frame() + if frame is None: + break + + opcode, payload = frame + + if opcode == OPCODE_CLOSE: + await self._handle_close(payload) + break + elif opcode == OPCODE_PING: + await self._send_frame(OPCODE_PONG, payload) + elif opcode == OPCODE_PONG: + # Ignore pongs + pass + elif opcode == OPCODE_TEXT: + await self._receive_queue.put({ + "type": "websocket.receive", + "text": payload.decode("utf-8"), + }) + elif opcode == OPCODE_BINARY: + await self._receive_queue.put({ + "type": "websocket.receive", + "bytes": payload, + }) + elif opcode == OPCODE_CONTINUATION: + # Handle fragmented messages + await self._handle_continuation(payload) + + except asyncio.CancelledError: + raise + except Exception as e: + self.log.debug("WebSocket read error: %s", e) + finally: + # Signal disconnect + if not self.closed: + self.closed = True + await self._receive_queue.put({ + "type": "websocket.disconnect", + "code": self.close_code or CLOSE_ABNORMAL, + }) + + async def _read_frame(self): + """Read a single WebSocket frame. + + Returns: + tuple: (opcode, payload) or None if connection closed + """ + # Read frame header (2 bytes minimum) + header = await self._read_exact(2) + if not header: + return None + + first_byte, second_byte = header[0], header[1] + + fin = (first_byte >> 7) & 1 + rsv1 = (first_byte >> 6) & 1 + rsv2 = (first_byte >> 5) & 1 + rsv3 = (first_byte >> 4) & 1 + opcode = first_byte & 0x0F + + # RSV bits must be 0 (no extensions) + if rsv1 or rsv2 or rsv3: + await self._send_close(CLOSE_PROTOCOL_ERROR, "RSV bits set") + return None + + masked = (second_byte >> 7) & 1 + payload_len = second_byte & 0x7F + + # Client frames must be masked (RFC 6455) + if not masked: + await self._send_close(CLOSE_PROTOCOL_ERROR, "Frame not masked") + return None + + # Extended payload length + if payload_len == 126: + ext_len = await self._read_exact(2) + if not ext_len: + return None + payload_len = struct.unpack("!H", ext_len)[0] + elif payload_len == 127: + ext_len = await self._read_exact(8) + if not ext_len: + return None + payload_len = struct.unpack("!Q", ext_len)[0] + + # Read masking key + masking_key = await self._read_exact(4) + if not masking_key: + return None + + # Read payload + payload = await self._read_exact(payload_len) + if payload is None: + return None + + # Unmask payload + payload = self._unmask(payload, masking_key) + + # Handle fragmented messages + if opcode == OPCODE_CONTINUATION: + if self._fragment_opcode is None: + await self._send_close(CLOSE_PROTOCOL_ERROR, "Unexpected continuation") + return None + self._fragments.append(payload) + if fin: + # Reassemble complete message + full_payload = b"".join(self._fragments) + final_opcode = self._fragment_opcode + self._fragments = [] + self._fragment_opcode = None + return (final_opcode, full_payload) + return (OPCODE_CONTINUATION, b"") # Fragment received, wait for more + elif opcode in (OPCODE_TEXT, OPCODE_BINARY): + if not fin: + # Start of fragmented message + self._fragment_opcode = opcode + self._fragments = [payload] + return (OPCODE_CONTINUATION, b"") # Fragment started, wait for more + return (opcode, payload) + else: + # Control frames + return (opcode, payload) + + async def _read_exact(self, n): + """Read exactly n bytes from the reader.""" + try: + data = await self.reader.readexactly(n) + return data + except asyncio.IncompleteReadError: + return None + except Exception: + return None + + def _unmask(self, payload, masking_key): + """Unmask WebSocket payload data.""" + if not payload: + return payload + # XOR each byte with corresponding mask byte + return bytes(b ^ masking_key[i % 4] for i, b in enumerate(payload)) + + async def _handle_close(self, payload): + """Handle incoming close frame.""" + if len(payload) >= 2: + self.close_code = struct.unpack("!H", payload[:2])[0] + self.close_reason = payload[2:].decode("utf-8", errors="replace") + else: + self.close_code = CLOSE_NO_STATUS + self.close_reason = "" + + # Echo close frame back if we haven't already sent one + if not self.closed: + await self._send_close(self.close_code, self.close_reason) + + self.closed = True + + async def _handle_continuation(self, payload): + """Handle continuation frame (already processed in _read_frame).""" + # This is called for partial fragments, nothing to do + pass + + async def _send_frame(self, opcode, payload): + """Send a WebSocket frame. + + Server frames are not masked (RFC 6455). + """ + if isinstance(payload, str): + payload = payload.encode("utf-8") + + length = len(payload) + frame = bytearray() + + # First byte: FIN + opcode + frame.append(0x80 | opcode) + + # Second byte: length (no mask bit for server) + if length < 126: + frame.append(length) + elif length < 65536: + frame.append(126) + frame.extend(struct.pack("!H", length)) + else: + frame.append(127) + frame.extend(struct.pack("!Q", length)) + + # Payload + frame.extend(payload) + + self.transport.write(bytes(frame)) + + async def _send_close(self, code, reason=""): + """Send a close frame.""" + payload = struct.pack("!H", code) + if reason: + payload += reason.encode("utf-8")[:123] # Max 125 bytes total + await self._send_frame(OPCODE_CLOSE, payload) + self.closed = True diff --git a/gunicorn/config.py b/gunicorn/config.py index 29b30ad23..522dcae93 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -2440,3 +2440,94 @@ class HeaderMap(Setting): .. versionadded:: 22.0.0 """ + + +def validate_asgi_loop(val): + if val is None: + return "auto" + if not isinstance(val, str): + raise TypeError("Invalid type for casting: %s" % val) + val = val.lower().strip() + if val not in ("auto", "asyncio", "uvloop"): + raise ValueError("Invalid ASGI loop: %s" % val) + return val + + +def validate_asgi_lifespan(val): + if val is None: + return "auto" + if not isinstance(val, str): + raise TypeError("Invalid type for casting: %s" % val) + val = val.lower().strip() + if val not in ("auto", "on", "off"): + raise ValueError("Invalid ASGI lifespan: %s" % val) + return val + + +class ASGILoop(Setting): + name = "asgi_loop" + section = "Worker Processes" + cli = ["--asgi-loop"] + meta = "STRING" + validator = validate_asgi_loop + default = "auto" + desc = """\ + Event loop implementation for ASGI workers. + + - auto: Use uvloop if available, otherwise asyncio + - asyncio: Use Python's built-in asyncio event loop + - uvloop: Use uvloop (must be installed separately) + + This setting only affects the ``asgi`` worker type. + + uvloop typically provides better performance but requires + installing the uvloop package. + + .. versionadded:: 24.0.0 + """ + + +class ASGILifespan(Setting): + name = "asgi_lifespan" + section = "Worker Processes" + cli = ["--asgi-lifespan"] + meta = "STRING" + validator = validate_asgi_lifespan + default = "auto" + desc = """\ + Control ASGI lifespan protocol handling. + + - auto: Detect if app supports lifespan, enable if so + - on: Always run lifespan protocol (fail if unsupported) + - off: Never run lifespan protocol + + The lifespan protocol allows ASGI applications to run code at + startup and shutdown. This is essential for frameworks like + FastAPI that need to initialize database connections, caches, + or other resources. + + This setting only affects the ``asgi`` worker type. + + .. versionadded:: 24.0.0 + """ + + +class RootPath(Setting): + name = "root_path" + section = "Server Mechanics" + cli = ["--root-path"] + meta = "STRING" + validator = validate_string + default = "" + desc = """\ + The root path for ASGI applications. + + This is used to set the ``root_path`` in the ASGI scope, which + allows applications to know their mount point when behind a + reverse proxy. + + For example, if your application is mounted at ``/api``, set + this to ``/api``. + + .. versionadded:: 24.0.0 + """ diff --git a/gunicorn/workers/__init__.py b/gunicorn/workers/__init__.py index 3da5f85e8..3beb0d70f 100644 --- a/gunicorn/workers/__init__.py +++ b/gunicorn/workers/__init__.py @@ -11,4 +11,5 @@ "gevent_pywsgi": "gunicorn.workers.ggevent.GeventPyWSGIWorker", "tornado": "gunicorn.workers.gtornado.TornadoWorker", "gthread": "gunicorn.workers.gthread.ThreadWorker", + "asgi": "gunicorn.workers.gasgi.ASGIWorker", } diff --git a/gunicorn/workers/gasgi.py b/gunicorn/workers/gasgi.py new file mode 100644 index 000000000..b0d57cf01 --- /dev/null +++ b/gunicorn/workers/gasgi.py @@ -0,0 +1,282 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +""" +ASGI worker for gunicorn. + +Provides native asyncio-based ASGI support using gunicorn's own +HTTP parsing infrastructure. +""" + +import asyncio +import os +import signal +import ssl +import sys + +from gunicorn.workers import base +from gunicorn.asgi.protocol import ASGIProtocol + + +class ASGIWorker(base.Worker): + """ASGI worker using asyncio event loop. + + Supports: + - HTTP/1.1 with keepalive + - WebSocket connections + - Lifespan protocol (startup/shutdown hooks) + - Optional uvloop for improved performance + """ + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.worker_connections = self.cfg.worker_connections + self.loop = None + self.servers = [] + self.nr_conns = 0 + self.lifespan = None + self.state = {} # Shared state for lifespan + + @classmethod + def check_config(cls, cfg, log): + """Validate configuration for ASGI worker.""" + if cfg.threads > 1: + log.warning("ASGI worker does not use threads configuration. " + "Use worker_connections instead.") + + def init_process(self): + """Initialize the worker process.""" + # Setup event loop before calling super() + self._setup_event_loop() + super().init_process() + + def _setup_event_loop(self): + """Setup the asyncio event loop.""" + loop_type = getattr(self.cfg, 'asgi_loop', 'auto') + + if loop_type == "auto": + try: + import uvloop + loop_type = "uvloop" + except ImportError: + loop_type = "asyncio" + + if loop_type == "uvloop": + try: + import uvloop + self.loop = uvloop.new_event_loop() + self.log.debug("Using uvloop event loop") + except ImportError: + self.log.warning("uvloop not available, falling back to asyncio") + self.loop = asyncio.new_event_loop() + else: + self.loop = asyncio.new_event_loop() + self.log.debug("Using asyncio event loop") + + asyncio.set_event_loop(self.loop) + + def load_wsgi(self): + """Load the ASGI application.""" + try: + self.asgi = self.app.wsgi() + except SyntaxError as e: + if not self.cfg.reload: + raise + self.log.exception(e) + self.asgi = self._make_error_app(str(e)) + + def _make_error_app(self, error_msg): + """Create an error ASGI app for syntax errors during reload.""" + async def error_app(scope, receive, send): + if scope["type"] == "http": + await send({ + "type": "http.response.start", + "status": 500, + "headers": [(b"content-type", b"text/plain")], + }) + await send({ + "type": "http.response.body", + "body": f"Application error: {error_msg}".encode(), + }) + elif scope["type"] == "lifespan": + message = await receive() + if message["type"] == "lifespan.startup": + await send({"type": "lifespan.startup.complete"}) + message = await receive() + if message["type"] == "lifespan.shutdown": + await send({"type": "lifespan.shutdown.complete"}) + return error_app + + def init_signals(self): + """Initialize signal handlers for asyncio.""" + # Reset all signals first + for s in self.SIGNALS: + signal.signal(s, signal.SIG_DFL) + + # Set up signal handlers via the event loop + self.loop.add_signal_handler(signal.SIGQUIT, self.handle_quit_signal) + self.loop.add_signal_handler(signal.SIGTERM, self.handle_exit_signal) + self.loop.add_signal_handler(signal.SIGINT, self.handle_quit_signal) + self.loop.add_signal_handler(signal.SIGUSR1, self.handle_usr1_signal) + self.loop.add_signal_handler(signal.SIGWINCH, self.handle_winch_signal) + self.loop.add_signal_handler(signal.SIGABRT, self.handle_abort_signal) + + def handle_quit_signal(self): + """Handle SIGQUIT - immediate shutdown.""" + self.alive = False + self.cfg.worker_int(self) + + def handle_exit_signal(self): + """Handle SIGTERM - graceful shutdown.""" + self.alive = False + + def handle_usr1_signal(self): + """Handle SIGUSR1 - reopen log files.""" + self.log.reopen_files() + + def handle_winch_signal(self): + """Handle SIGWINCH - ignored in worker.""" + self.log.debug("worker: SIGWINCH ignored.") + + def handle_abort_signal(self): + """Handle SIGABRT - abort.""" + self.alive = False + self.cfg.worker_abort(self) + sys.exit(1) + + def run(self): + """Main entry point for the worker.""" + try: + self.loop.run_until_complete(self._serve()) + except Exception as e: + self.log.exception("Worker exception: %s", e) + finally: + self._cleanup() + + async def _serve(self): + """Main async serving loop.""" + # Run lifespan startup + lifespan_mode = getattr(self.cfg, 'asgi_lifespan', 'auto') + if lifespan_mode != "off": + from gunicorn.asgi.lifespan import LifespanManager + self.lifespan = LifespanManager(self.asgi, self.log, self.state) + try: + await self.lifespan.startup() + except Exception as e: + if lifespan_mode == "on": + self.log.error("ASGI lifespan startup failed: %s", e) + return + else: + # auto mode - app doesn't support lifespan + self.log.debug("ASGI lifespan not supported by app: %s", e) + self.lifespan = None + + # Create servers for each listener socket + ssl_context = self._get_ssl_context() + + for sock in self.sockets: + try: + server = await self.loop.create_server( + lambda: ASGIProtocol(self), + sock=sock.sock, + ssl=ssl_context, + reuse_address=True, + start_serving=True, + ) + self.servers.append(server) + self.log.info("ASGI server listening on %s", sock) + except Exception as e: + self.log.error("Failed to create server on %s: %s", sock, e) + + if not self.servers: + self.log.error("No servers could be started") + return + + # Main loop with heartbeat + try: + while self.alive: + self.notify() + + # Check if parent is still alive + if self.ppid != os.getppid(): + self.log.info("Parent changed, shutting down: %s", self) + break + + # Check connection limit + # (Connections are managed by nr_conns in ASGIProtocol) + + await asyncio.sleep(1.0) + + except asyncio.CancelledError: + pass + + # Graceful shutdown + await self._shutdown() + + async def _shutdown(self): + """Perform graceful shutdown.""" + self.log.info("Worker shutting down...") + + # Stop accepting new connections + for server in self.servers: + server.close() + + # Wait for servers to close + for server in self.servers: + await server.wait_closed() + + # Wait for in-flight connections (with timeout) + graceful_timeout = self.cfg.graceful_timeout + if self.nr_conns > 0: + self.log.info("Waiting for %d connections to finish...", self.nr_conns) + deadline = self.loop.time() + graceful_timeout + while self.nr_conns > 0 and self.loop.time() < deadline: + await asyncio.sleep(0.1) + + if self.nr_conns > 0: + self.log.warning("Closing %d connections after timeout", self.nr_conns) + + # Run lifespan shutdown + if self.lifespan: + try: + await self.lifespan.shutdown() + except Exception as e: + self.log.error("ASGI lifespan shutdown error: %s", e) + + def _get_ssl_context(self): + """Get SSL context if configured.""" + if not self.cfg.is_ssl: + return None + + try: + from gunicorn import sock + return sock.ssl_context(self.cfg) + except Exception as e: + self.log.error("Failed to create SSL context: %s", e) + return None + + def _cleanup(self): + """Clean up resources on exit.""" + try: + # Cancel all pending tasks + pending = asyncio.all_tasks(self.loop) + for task in pending: + task.cancel() + + # Run loop until all tasks are cancelled + if pending: + self.loop.run_until_complete( + asyncio.gather(*pending, return_exceptions=True) + ) + + self.loop.close() + except Exception as e: + self.log.debug("Cleanup error: %s", e) + + # Close sockets + for s in self.sockets: + try: + s.close() + except Exception: + pass diff --git a/pyproject.toml b/pyproject.toml index ce681f65a..7803dc55f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,6 +58,7 @@ testing = [ "coverage", "pytest", "pytest-cov", + "pytest-asyncio", ] [project.scripts] diff --git a/tests/test_asgi.py b/tests/test_asgi.py new file mode 100644 index 000000000..227f7ea2c --- /dev/null +++ b/tests/test_asgi.py @@ -0,0 +1,285 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +""" +Tests for ASGI worker components. +""" + +import asyncio +import io +import pytest +from unittest import mock + +from gunicorn.asgi.unreader import AsyncUnreader +from gunicorn.asgi.message import AsyncRequest + + +class MockStreamReader: + """Mock asyncio.StreamReader for testing.""" + + def __init__(self, data): + self.data = data + self.pos = 0 + + async def read(self, size=-1): + if self.pos >= len(self.data): + return b"" + if size < 0: + result = self.data[self.pos:] + self.pos = len(self.data) + else: + result = self.data[self.pos:self.pos + size] + self.pos += size + return result + + async def readexactly(self, n): + if self.pos + n > len(self.data): + raise asyncio.IncompleteReadError( + self.data[self.pos:], n + ) + result = self.data[self.pos:self.pos + n] + self.pos += n + return result + + +class MockConfig: + """Mock gunicorn config for testing.""" + + def __init__(self): + self.is_ssl = False + self.proxy_protocol = False + self.proxy_allow_ips = ["127.0.0.1"] + self.forwarded_allow_ips = ["127.0.0.1"] + self.secure_scheme_headers = {} + self.forwarder_headers = [] + self.limit_request_line = 8190 + self.limit_request_fields = 100 + self.limit_request_field_size = 8190 + self.permit_unconventional_http_method = False + self.permit_unconventional_http_version = False + self.permit_obsolete_folding = False + self.casefold_http_method = False + self.strip_header_spaces = False + self.header_map = "refuse" + + +# AsyncUnreader Tests + +@pytest.mark.asyncio +async def test_async_unreader_read_chunk(): + """Test basic chunk reading.""" + reader = MockStreamReader(b"hello world") + unreader = AsyncUnreader(reader) + data = await unreader.read() + assert data == b"hello world" + + +@pytest.mark.asyncio +async def test_async_unreader_read_size(): + """Test reading specific size.""" + reader = MockStreamReader(b"hello world") + unreader = AsyncUnreader(reader) + data = await unreader.read(5) + assert data == b"hello" + + +@pytest.mark.asyncio +async def test_async_unreader_unread(): + """Test unread functionality.""" + reader = MockStreamReader(b"hello world") + unreader = AsyncUnreader(reader) + + # Read all data + data = await unreader.read() + assert data == b"hello world" + + # Unread some data + unreader.unread(b"world") + + # Read again should get unread data + data = await unreader.read() + assert data == b"world" + + +@pytest.mark.asyncio +async def test_async_unreader_read_zero(): + """Test reading zero bytes.""" + reader = MockStreamReader(b"hello") + unreader = AsyncUnreader(reader) + data = await unreader.read(0) + assert data == b"" + + +@pytest.mark.asyncio +async def test_async_unreader_read_empty(): + """Test reading from empty stream.""" + reader = MockStreamReader(b"") + unreader = AsyncUnreader(reader) + data = await unreader.read() + assert data == b"" + + +# AsyncRequest Tests + +@pytest.mark.asyncio +async def test_async_request_simple_get(): + """Test parsing a simple GET request.""" + request_data = b"GET /path HTTP/1.1\r\nHost: localhost\r\n\r\n" + reader = MockStreamReader(request_data) + unreader = AsyncUnreader(reader) + cfg = MockConfig() + + request = await AsyncRequest.parse(cfg, unreader, ("127.0.0.1", 8000)) + + assert request.method == "GET" + assert request.path == "/path" + assert request.version == (1, 1) + assert ("HOST", "localhost") in request.headers + + +@pytest.mark.asyncio +async def test_async_request_with_query(): + """Test parsing request with query string.""" + request_data = b"GET /search?q=test&page=1 HTTP/1.1\r\nHost: localhost\r\n\r\n" + reader = MockStreamReader(request_data) + unreader = AsyncUnreader(reader) + cfg = MockConfig() + + request = await AsyncRequest.parse(cfg, unreader, ("127.0.0.1", 8000)) + + assert request.method == "GET" + assert request.path == "/search" + assert request.query == "q=test&page=1" + + +@pytest.mark.asyncio +async def test_async_request_post_with_body(): + """Test parsing POST request with body.""" + request_data = ( + b"POST /submit HTTP/1.1\r\n" + b"Host: localhost\r\n" + b"Content-Length: 11\r\n" + b"\r\n" + b"hello=world" + ) + reader = MockStreamReader(request_data) + unreader = AsyncUnreader(reader) + cfg = MockConfig() + + request = await AsyncRequest.parse(cfg, unreader, ("127.0.0.1", 8000)) + + assert request.method == "POST" + assert request.path == "/submit" + assert request.content_length == 11 + + # Read body + body = await request.read_body(100) + assert body == b"hello=world" + + +@pytest.mark.asyncio +async def test_async_request_multiple_headers(): + """Test parsing request with multiple headers.""" + request_data = ( + b"GET / HTTP/1.1\r\n" + b"Host: localhost\r\n" + b"Accept: text/html\r\n" + b"Accept-Language: en-US\r\n" + b"Connection: keep-alive\r\n" + b"\r\n" + ) + reader = MockStreamReader(request_data) + unreader = AsyncUnreader(reader) + cfg = MockConfig() + + request = await AsyncRequest.parse(cfg, unreader, ("127.0.0.1", 8000)) + + assert len(request.headers) == 4 + assert request.get_header("HOST") == "localhost" + assert request.get_header("ACCEPT") == "text/html" + + +@pytest.mark.asyncio +async def test_async_request_should_close_http10(): + """Test connection close detection for HTTP/1.0.""" + request_data = b"GET / HTTP/1.0\r\nHost: localhost\r\n\r\n" + reader = MockStreamReader(request_data) + unreader = AsyncUnreader(reader) + cfg = MockConfig() + + request = await AsyncRequest.parse(cfg, unreader, ("127.0.0.1", 8000)) + + assert request.version == (1, 0) + assert request.should_close() is True + + +@pytest.mark.asyncio +async def test_async_request_should_close_connection_header(): + """Test connection close detection with Connection header.""" + request_data = b"GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n" + reader = MockStreamReader(request_data) + unreader = AsyncUnreader(reader) + cfg = MockConfig() + + request = await AsyncRequest.parse(cfg, unreader, ("127.0.0.1", 8000)) + + assert request.should_close() is True + + +@pytest.mark.asyncio +async def test_async_request_keepalive(): + """Test keepalive detection.""" + request_data = b"GET / HTTP/1.1\r\nHost: localhost\r\nConnection: keep-alive\r\n\r\n" + reader = MockStreamReader(request_data) + unreader = AsyncUnreader(reader) + cfg = MockConfig() + + request = await AsyncRequest.parse(cfg, unreader, ("127.0.0.1", 8000)) + + assert request.should_close() is False + + +@pytest.mark.asyncio +async def test_async_request_no_body_for_get(): + """Test that GET requests have no body by default.""" + request_data = b"GET / HTTP/1.1\r\nHost: localhost\r\n\r\n" + reader = MockStreamReader(request_data) + unreader = AsyncUnreader(reader) + cfg = MockConfig() + + request = await AsyncRequest.parse(cfg, unreader, ("127.0.0.1", 8000)) + + assert request.content_length == 0 + body = await request.read_body() + assert body == b"" + + +# Error handling tests + +@pytest.mark.asyncio +async def test_async_request_invalid_method(): + """Test invalid HTTP method detection.""" + from gunicorn.http.errors import InvalidRequestMethod + + request_data = b"ge!t / HTTP/1.1\r\nHost: localhost\r\n\r\n" + reader = MockStreamReader(request_data) + unreader = AsyncUnreader(reader) + cfg = MockConfig() + + with pytest.raises(InvalidRequestMethod): + await AsyncRequest.parse(cfg, unreader, ("127.0.0.1", 8000)) + + +@pytest.mark.asyncio +async def test_async_request_invalid_http_version(): + """Test invalid HTTP version detection.""" + from gunicorn.http.errors import InvalidHTTPVersion + + request_data = b"GET / HTTP/2.0\r\nHost: localhost\r\n\r\n" + reader = MockStreamReader(request_data) + unreader = AsyncUnreader(reader) + cfg = MockConfig() + + with pytest.raises(InvalidHTTPVersion): + await AsyncRequest.parse(cfg, unreader, ("127.0.0.1", 8000)) diff --git a/tests/test_asgi_worker.py b/tests/test_asgi_worker.py new file mode 100644 index 000000000..9266af4d1 --- /dev/null +++ b/tests/test_asgi_worker.py @@ -0,0 +1,643 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +""" +Tests for the ASGI worker. + +Includes unit tests for worker components and integration tests +that actually start the server and make HTTP requests. +""" + +import asyncio +import errno +import os +import signal +import socket +import sys +import time +import threading +from unittest import mock + +import pytest + +from gunicorn.config import Config +from gunicorn.workers import gasgi + + +# ============================================================================ +# Mock Classes +# ============================================================================ + +class FakeSocket: + """Mock socket for testing.""" + + def __init__(self, data=b''): + self.data = data + self.closed = False + self.blocking = True + self._fileno = id(self) % 65536 + + def fileno(self): + return self._fileno + + def setblocking(self, blocking): + self.blocking = blocking + + def recv(self, size): + if self.closed: + raise OSError(errno.EBADF, "Bad file descriptor") + result = self.data[:size] + self.data = self.data[size:] + return result + + def send(self, data): + if self.closed: + raise OSError(errno.EPIPE, "Broken pipe") + return len(data) + + def close(self): + self.closed = True + + def getsockname(self): + return ('127.0.0.1', 8000) + + def getpeername(self): + return ('127.0.0.1', 12345) + + +class FakeApp: + """Mock ASGI application for testing.""" + + def __init__(self): + self.calls = [] + + def wsgi(self): + return self.asgi_app + + async def asgi_app(self, scope, receive, send): + self.calls.append(scope) + if scope["type"] == "lifespan": + while True: + message = await receive() + if message["type"] == "lifespan.startup": + await send({"type": "lifespan.startup.complete"}) + elif message["type"] == "lifespan.shutdown": + await send({"type": "lifespan.shutdown.complete"}) + return + elif scope["type"] == "http": + await send({ + "type": "http.response.start", + "status": 200, + "headers": [(b"content-type", b"text/plain")], + }) + await send({ + "type": "http.response.body", + "body": b"Hello from ASGI!", + }) + + +class FakeListener: + """Mock listener socket.""" + + def __init__(self): + self.sock = FakeSocket() + + def getsockname(self): + return ('127.0.0.1', 8000) + + def close(self): + self.sock.close() + + def __str__(self): + return "http://127.0.0.1:8000" + + +# ============================================================================ +# Helper Functions +# ============================================================================ + +def _has_uvloop(): + """Check if uvloop is available.""" + try: + import uvloop + return True + except ImportError: + return False + + +# ============================================================================ +# Unit Tests for ASGIWorker +# ============================================================================ + +class TestASGIWorkerInit: + """Tests for ASGIWorker initialization.""" + + def create_worker(self, **kwargs): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + cfg.set('worker_connections', 1000) + + for key, value in kwargs.items(): + cfg.set(key, value) + + worker = gasgi.ASGIWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=FakeApp(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + return worker + + def test_worker_init(self): + """Test worker initialization.""" + worker = self.create_worker() + + assert worker.worker_connections == 1000 + assert worker.nr_conns == 0 + assert worker.loop is None + assert worker.servers == [] + assert worker.state == {} + + def test_worker_connections_config(self): + """Test worker_connections configuration.""" + worker = self.create_worker(worker_connections=500) + assert worker.worker_connections == 500 + + +class TestASGIWorkerEventLoop: + """Tests for event loop setup.""" + + def create_worker(self, **kwargs): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + cfg.set('worker_connections', 1000) + + for key, value in kwargs.items(): + cfg.set(key, value) + + worker = gasgi.ASGIWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=FakeApp(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + return worker + + def test_setup_asyncio_loop(self): + """Test asyncio event loop setup.""" + worker = self.create_worker(asgi_loop='asyncio') + worker._setup_event_loop() + + assert worker.loop is not None + assert isinstance(worker.loop, asyncio.AbstractEventLoop) + worker.loop.close() + + def test_setup_auto_loop_falls_back_to_asyncio(self): + """Test that auto mode uses asyncio when uvloop unavailable.""" + worker = self.create_worker(asgi_loop='auto') + + # Mock uvloop import failure + with mock.patch.dict('sys.modules', {'uvloop': None}): + worker._setup_event_loop() + + assert worker.loop is not None + worker.loop.close() + + @pytest.mark.skipif( + not _has_uvloop(), + reason="uvloop not installed" + ) + def test_setup_uvloop(self): + """Test uvloop event loop setup.""" + worker = self.create_worker(asgi_loop='uvloop') + worker._setup_event_loop() + + import uvloop + assert isinstance(worker.loop, uvloop.Loop) + worker.loop.close() + + +class TestASGIWorkerSignals: + """Tests for signal handling.""" + + def create_worker(self): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + cfg.set('worker_connections', 1000) + cfg.set('graceful_timeout', 5) + + worker = gasgi.ASGIWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=FakeApp(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + worker._setup_event_loop() + return worker + + def test_handle_exit_sets_alive_false(self): + """Test that exit signal sets alive=False.""" + worker = self.create_worker() + worker.alive = True + + worker.handle_exit_signal() + + assert worker.alive is False + worker.loop.close() + + def test_handle_quit_sets_alive_false(self): + """Test that quit signal sets alive=False.""" + worker = self.create_worker() + worker.alive = True + + # Mock the worker_int callback on the worker's cfg settings + with mock.patch.object(worker.cfg.settings['worker_int'], 'get', return_value=lambda w: None): + worker.handle_quit_signal() + + assert worker.alive is False + worker.loop.close() + + +# ============================================================================ +# Tests for Lifespan Protocol +# ============================================================================ + +class TestLifespanManager: + """Tests for ASGI lifespan protocol.""" + + @pytest.mark.asyncio + async def test_lifespan_startup_complete(self): + """Test successful lifespan startup.""" + from gunicorn.asgi.lifespan import LifespanManager + + startup_called = False + shutdown_called = False + + async def app(scope, receive, send): + nonlocal startup_called, shutdown_called + assert scope["type"] == "lifespan" + while True: + message = await receive() + if message["type"] == "lifespan.startup": + startup_called = True + await send({"type": "lifespan.startup.complete"}) + elif message["type"] == "lifespan.shutdown": + shutdown_called = True + await send({"type": "lifespan.shutdown.complete"}) + return + + manager = LifespanManager(app, mock.Mock()) + await manager.startup() + + assert startup_called + assert manager._startup_complete.is_set() + assert not manager._startup_failed + + await manager.shutdown() + assert shutdown_called + + @pytest.mark.asyncio + async def test_lifespan_startup_failed(self): + """Test lifespan startup failure.""" + from gunicorn.asgi.lifespan import LifespanManager + + async def app(scope, receive, send): + message = await receive() + if message["type"] == "lifespan.startup": + await send({ + "type": "lifespan.startup.failed", + "message": "Database connection failed" + }) + + manager = LifespanManager(app, mock.Mock()) + + with pytest.raises(RuntimeError, match="Database connection failed"): + await manager.startup() + + @pytest.mark.asyncio + async def test_lifespan_state_shared(self): + """Test that lifespan state is shared with app.""" + from gunicorn.asgi.lifespan import LifespanManager + + state = {} + + async def app(scope, receive, send): + assert "state" in scope + scope["state"]["db"] = "connected" + message = await receive() + await send({"type": "lifespan.startup.complete"}) + message = await receive() + await send({"type": "lifespan.shutdown.complete"}) + + manager = LifespanManager(app, mock.Mock(), state) + await manager.startup() + + assert state.get("db") == "connected" + + await manager.shutdown() + + +# ============================================================================ +# Tests for WebSocket Protocol +# ============================================================================ + +class TestWebSocketProtocol: + """Tests for WebSocket protocol handling.""" + + def test_websocket_guid(self): + """Test WebSocket GUID constant.""" + from gunicorn.asgi.websocket import WS_GUID + assert WS_GUID == b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11" + + def test_websocket_opcodes(self): + """Test WebSocket opcode constants.""" + from gunicorn.asgi import websocket + + assert websocket.OPCODE_TEXT == 0x1 + assert websocket.OPCODE_BINARY == 0x2 + assert websocket.OPCODE_CLOSE == 0x8 + assert websocket.OPCODE_PING == 0x9 + assert websocket.OPCODE_PONG == 0xA + + def test_websocket_accept_key_calculation(self): + """Test WebSocket accept key calculation per RFC 6455.""" + import base64 + import hashlib + from gunicorn.asgi.websocket import WS_GUID + + # Example from RFC 6455 + client_key = b"dGhlIHNhbXBsZSBub25jZQ==" + expected_accept = "s3pPLMBiTxaQ9kYGzzhZRbK+xOo=" + + accept_key = base64.b64encode( + hashlib.sha1(client_key + WS_GUID).digest() + ).decode("ascii") + + assert accept_key == expected_accept + + def test_websocket_frame_masking(self): + """Test WebSocket frame unmasking.""" + from gunicorn.asgi.websocket import WebSocketProtocol + + # Create a minimal protocol instance + protocol = WebSocketProtocol(None, None, {}, None, mock.Mock()) + + # Test unmasking (XOR operation) + masking_key = bytes([0x37, 0xfa, 0x21, 0x3d]) + masked_data = bytes([0x7f, 0x9f, 0x4d, 0x51, 0x58]) # "Hello" masked + + unmasked = protocol._unmask(masked_data, masking_key) + assert unmasked == b"Hello" + + def test_websocket_frame_masking_empty(self): + """Test WebSocket frame unmasking with empty payload.""" + from gunicorn.asgi.websocket import WebSocketProtocol + + protocol = WebSocketProtocol(None, None, {}, None, mock.Mock()) + + masking_key = bytes([0x37, 0xfa, 0x21, 0x3d]) + unmasked = protocol._unmask(b"", masking_key) + assert unmasked == b"" + + +# ============================================================================ +# Integration Tests +# ============================================================================ + +class TestASGIIntegration: + """Integration tests that start actual servers.""" + + @pytest.fixture + def free_port(self): + """Get a free port for testing.""" + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: + s.bind(('127.0.0.1', 0)) + return s.getsockname()[1] + + @pytest.mark.asyncio + async def test_http_request_response(self, free_port): + """Test basic HTTP request/response cycle.""" + # Simple ASGI app + async def app(scope, receive, send): + if scope["type"] == "http": + await send({ + "type": "http.response.start", + "status": 200, + "headers": [(b"content-type", b"text/plain")], + }) + await send({ + "type": "http.response.body", + "body": b"Hello, World!", + }) + + # Start server + loop = asyncio.get_event_loop() + server = await loop.create_server( + lambda: _TestProtocol(app), + '127.0.0.1', + free_port, + ) + + try: + # Use asyncio to make HTTP request + reader, writer = await asyncio.open_connection('127.0.0.1', free_port) + request = f"GET / HTTP/1.1\r\nHost: 127.0.0.1:{free_port}\r\n\r\n" + writer.write(request.encode()) + await writer.drain() + + # Read response + response = await reader.read(4096) + response_text = response.decode() + + assert "HTTP/1.1 200" in response_text + assert "Hello, World!" in response_text + + writer.close() + await writer.wait_closed() + finally: + server.close() + await server.wait_closed() + + +class _TestProtocol(asyncio.Protocol): + """Minimal protocol for integration testing.""" + + def __init__(self, app): + self.app = app + self.transport = None + + def connection_made(self, transport): + self.transport = transport + + def data_received(self, data): + # Very simple HTTP parsing for testing + asyncio.create_task(self._handle(data)) + + async def _handle(self, data): + # Parse basic HTTP request + lines = data.decode().split('\r\n') + method, path, _ = lines[0].split(' ') + + scope = { + "type": "http", + "asgi": {"version": "3.0"}, + "http_version": "1.1", + "method": method, + "path": path, + "query_string": b"", + "headers": [], + "server": ("127.0.0.1", 8000), + "client": ("127.0.0.1", 12345), + } + + async def receive(): + return {"type": "http.request", "body": b"", "more_body": False} + + async def send(message): + if message["type"] == "http.response.start": + status = message["status"] + headers = message.get("headers", []) + response = f"HTTP/1.1 {status} OK\r\n" + for name, value in headers: + if isinstance(name, bytes): + name = name.decode() + if isinstance(value, bytes): + value = value.decode() + response += f"{name}: {value}\r\n" + response += "\r\n" + self.transport.write(response.encode()) + elif message["type"] == "http.response.body": + body = message.get("body", b"") + self.transport.write(body) + if not message.get("more_body", False): + self.transport.close() + + await self.app(scope, receive, send) + + +# ============================================================================ +# ASGI Protocol Tests +# ============================================================================ + +class TestASGIProtocol: + """Tests for ASGIProtocol.""" + + def test_reason_phrases(self): + """Test HTTP reason phrase lookup.""" + from gunicorn.asgi.protocol import ASGIProtocol + + # Create minimal worker mock + worker = mock.Mock() + worker.cfg = Config() + worker.log = mock.Mock() + worker.asgi = mock.Mock() + + protocol = ASGIProtocol(worker) + + assert protocol._get_reason_phrase(200) == "OK" + assert protocol._get_reason_phrase(404) == "Not Found" + assert protocol._get_reason_phrase(500) == "Internal Server Error" + assert protocol._get_reason_phrase(999) == "Unknown" + + def test_scope_building(self): + """Test HTTP scope building.""" + from gunicorn.asgi.protocol import ASGIProtocol + from gunicorn.asgi.message import AsyncRequest + + worker = mock.Mock() + worker.cfg = Config() + worker.cfg.set('root_path', '/api') + worker.log = mock.Mock() + worker.asgi = mock.Mock() + + protocol = ASGIProtocol(worker) + + # Create mock request + request = mock.Mock() + request.method = "GET" + request.path = "/users" + request.query = "page=1" + request.version = (1, 1) + request.scheme = "http" + request.headers = [("HOST", "localhost"), ("ACCEPT", "text/html")] + + scope = protocol._build_http_scope( + request, + ("127.0.0.1", 8000), # sockname + ("127.0.0.1", 12345), # peername + ) + + assert scope["type"] == "http" + assert scope["method"] == "GET" + assert scope["path"] == "/users" + assert scope["query_string"] == b"page=1" + assert scope["root_path"] == "/api" + assert scope["http_version"] == "1.1" + + +# ============================================================================ +# Config Tests +# ============================================================================ + +class TestASGIConfig: + """Tests for ASGI configuration options.""" + + def test_asgi_loop_default(self): + """Test default asgi_loop value.""" + cfg = Config() + assert cfg.asgi_loop == "auto" + + def test_asgi_loop_validation(self): + """Test asgi_loop validation.""" + cfg = Config() + + cfg.set('asgi_loop', 'asyncio') + assert cfg.asgi_loop == 'asyncio' + + cfg.set('asgi_loop', 'uvloop') + assert cfg.asgi_loop == 'uvloop' + + with pytest.raises(ValueError): + cfg.set('asgi_loop', 'invalid') + + def test_asgi_lifespan_default(self): + """Test default asgi_lifespan value.""" + cfg = Config() + assert cfg.asgi_lifespan == "auto" + + def test_asgi_lifespan_validation(self): + """Test asgi_lifespan validation.""" + cfg = Config() + + cfg.set('asgi_lifespan', 'on') + assert cfg.asgi_lifespan == 'on' + + cfg.set('asgi_lifespan', 'off') + assert cfg.asgi_lifespan == 'off' + + with pytest.raises(ValueError): + cfg.set('asgi_lifespan', 'invalid') + + def test_root_path_default(self): + """Test default root_path value.""" + cfg = Config() + assert cfg.root_path == "" + + def test_root_path_setting(self): + """Test root_path configuration.""" + cfg = Config() + cfg.set('root_path', '/api/v1') + assert cfg.root_path == '/api/v1' From 11c6a97c47f2a4a16cf683ae0f224b3880fca6e4 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 18:03:14 +0100 Subject: [PATCH 021/356] asgi: Fix pylint and pycodestyle warnings - Remove unused imports (ssl, os, base64, hashlib, traceback) - Remove unused variables (body_parts, has_content_length, etc.) - Fix no-else-break patterns in protocol.py and websocket.py - Replace __anext__() with anext() builtin - Remove unnecessary pass statements - Add proper access logging to ASGI protocol handler - Add ASGIResponseInfo class and _build_environ method for logging - Disable too-many-return-statements for _read_frame method - Fix raising-bad-type error (use 'is not None' check) - Fix whitespace before colon in message.py --- gunicorn/asgi/message.py | 4 +- gunicorn/asgi/protocol.py | 114 ++++++++++++++++++++++++------------- gunicorn/asgi/websocket.py | 13 ++--- gunicorn/workers/gasgi.py | 1 - 4 files changed, 83 insertions(+), 49 deletions(-) diff --git a/gunicorn/asgi/message.py b/gunicorn/asgi/message.py index d7d20c834..a2d8e8250 100644 --- a/gunicorn/asgi/message.py +++ b/gunicorn/asgi/message.py @@ -477,7 +477,7 @@ async def _read_chunked_body(self, size): self._body_reader = self._chunked_body_reader() try: - return await self._body_reader.__anext__() + return await anext(self._body_reader) except StopAsyncIteration: self._body_remaining = 0 return b"" @@ -489,7 +489,7 @@ async def _chunked_body_reader(self): size_line = await self._read_chunk_size_line() # Parse chunk size (handle extensions) chunk_size, *_ = size_line.split(b";", 1) - if _ : + if _: chunk_size = chunk_size.rstrip(b" \t") if any(n not in b"0123456789abcdefABCDEF" for n in chunk_size): diff --git a/gunicorn/asgi/protocol.py b/gunicorn/asgi/protocol.py index cededd682..0eb1d045b 100644 --- a/gunicorn/asgi/protocol.py +++ b/gunicorn/asgi/protocol.py @@ -10,9 +10,6 @@ """ import asyncio -import base64 -import hashlib -import traceback from datetime import datetime from gunicorn.asgi.unreader import AsyncUnreader @@ -20,6 +17,22 @@ from gunicorn.http.errors import NoMoreData +class ASGIResponseInfo: + """Simple container for ASGI response info for access logging.""" + + def __init__(self, status, headers, sent): + self.status = status + self.sent = sent + # Convert headers to list of string tuples for logging + self.headers = [] + for name, value in headers: + if isinstance(name, bytes): + name = name.decode("latin-1") + if isinstance(value, bytes): + value = value.decode("latin-1") + self.headers.append((name, value)) + + class ASGIProtocol(asyncio.Protocol): """HTTP/1.1 protocol handler for ASGI applications. @@ -97,30 +110,30 @@ async def _handle_connection(self): if self._is_websocket_upgrade(request): await self._handle_websocket(request, sockname, peername) break # WebSocket takes over the connection - else: - # Handle HTTP request - keepalive = await self._handle_http_request( - request, sockname, peername - ) - # Increment worker request count - self.worker.nr += 1 + # Handle HTTP request + keepalive = await self._handle_http_request( + request, sockname, peername + ) - # Check max_requests - if self.worker.nr >= self.worker.max_requests: - self.log.info("Autorestarting worker after current request.") - self.worker.alive = False - keepalive = False + # Increment worker request count + self.worker.nr += 1 - if not keepalive or not self.worker.alive: - break + # Check max_requests + if self.worker.nr >= self.worker.max_requests: + self.log.info("Autorestarting worker after current request.") + self.worker.alive = False + keepalive = False - # Check connection limits for keepalive - if not self.cfg.keepalive: - break + if not keepalive or not self.worker.alive: + break - # Drain any unread body before next request - await request.drain_body() + # Check connection limits for keepalive + if not self.cfg.keepalive: + break + + # Drain any unread body before next request + await request.drain_body() except asyncio.CancelledError: pass @@ -155,9 +168,13 @@ async def _handle_http_request(self, request, sockname, peername): scope = self._build_http_scope(request, sockname, peername) response_started = False response_complete = False - body_parts = [] exc_to_raise = None + # Response tracking for access logging + response_status = 500 + response_headers = [] + response_sent = 0 + # Receive queue for body receive_queue = asyncio.Queue() @@ -177,6 +194,7 @@ async def receive(): async def send(message): nonlocal response_started, response_complete, exc_to_raise + nonlocal response_status, response_headers, response_sent msg_type = message["type"] @@ -185,9 +203,9 @@ async def send(message): exc_to_raise = RuntimeError("Response already started") return response_started = True - status = message["status"] - headers = message.get("headers", []) - await self._send_response_start(status, headers, request) + response_status = message["status"] + response_headers = message.get("headers", []) + await self._send_response_start(response_status, response_headers, request) elif msg_type == "http.response.body": if not response_started: @@ -202,32 +220,42 @@ async def send(message): if body: await self._send_body(body) + response_sent += len(body) if not more_body: response_complete = True + # Build environ for logging + environ = self._build_environ(request, sockname, peername) + resp = None + try: request_start = datetime.now() self.cfg.pre_request(self.worker, request) await self.app(scope, receive, send) - if exc_to_raise: + if exc_to_raise is not None: raise exc_to_raise # Ensure response was sent if not response_started: await self._send_error_response(500, "Internal Server Error") + response_status = 500 - except Exception as e: + except Exception: self.log.exception("Error in ASGI application") if not response_started: await self._send_error_response(500, "Internal Server Error") + response_status = 500 return False finally: try: request_time = datetime.now() - request_start - self.cfg.post_request(self.worker, request, {}, None) + # Create response info for logging + resp = ASGIResponseInfo(response_status, response_headers, response_sent) + self.log.access(resp, request, environ, request_time) + self.cfg.post_request(self.worker, request, environ, resp) except Exception: self.log.exception("Exception in post_request hook") @@ -291,6 +319,24 @@ def _build_http_scope(self, request, sockname, peername): return scope + def _build_environ(self, request, sockname, peername): + """Build minimal WSGI-like environ dict for access logging.""" + environ = { + "REQUEST_METHOD": request.method, + "RAW_URI": request.uri, + "PATH_INFO": request.path, + "QUERY_STRING": request.query or "", + "SERVER_PROTOCOL": f"HTTP/{request.version[0]}.{request.version[1]}", + "REMOTE_ADDR": peername[0] if peername else "-", + } + + # Add HTTP headers as environ vars + for name, value in request.headers: + key = "HTTP_" + name.replace("-", "_") + environ[key] = value + + return environ + def _build_websocket_scope(self, request, sockname, peername): """Build ASGI WebSocket scope from parsed request.""" # Build headers list as bytes tuples @@ -334,9 +380,6 @@ async def _send_response_start(self, status, headers, request): # Build headers header_lines = [] - has_content_length = False - has_transfer_encoding = False - has_connection = False for name, value in headers: if isinstance(name, bytes): @@ -344,13 +387,6 @@ async def _send_response_start(self, status, headers, request): if isinstance(value, bytes): value = value.decode("latin-1") header_lines.append(f"{name}: {value}\r\n") - name_lower = name.lower() - if name_lower == "content-length": - has_content_length = True - elif name_lower == "transfer-encoding": - has_transfer_encoding = True - elif name_lower == "connection": - has_connection = True # Add server header if not present header_lines.append("Server: gunicorn/asgi\r\n") diff --git a/gunicorn/asgi/websocket.py b/gunicorn/asgi/websocket.py index bcde84eeb..737268b61 100644 --- a/gunicorn/asgi/websocket.py +++ b/gunicorn/asgi/websocket.py @@ -12,7 +12,6 @@ import base64 import hashlib import struct -import os # WebSocket frame opcodes @@ -81,7 +80,7 @@ async def run(self): try: await self.app(self.scope, self._receive, self._send) - except Exception as e: + except Exception: self.log.exception("Error in WebSocket ASGI application") finally: read_task.cancel() @@ -180,7 +179,8 @@ async def _read_frames(self): if opcode == OPCODE_CLOSE: await self._handle_close(payload) break - elif opcode == OPCODE_PING: + + if opcode == OPCODE_PING: await self._send_frame(OPCODE_PONG, payload) elif opcode == OPCODE_PONG: # Ignore pongs @@ -212,7 +212,7 @@ async def _read_frames(self): "code": self.close_code or CLOSE_ABNORMAL, }) - async def _read_frame(self): + async def _read_frame(self): # pylint: disable=too-many-return-statements """Read a single WebSocket frame. Returns: @@ -326,10 +326,9 @@ async def _handle_close(self, payload): self.closed = True - async def _handle_continuation(self, payload): + async def _handle_continuation(self, payload): # pylint: disable=unused-argument """Handle continuation frame (already processed in _read_frame).""" - # This is called for partial fragments, nothing to do - pass + # This is called for partial fragments, nothing to do here async def _send_frame(self, opcode, payload): """Send a WebSocket frame. diff --git a/gunicorn/workers/gasgi.py b/gunicorn/workers/gasgi.py index b0d57cf01..118d11de2 100644 --- a/gunicorn/workers/gasgi.py +++ b/gunicorn/workers/gasgi.py @@ -12,7 +12,6 @@ import asyncio import os import signal -import ssl import sys from gunicorn.workers import base From 903a1fdf3cf779c8561d53ce9c9cc9f6017b4eac Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 18:32:01 +0100 Subject: [PATCH 022/356] tests: Add pytest-asyncio for ASGI worker tests The ASGI worker tests use @pytest.mark.asyncio decorator which requires the pytest-asyncio plugin to be installed. --- requirements_test.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements_test.txt b/requirements_test.txt index b618d1a73..efa91f207 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -3,3 +3,4 @@ eventlet coverage pytest>=7.2.0 pytest-cov +pytest-asyncio From ac7296ec49cf32556c19963d20bc7ba83d51acc3 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 18:04:23 +0100 Subject: [PATCH 023/356] uwsgi: Add native uWSGI binary protocol support Add support for the uWSGI binary protocol, enabling gunicorn to work with nginx's uwsgi_pass directive. New module gunicorn/uwsgi/ with: - UWSGIRequest: Parses 4-byte binary header and key-value vars block - UWSGIParser: Protocol parser following existing Parser pattern - Error classes: InvalidUWSGIHeader, UnsupportedModifier, ForbiddenUWSGIRequest New configuration options: - --protocol: Select 'http' (default) or 'uwsgi' protocol - --uwsgi-allow-from: IP allowlist for uWSGI requests (default: localhost) Worker integration via get_parser() factory in gunicorn/http/__init__.py, updates to sync, gthread, and base_async workers. Example nginx config: upstream gunicorn { server 127.0.0.1:8000; } location / { uwsgi_pass gunicorn; include uwsgi_params; } --- gunicorn/config.py | 47 ++++ gunicorn/http/__init__.py | 21 +- gunicorn/uwsgi/__init__.py | 21 ++ gunicorn/uwsgi/errors.py | 46 ++++ gunicorn/uwsgi/message.py | 232 ++++++++++++++++++ gunicorn/uwsgi/parser.py | 12 + gunicorn/workers/base_async.py | 2 +- gunicorn/workers/gthread.py | 2 +- gunicorn/workers/sync.py | 2 +- tests/test_uwsgi.py | 435 +++++++++++++++++++++++++++++++++ 10 files changed, 816 insertions(+), 4 deletions(-) create mode 100644 gunicorn/uwsgi/__init__.py create mode 100644 gunicorn/uwsgi/errors.py create mode 100644 gunicorn/uwsgi/message.py create mode 100644 gunicorn/uwsgi/parser.py create mode 100644 tests/test_uwsgi.py diff --git a/gunicorn/config.py b/gunicorn/config.py index 522dcae93..1c36f9871 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -2096,6 +2096,53 @@ class ProxyAllowFrom(Setting): """ +class Protocol(Setting): + name = "protocol" + section = "Server Mechanics" + cli = ["--protocol"] + meta = "STRING" + validator = validate_string + default = "http" + desc = """\ + The protocol for incoming connections. + + * ``http`` - Standard HTTP/1.x (default) + * ``uwsgi`` - uWSGI binary protocol (for nginx uwsgi_pass) + + When using the uWSGI protocol, Gunicorn can receive requests from + nginx using the uwsgi_pass directive:: + + upstream gunicorn { + server 127.0.0.1:8000; + } + location / { + uwsgi_pass gunicorn; + include uwsgi_params; + } + """ + + +class UWSGIAllowFrom(Setting): + name = "uwsgi_allow_ips" + section = "Server Mechanics" + cli = ["--uwsgi-allow-from"] + validator = validate_string_to_addr_list + default = "127.0.0.1,::1" + desc = """\ + IPs allowed to send uWSGI protocol requests (comma separated). + + Set to ``*`` to allow all IPs. This is useful for setups where you + don't know in advance the IP address of front-end, but instead have + ensured via other means that only your authorized front-ends can + access Gunicorn. + + .. note:: + + This option does not affect UNIX socket connections. Connections not associated with + an IP address are treated as allowed, unconditionally. + """ + + class KeyFile(Setting): name = "keyfile" section = "SSL" diff --git a/gunicorn/http/__init__.py b/gunicorn/http/__init__.py index 11473bb0a..1d35b7c7d 100644 --- a/gunicorn/http/__init__.py +++ b/gunicorn/http/__init__.py @@ -5,4 +5,23 @@ from gunicorn.http.message import Message, Request from gunicorn.http.parser import RequestParser -__all__ = ['Message', 'Request', 'RequestParser'] + +def get_parser(cfg, source, source_addr): + """Get appropriate parser based on protocol config. + + Args: + cfg: Gunicorn config object + source: Socket or iterable source + source_addr: Source address tuple or None + + Returns: + Parser instance (RequestParser or UWSGIParser) + """ + protocol = getattr(cfg, 'protocol', 'http') + if protocol == 'uwsgi': + from gunicorn.uwsgi.parser import UWSGIParser + return UWSGIParser(cfg, source, source_addr) + return RequestParser(cfg, source, source_addr) + + +__all__ = ['Message', 'Request', 'RequestParser', 'get_parser'] diff --git a/gunicorn/uwsgi/__init__.py b/gunicorn/uwsgi/__init__.py new file mode 100644 index 000000000..cdf4f60cc --- /dev/null +++ b/gunicorn/uwsgi/__init__.py @@ -0,0 +1,21 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +from gunicorn.uwsgi.message import UWSGIRequest +from gunicorn.uwsgi.parser import UWSGIParser +from gunicorn.uwsgi.errors import ( + UWSGIParseException, + InvalidUWSGIHeader, + UnsupportedModifier, + ForbiddenUWSGIRequest, +) + +__all__ = [ + 'UWSGIRequest', + 'UWSGIParser', + 'UWSGIParseException', + 'InvalidUWSGIHeader', + 'UnsupportedModifier', + 'ForbiddenUWSGIRequest', +] diff --git a/gunicorn/uwsgi/errors.py b/gunicorn/uwsgi/errors.py new file mode 100644 index 000000000..cdbaee219 --- /dev/null +++ b/gunicorn/uwsgi/errors.py @@ -0,0 +1,46 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +# We don't need to call super() in __init__ methods of our +# BaseException and Exception classes because we also define +# our own __str__ methods so there is no need to pass 'message' +# to the base class to get a meaningful output from 'str(exc)'. +# pylint: disable=super-init-not-called + + +class UWSGIParseException(Exception): + """Base exception for uWSGI protocol parsing errors.""" + + +class InvalidUWSGIHeader(UWSGIParseException): + """Raised when the uWSGI header is malformed.""" + + def __init__(self, msg=""): + self.msg = msg + self.code = 400 + + def __str__(self): + return "Invalid uWSGI header: %s" % self.msg + + +class UnsupportedModifier(UWSGIParseException): + """Raised when modifier1 is not 0 (WSGI request).""" + + def __init__(self, modifier): + self.modifier = modifier + self.code = 501 + + def __str__(self): + return "Unsupported uWSGI modifier1: %d" % self.modifier + + +class ForbiddenUWSGIRequest(UWSGIParseException): + """Raised when source IP is not in the allow list.""" + + def __init__(self, host): + self.host = host + self.code = 403 + + def __str__(self): + return "uWSGI request from %r not allowed" % self.host diff --git a/gunicorn/uwsgi/message.py b/gunicorn/uwsgi/message.py new file mode 100644 index 000000000..a63172ebc --- /dev/null +++ b/gunicorn/uwsgi/message.py @@ -0,0 +1,232 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +import io + +from gunicorn.http.body import LengthReader, Body +from gunicorn.uwsgi.errors import ( + InvalidUWSGIHeader, + UnsupportedModifier, + ForbiddenUWSGIRequest, +) + + +# Maximum number of variables to prevent DoS +MAX_UWSGI_VARS = 1000 + + +class UWSGIRequest: + """uWSGI protocol request parser. + + The uWSGI protocol uses a 4-byte binary header: + - Byte 0: modifier1 (packet type, 0 = WSGI request) + - Bytes 1-2: datasize (16-bit little-endian, size of vars block) + - Byte 3: modifier2 (additional flags, typically 0) + + After the header: + 1. Vars block (datasize bytes): Key-value pairs containing WSGI environ + - Each pair: 2-byte key_size (LE) + key + 2-byte val_size (LE) + value + 2. Request body (determined by CONTENT_LENGTH in vars) + """ + + def __init__(self, cfg, unreader, peer_addr, req_number=1): + self.cfg = cfg + self.unreader = unreader + self.peer_addr = peer_addr + self.remote_addr = peer_addr + self.req_number = req_number + + # Request attributes (compatible with HTTP Request interface) + self.method = None + self.uri = None + self.path = None + self.query = None + self.fragment = "" + self.version = (1, 1) # uWSGI is HTTP/1.1 compatible + self.headers = [] + self.trailers = [] + self.body = None + self.scheme = "https" if cfg.is_ssl else "http" + self.must_close = False + + # uWSGI specific + self.uwsgi_vars = {} + self.modifier1 = 0 + self.modifier2 = 0 + + # Proxy protocol compatibility + self.proxy_protocol_info = None + + # Check if the source IP is allowed + self._check_allowed_ip() + + # Parse the request + unused = self.parse(self.unreader) + self.unreader.unread(unused) + self.set_body_reader() + + def _check_allowed_ip(self): + """Verify source IP is in the allowed list.""" + allow_ips = getattr(self.cfg, 'uwsgi_allow_ips', ['127.0.0.1', '::1']) + + # UNIX sockets don't have IP addresses + if not isinstance(self.peer_addr, tuple): + return + + # Wildcard allows all + if '*' in allow_ips: + return + + if self.peer_addr[0] not in allow_ips: + raise ForbiddenUWSGIRequest(self.peer_addr[0]) + + def force_close(self): + """Force the connection to close after this request.""" + self.must_close = True + + def parse(self, unreader): + """Parse uWSGI packet header and vars block.""" + # Read the 4-byte header + header = self._read_exact(unreader, 4) + if len(header) < 4: + raise InvalidUWSGIHeader("incomplete header") + + self.modifier1 = header[0] + datasize = int.from_bytes(header[1:3], 'little') + self.modifier2 = header[3] + + # Only modifier1=0 (WSGI request) is supported + if self.modifier1 != 0: + raise UnsupportedModifier(self.modifier1) + + # Read the vars block + if datasize > 0: + vars_data = self._read_exact(unreader, datasize) + if len(vars_data) < datasize: + raise InvalidUWSGIHeader("incomplete vars block") + self._parse_vars(vars_data) + + # Extract HTTP request info from vars + self._extract_request_info() + + return b"" + + def _read_exact(self, unreader, size): + """Read exactly size bytes from the unreader.""" + buf = io.BytesIO() + remaining = size + + while remaining > 0: + data = unreader.read() + if not data: + break + buf.write(data) + remaining = size - buf.tell() + + result = buf.getvalue() + # Put back any extra bytes + if len(result) > size: + unreader.unread(result[size:]) + result = result[:size] + + return result + + def _parse_vars(self, data): + """Parse uWSGI vars block into key-value pairs. + + Format: key_size (2 bytes LE) + key + val_size (2 bytes LE) + value + """ + pos = 0 + var_count = 0 + + while pos < len(data): + if var_count >= MAX_UWSGI_VARS: + raise InvalidUWSGIHeader("too many variables") + + # Key size (2 bytes, little-endian) + if pos + 2 > len(data): + raise InvalidUWSGIHeader("truncated key size") + key_size = int.from_bytes(data[pos:pos + 2], 'little') + pos += 2 + + # Key + if pos + key_size > len(data): + raise InvalidUWSGIHeader("truncated key") + key = data[pos:pos + key_size].decode('latin-1') + pos += key_size + + # Value size (2 bytes, little-endian) + if pos + 2 > len(data): + raise InvalidUWSGIHeader("truncated value size") + val_size = int.from_bytes(data[pos:pos + 2], 'little') + pos += 2 + + # Value + if pos + val_size > len(data): + raise InvalidUWSGIHeader("truncated value") + value = data[pos:pos + val_size].decode('latin-1') + pos += val_size + + self.uwsgi_vars[key] = value + var_count += 1 + + def _extract_request_info(self): + """Extract HTTP request info from uWSGI vars.""" + # Method + self.method = self.uwsgi_vars.get('REQUEST_METHOD', 'GET') + + # URI and path + self.path = self.uwsgi_vars.get('PATH_INFO', '/') + self.query = self.uwsgi_vars.get('QUERY_STRING', '') + + # Build URI + if self.query: + self.uri = "%s?%s" % (self.path, self.query) + else: + self.uri = self.path + + # Scheme + if self.uwsgi_vars.get('HTTPS', '').lower() in ('on', '1', 'true'): + self.scheme = 'https' + elif 'wsgi.url_scheme' in self.uwsgi_vars: + self.scheme = self.uwsgi_vars['wsgi.url_scheme'] + + # Extract HTTP headers (HTTP_* vars) + for key, value in self.uwsgi_vars.items(): + if key.startswith('HTTP_'): + # Convert HTTP_HEADER_NAME to HEADER-NAME + header_name = key[5:].replace('_', '-') + self.headers.append((header_name, value)) + elif key == 'CONTENT_TYPE': + self.headers.append(('CONTENT-TYPE', value)) + elif key == 'CONTENT_LENGTH': + self.headers.append(('CONTENT-LENGTH', value)) + + def set_body_reader(self): + """Set up the body reader based on CONTENT_LENGTH.""" + content_length = 0 + + # Get content length from vars + if 'CONTENT_LENGTH' in self.uwsgi_vars: + try: + content_length = max(int(self.uwsgi_vars['CONTENT_LENGTH']), 0) + except ValueError: + content_length = 0 + + self.body = Body(LengthReader(self.unreader, content_length)) + + def should_close(self): + """Determine if the connection should be closed after this request.""" + if self.must_close: + return True + + # Check HTTP_CONNECTION header + connection = self.uwsgi_vars.get('HTTP_CONNECTION', '').lower() + if connection == 'close': + return True + elif connection == 'keep-alive': + return False + + # Default to keep-alive for HTTP/1.1 + return False diff --git a/gunicorn/uwsgi/parser.py b/gunicorn/uwsgi/parser.py new file mode 100644 index 000000000..fede8c56d --- /dev/null +++ b/gunicorn/uwsgi/parser.py @@ -0,0 +1,12 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +from gunicorn.http.parser import Parser +from gunicorn.uwsgi.message import UWSGIRequest + + +class UWSGIParser(Parser): + """Parser for uWSGI protocol requests.""" + + mesg_class = UWSGIRequest diff --git a/gunicorn/workers/base_async.py b/gunicorn/workers/base_async.py index 9466d6aaa..22ea09aba 100644 --- a/gunicorn/workers/base_async.py +++ b/gunicorn/workers/base_async.py @@ -32,7 +32,7 @@ def is_already_handled(self, respiter): def handle(self, listener, client, addr): req = None try: - parser = http.RequestParser(self.cfg, client, addr) + parser = http.get_parser(self.cfg, client, addr) try: listener_name = listener.getsockname() if not self.cfg.keepalive: diff --git a/gunicorn/workers/gthread.py b/gunicorn/workers/gthread.py index 472707254..7cab99200 100644 --- a/gunicorn/workers/gthread.py +++ b/gunicorn/workers/gthread.py @@ -58,7 +58,7 @@ def init(self): self.sock = sock.ssl_wrap_socket(self.sock, self.cfg) # initialize the parser - self.parser = http.RequestParser(self.cfg, self.sock, self.client) + self.parser = http.get_parser(self.cfg, self.sock, self.client) def set_timeout(self): # Use monotonic clock for reliability (time.time() can jump due to NTP) diff --git a/gunicorn/workers/sync.py b/gunicorn/workers/sync.py index 4c029f912..99dbdaac5 100644 --- a/gunicorn/workers/sync.py +++ b/gunicorn/workers/sync.py @@ -129,7 +129,7 @@ def handle(self, listener, client, addr): try: if self.cfg.is_ssl: client = sock.ssl_wrap_socket(client, self.cfg) - parser = http.RequestParser(self.cfg, client, addr) + parser = http.get_parser(self.cfg, client, addr) req = next(parser) self.handle_request(listener, req, client, addr) except http.errors.NoMoreData as e: diff --git a/tests/test_uwsgi.py b/tests/test_uwsgi.py new file mode 100644 index 000000000..26ff09f57 --- /dev/null +++ b/tests/test_uwsgi.py @@ -0,0 +1,435 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +import io +import pytest +from unittest import mock + +from gunicorn.uwsgi import ( + UWSGIRequest, + UWSGIParser, + UWSGIParseException, + InvalidUWSGIHeader, + UnsupportedModifier, + ForbiddenUWSGIRequest, +) +from gunicorn.http.unreader import IterUnreader + + +def make_uwsgi_packet(vars_dict, modifier1=0, modifier2=0): + """Create uWSGI packet for testing. + + Args: + vars_dict: Dict of WSGI environ variables + modifier1: Packet type (0 = WSGI request) + modifier2: Additional flags + + Returns: + bytes: Complete uWSGI packet + """ + vars_data = b'' + for key, value in vars_dict.items(): + k = key.encode('latin-1') + v = value.encode('latin-1') + vars_data += len(k).to_bytes(2, 'little') + k + vars_data += len(v).to_bytes(2, 'little') + v + + header = bytes([modifier1]) + len(vars_data).to_bytes(2, 'little') + bytes([modifier2]) + return header + vars_data + + +def make_uwsgi_packet_with_body(vars_dict, body=b'', modifier1=0, modifier2=0): + """Create uWSGI packet with body for testing.""" + if body: + vars_dict = dict(vars_dict) + vars_dict['CONTENT_LENGTH'] = str(len(body)) + return make_uwsgi_packet(vars_dict, modifier1, modifier2) + body + + +class MockConfig: + """Mock config object for testing.""" + + def __init__(self, is_ssl=False, uwsgi_allow_ips=None): + self.is_ssl = is_ssl + self.uwsgi_allow_ips = uwsgi_allow_ips or ['127.0.0.1', '::1'] + + +class TestUWSGIPacketConstruction: + """Test the packet construction helper.""" + + def test_empty_vars(self): + packet = make_uwsgi_packet({}) + assert packet == b'\x00\x00\x00\x00' # modifier1=0, size=0, modifier2=0 + + def test_single_var(self): + packet = make_uwsgi_packet({'KEY': 'val'}) + # Header: modifier1(0) + size(10 in LE) + modifier2(0) + # Var: key_size(3 in LE) + 'KEY' + val_size(3 in LE) + 'val' + # Size = 2 + 3 + 2 + 3 = 10 bytes + expected_header = b'\x00\x0a\x00\x00' + expected_var = b'\x03\x00KEY\x03\x00val' + assert packet == expected_header + expected_var + + def test_multiple_vars(self): + packet = make_uwsgi_packet({'A': '1', 'B': '2'}) + assert len(packet) == 4 + (2 + 1 + 2 + 1) * 2 # header + 2 vars + + +class TestUWSGIRequest: + """Test UWSGIRequest parsing.""" + + def test_parse_simple_request(self): + """Test parsing a simple GET request.""" + packet = make_uwsgi_packet({ + 'REQUEST_METHOD': 'GET', + 'PATH_INFO': '/test', + 'QUERY_STRING': 'foo=bar', + }) + unreader = IterUnreader([packet]) + cfg = MockConfig() + + req = UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + + assert req.method == 'GET' + assert req.path == '/test' + assert req.query == 'foo=bar' + assert req.uri == '/test?foo=bar' + + def test_parse_post_request_with_body(self): + """Test parsing a POST request with body.""" + body = b'name=test&value=123' + packet = make_uwsgi_packet_with_body({ + 'REQUEST_METHOD': 'POST', + 'PATH_INFO': '/submit', + 'CONTENT_TYPE': 'application/x-www-form-urlencoded', + }, body) + unreader = IterUnreader([packet]) + cfg = MockConfig() + + req = UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + + assert req.method == 'POST' + assert req.path == '/submit' + assert req.body.read() == body + + def test_parse_headers(self): + """Test that HTTP_* vars become headers.""" + packet = make_uwsgi_packet({ + 'REQUEST_METHOD': 'GET', + 'PATH_INFO': '/', + 'HTTP_HOST': 'example.com', + 'HTTP_USER_AGENT': 'TestClient/1.0', + 'HTTP_ACCEPT': 'text/html', + }) + unreader = IterUnreader([packet]) + cfg = MockConfig() + + req = UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + + headers_dict = dict(req.headers) + assert headers_dict['HOST'] == 'example.com' + assert headers_dict['USER-AGENT'] == 'TestClient/1.0' + assert headers_dict['ACCEPT'] == 'text/html' + + def test_parse_content_type_header(self): + """Test that CONTENT_TYPE becomes a header.""" + packet = make_uwsgi_packet({ + 'REQUEST_METHOD': 'POST', + 'PATH_INFO': '/', + 'CONTENT_TYPE': 'application/json', + 'CONTENT_LENGTH': '0', + }) + unreader = IterUnreader([packet]) + cfg = MockConfig() + + req = UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + + headers_dict = dict(req.headers) + assert headers_dict['CONTENT-TYPE'] == 'application/json' + assert headers_dict['CONTENT-LENGTH'] == '0' + + def test_https_scheme(self): + """Test scheme detection from HTTPS variable.""" + packet = make_uwsgi_packet({ + 'REQUEST_METHOD': 'GET', + 'PATH_INFO': '/', + 'HTTPS': 'on', + }) + unreader = IterUnreader([packet]) + cfg = MockConfig() + + req = UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + + assert req.scheme == 'https' + + def test_wsgi_url_scheme(self): + """Test scheme from wsgi.url_scheme variable.""" + packet = make_uwsgi_packet({ + 'REQUEST_METHOD': 'GET', + 'PATH_INFO': '/', + 'wsgi.url_scheme': 'https', + }) + unreader = IterUnreader([packet]) + cfg = MockConfig() + + req = UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + + assert req.scheme == 'https' + + def test_default_values(self): + """Test default values when vars are missing.""" + packet = make_uwsgi_packet({}) + unreader = IterUnreader([packet]) + cfg = MockConfig() + + req = UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + + assert req.method == 'GET' + assert req.path == '/' + assert req.query == '' + assert req.uri == '/' + + def test_uwsgi_vars_preserved(self): + """Test that all vars are preserved in uwsgi_vars.""" + packet = make_uwsgi_packet({ + 'REQUEST_METHOD': 'GET', + 'PATH_INFO': '/', + 'SERVER_NAME': 'localhost', + 'SERVER_PORT': '8000', + 'CUSTOM_VAR': 'custom_value', + }) + unreader = IterUnreader([packet]) + cfg = MockConfig() + + req = UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + + assert req.uwsgi_vars['SERVER_NAME'] == 'localhost' + assert req.uwsgi_vars['SERVER_PORT'] == '8000' + assert req.uwsgi_vars['CUSTOM_VAR'] == 'custom_value' + + +class TestUWSGIRequestErrors: + """Test UWSGIRequest error handling.""" + + def test_incomplete_header(self): + """Test error on incomplete header.""" + unreader = IterUnreader([b'\x00\x00']) # Only 2 bytes + cfg = MockConfig() + + with pytest.raises(InvalidUWSGIHeader) as exc_info: + UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + assert 'incomplete header' in str(exc_info.value) + + def test_incomplete_vars_block(self): + """Test error on truncated vars block.""" + # Header says 100 bytes of vars, but we only provide 10 + header = b'\x00\x64\x00\x00' # modifier1=0, size=100, modifier2=0 + unreader = IterUnreader([header + b'1234567890']) + cfg = MockConfig() + + with pytest.raises(InvalidUWSGIHeader) as exc_info: + UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + assert 'incomplete vars block' in str(exc_info.value) + + def test_unsupported_modifier(self): + """Test error on non-zero modifier1.""" + packet = bytes([1]) + b'\x00\x00\x00' # modifier1=1 + unreader = IterUnreader([packet]) + cfg = MockConfig() + + with pytest.raises(UnsupportedModifier) as exc_info: + UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + assert exc_info.value.modifier == 1 + assert exc_info.value.code == 501 + + def test_truncated_key_size(self): + """Test error on truncated key size.""" + header = b'\x00\x01\x00\x00' # size=1, but need at least 2 bytes for key_size + unreader = IterUnreader([header + b'X']) + cfg = MockConfig() + + with pytest.raises(InvalidUWSGIHeader) as exc_info: + UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + assert 'truncated' in str(exc_info.value) + + def test_forbidden_ip(self): + """Test error when source IP not in allow list.""" + packet = make_uwsgi_packet({'REQUEST_METHOD': 'GET', 'PATH_INFO': '/'}) + unreader = IterUnreader([packet]) + cfg = MockConfig(uwsgi_allow_ips=['192.168.1.1']) + + with pytest.raises(ForbiddenUWSGIRequest) as exc_info: + UWSGIRequest(cfg, unreader, ('10.0.0.1', 12345)) + assert exc_info.value.code == 403 + assert '10.0.0.1' in str(exc_info.value) + + def test_allowed_ip_wildcard(self): + """Test that wildcard allows any IP.""" + packet = make_uwsgi_packet({'REQUEST_METHOD': 'GET', 'PATH_INFO': '/'}) + unreader = IterUnreader([packet]) + cfg = MockConfig(uwsgi_allow_ips=['*']) + + # Should not raise + req = UWSGIRequest(cfg, unreader, ('10.0.0.1', 12345)) + assert req.method == 'GET' + + def test_unix_socket_always_allowed(self): + """Test that UNIX socket connections are always allowed.""" + packet = make_uwsgi_packet({'REQUEST_METHOD': 'GET', 'PATH_INFO': '/'}) + unreader = IterUnreader([packet]) + cfg = MockConfig(uwsgi_allow_ips=['127.0.0.1']) + + # UNIX socket has non-tuple peer_addr + req = UWSGIRequest(cfg, unreader, None) + assert req.method == 'GET' + + +class TestUWSGIRequestConnection: + """Test connection handling.""" + + def test_should_close_default(self): + """Test default keep-alive behavior.""" + packet = make_uwsgi_packet({'REQUEST_METHOD': 'GET', 'PATH_INFO': '/'}) + unreader = IterUnreader([packet]) + cfg = MockConfig() + + req = UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + + assert req.should_close() is False + + def test_should_close_connection_close(self): + """Test Connection: close header.""" + packet = make_uwsgi_packet({ + 'REQUEST_METHOD': 'GET', + 'PATH_INFO': '/', + 'HTTP_CONNECTION': 'close', + }) + unreader = IterUnreader([packet]) + cfg = MockConfig() + + req = UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + + assert req.should_close() is True + + def test_should_close_connection_keepalive(self): + """Test Connection: keep-alive header.""" + packet = make_uwsgi_packet({ + 'REQUEST_METHOD': 'GET', + 'PATH_INFO': '/', + 'HTTP_CONNECTION': 'keep-alive', + }) + unreader = IterUnreader([packet]) + cfg = MockConfig() + + req = UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + + assert req.should_close() is False + + def test_force_close(self): + """Test force_close method.""" + packet = make_uwsgi_packet({'REQUEST_METHOD': 'GET', 'PATH_INFO': '/'}) + unreader = IterUnreader([packet]) + cfg = MockConfig() + + req = UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + req.force_close() + + assert req.should_close() is True + + +class TestUWSGIParser: + """Test UWSGIParser.""" + + def test_parser_iteration(self): + """Test iterating over parser for multiple requests.""" + packet = make_uwsgi_packet({ + 'REQUEST_METHOD': 'GET', + 'PATH_INFO': '/test', + 'HTTP_CONNECTION': 'close', # Single request + }) + cfg = MockConfig() + + # Parser expects an iterable source, not an unreader + parser = UWSGIParser(cfg, [packet], ('127.0.0.1', 12345)) + req = next(parser) + + assert req.method == 'GET' + assert req.path == '/test' + + def test_parser_mesg_class(self): + """Test that parser uses UWSGIRequest.""" + assert UWSGIParser.mesg_class is UWSGIRequest + + +class TestExceptionStrings: + """Test exception string representations.""" + + def test_invalid_uwsgi_header_str(self): + exc = InvalidUWSGIHeader("test message") + assert str(exc) == "Invalid uWSGI header: test message" + assert exc.code == 400 + + def test_unsupported_modifier_str(self): + exc = UnsupportedModifier(5) + assert str(exc) == "Unsupported uWSGI modifier1: 5" + assert exc.code == 501 + + def test_forbidden_uwsgi_request_str(self): + exc = ForbiddenUWSGIRequest("10.0.0.1") + assert str(exc) == "uWSGI request from '10.0.0.1' not allowed" + assert exc.code == 403 + + +class TestUWSGIBody: + """Test body reading.""" + + def test_read_body_in_chunks(self): + """Test reading body in multiple chunks.""" + body = b'A' * 1000 + packet = make_uwsgi_packet_with_body({ + 'REQUEST_METHOD': 'POST', + 'PATH_INFO': '/', + }, body) + unreader = IterUnreader([packet]) + cfg = MockConfig() + + req = UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + + result = b'' + chunk = req.body.read(100) + while chunk: + result += chunk + chunk = req.body.read(100) + + assert result == body + + def test_invalid_content_length(self): + """Test handling of invalid CONTENT_LENGTH.""" + packet = make_uwsgi_packet({ + 'REQUEST_METHOD': 'POST', + 'PATH_INFO': '/', + 'CONTENT_LENGTH': 'invalid', + }) + unreader = IterUnreader([packet]) + cfg = MockConfig() + + req = UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + + # Invalid content length should default to 0 + assert req.body.read() == b'' + + def test_negative_content_length(self): + """Test handling of negative CONTENT_LENGTH.""" + packet = make_uwsgi_packet({ + 'REQUEST_METHOD': 'POST', + 'PATH_INFO': '/', + 'CONTENT_LENGTH': '-5', + }) + unreader = IterUnreader([packet]) + cfg = MockConfig() + + req = UWSGIRequest(cfg, unreader, ('127.0.0.1', 12345)) + + # Negative content length should default to 0 + assert req.body.read() == b'' From ecc471f3b4e1732decd386ee744a21e2553d354a Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 19:06:30 +0100 Subject: [PATCH 024/356] tests: Add Docker integration tests for uWSGI protocol with nginx Add comprehensive integration tests verifying gunicorn's uWSGI binary protocol works correctly with nginx's uwsgi_pass directive. Test categories: - Basic GET/POST requests with query strings and large bodies - Header preservation (custom headers, Host, Content-Type) - HTTP keep-alive connections - Error responses (400-503 status codes) - WSGI environ variables - Large response streaming (1MB) - Concurrent request handling - Edge cases (binary data, unicode, long headers) Architecture: pytest -> nginx:8080 -> uwsgi_pass -> gunicorn:8000 Also adds GitHub Actions workflow that runs on changes to uwsgi module or docker test files. --- .github/workflows/docker-integration.yml | 45 +++ tests/docker/uwsgi/Dockerfile.gunicorn | 16 + tests/docker/uwsgi/Dockerfile.nginx | 12 + tests/docker/uwsgi/README.md | 154 +++++++++ tests/docker/uwsgi/app.py | 222 +++++++++++++ tests/docker/uwsgi/conftest.py | 121 +++++++ tests/docker/uwsgi/docker-compose.yml | 29 ++ tests/docker/uwsgi/nginx.conf | 46 +++ tests/docker/uwsgi/test_uwsgi_integration.py | 312 +++++++++++++++++++ tests/docker/uwsgi/uwsgi_params | 16 + 10 files changed, 973 insertions(+) create mode 100644 .github/workflows/docker-integration.yml create mode 100644 tests/docker/uwsgi/Dockerfile.gunicorn create mode 100644 tests/docker/uwsgi/Dockerfile.nginx create mode 100644 tests/docker/uwsgi/README.md create mode 100644 tests/docker/uwsgi/app.py create mode 100644 tests/docker/uwsgi/conftest.py create mode 100644 tests/docker/uwsgi/docker-compose.yml create mode 100644 tests/docker/uwsgi/nginx.conf create mode 100644 tests/docker/uwsgi/test_uwsgi_integration.py create mode 100644 tests/docker/uwsgi/uwsgi_params diff --git a/.github/workflows/docker-integration.yml b/.github/workflows/docker-integration.yml new file mode 100644 index 000000000..c63c7bff8 --- /dev/null +++ b/.github/workflows/docker-integration.yml @@ -0,0 +1,45 @@ +name: Docker Integration Tests + +on: + push: + branches: [master] + paths: + - 'gunicorn/uwsgi/**' + - 'tests/docker/uwsgi/**' + - '.github/workflows/docker-integration.yml' + pull_request: + paths: + - 'gunicorn/uwsgi/**' + - 'tests/docker/uwsgi/**' + - '.github/workflows/docker-integration.yml' + +permissions: + contents: read + +env: + FORCE_COLOR: 1 + +jobs: + uwsgi-nginx: + name: uWSGI Protocol with nginx + runs-on: ubuntu-latest + timeout-minutes: 15 + + steps: + - uses: actions/checkout@v6 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.12" + cache: pip + cache-dependency-path: requirements_test.txt + + - name: Install test dependencies + run: | + python -m pip install --upgrade pip + python -m pip install pytest requests + + - name: Run uWSGI integration tests + run: | + pytest tests/docker/uwsgi/ -v --tb=short diff --git a/tests/docker/uwsgi/Dockerfile.gunicorn b/tests/docker/uwsgi/Dockerfile.gunicorn new file mode 100644 index 000000000..2fd73a747 --- /dev/null +++ b/tests/docker/uwsgi/Dockerfile.gunicorn @@ -0,0 +1,16 @@ +FROM python:3.11-slim + +WORKDIR /app + +# Copy gunicorn source +COPY . /app/gunicorn-src/ + +# Install gunicorn from source +RUN pip install --no-cache-dir /app/gunicorn-src/ + +# Copy test application +COPY tests/docker/uwsgi/app.py /app/ + +EXPOSE 8000 + +CMD ["gunicorn", "--protocol", "uwsgi", "--uwsgi-allow-from", "*", "--bind", "0.0.0.0:8000", "--workers", "2", "--log-level", "debug", "app:application"] diff --git a/tests/docker/uwsgi/Dockerfile.nginx b/tests/docker/uwsgi/Dockerfile.nginx new file mode 100644 index 000000000..e934a0f75 --- /dev/null +++ b/tests/docker/uwsgi/Dockerfile.nginx @@ -0,0 +1,12 @@ +FROM nginx:alpine + +# Remove default config +RUN rm /etc/nginx/conf.d/default.conf + +# Copy custom config +COPY nginx.conf /etc/nginx/nginx.conf +COPY uwsgi_params /etc/nginx/uwsgi_params + +EXPOSE 8080 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/tests/docker/uwsgi/README.md b/tests/docker/uwsgi/README.md new file mode 100644 index 000000000..d8c78f19c --- /dev/null +++ b/tests/docker/uwsgi/README.md @@ -0,0 +1,154 @@ +# uWSGI Protocol Docker Integration Tests + +This directory contains Docker-based integration tests that verify gunicorn's +uWSGI binary protocol implementation works correctly with nginx's `uwsgi_pass` +directive. + +## Architecture + +``` +[pytest] --HTTP--> [nginx:8080] --uwsgi_pass--> [gunicorn:8000] +``` + +The tests make HTTP requests to nginx, which proxies them to gunicorn using the +uWSGI binary protocol. This validates the complete request/response cycle through +the protocol. + +## Prerequisites + +- Docker +- Docker Compose (v2) +- Python 3.8+ +- pytest +- requests + +## Running Tests + +### From repository root: + +```bash +# Run all uWSGI integration tests +pytest tests/docker/uwsgi/ -v + +# Run specific test class +pytest tests/docker/uwsgi/ -v -k TestBasicRequests + +# Skip Docker tests (for CI environments without Docker) +pytest tests/ -v -m "not docker" +``` + +### Manual testing: + +```bash +cd tests/docker/uwsgi + +# Start services +docker compose up -d + +# Wait for services to be healthy +docker compose ps + +# Test endpoints +curl http://localhost:8080/ +curl -X POST -d "test body" http://localhost:8080/echo +curl http://localhost:8080/headers +curl "http://localhost:8080/query?foo=bar" +curl http://localhost:8080/environ +curl http://localhost:8080/error/404 +curl http://localhost:8080/large > /dev/null # 1MB response + +# View logs +docker compose logs gunicorn +docker compose logs nginx + +# Stop services +docker compose down -v +``` + +## Test Categories + +| Category | Description | +|----------|-------------| +| `TestBasicRequests` | GET, POST, query strings, large bodies | +| `TestHeaderPreservation` | Custom headers, Host, Content-Type, User-Agent | +| `TestKeepAlive` | Multiple requests per connection | +| `TestErrorResponses` | HTTP error codes (400, 404, 500, etc.) | +| `TestEnvironVariables` | WSGI environ: REQUEST_METHOD, PATH_INFO, etc. | +| `TestLargeResponses` | 1MB response body streaming | +| `TestConcurrency` | Parallel request handling | +| `TestSpecialCases` | Edge cases: binary data, unicode, long headers | + +## Files + +| File | Purpose | +|------|---------| +| `docker-compose.yml` | Orchestrates nginx + gunicorn containers | +| `Dockerfile.gunicorn` | Builds gunicorn image with test app | +| `Dockerfile.nginx` | Builds nginx with uwsgi config | +| `nginx.conf` | nginx configuration using `uwsgi_pass` | +| `uwsgi_params` | Standard uwsgi parameter mappings | +| `app.py` | Test WSGI application with multiple endpoints | +| `conftest.py` | pytest fixtures for Docker lifecycle | +| `test_uwsgi_integration.py` | Test cases | + +## Test App Endpoints + +| Endpoint | Method | Description | +|----------|--------|-------------| +| `/` | GET | Basic hello response | +| `/echo` | POST | Echo request body | +| `/headers` | GET/POST | Return received headers as JSON | +| `/environ` | GET/POST | Return WSGI environ as JSON | +| `/query` | GET | Return query params as JSON | +| `/json` | POST | Parse and echo JSON body | +| `/error/{code}` | GET | Return specified HTTP error | +| `/large` | GET | Return 1MB response | + +## Gunicorn Configuration + +The gunicorn container runs with: + +```bash +gunicorn \ + --protocol uwsgi \ + --uwsgi-allow-from "*" \ + --bind 0.0.0.0:8000 \ + --workers 2 \ + --log-level debug \ + app:application +``` + +Key settings: +- `--protocol uwsgi`: Enable uWSGI binary protocol +- `--uwsgi-allow-from "*"`: Accept connections from Docker network IPs + +## Troubleshooting + +### Services won't start + +Check Docker logs: +```bash +docker compose logs +``` + +### Connection refused + +Wait for health checks: +```bash +docker compose ps # Check health status +``` + +### Tests timing out + +Increase `STARTUP_TIMEOUT` in `conftest.py` or check if ports are in use: +```bash +lsof -i :8080 +lsof -i :8000 +``` + +### Rebuild after code changes + +```bash +docker compose build --no-cache +docker compose up -d +``` diff --git a/tests/docker/uwsgi/app.py b/tests/docker/uwsgi/app.py new file mode 100644 index 000000000..6eb681cfd --- /dev/null +++ b/tests/docker/uwsgi/app.py @@ -0,0 +1,222 @@ +""" +Test WSGI application for uWSGI protocol integration tests. + +This application provides various endpoints to test different aspects +of the uWSGI binary protocol when proxied through nginx. +""" + +import json + + +def application(environ, start_response): + """Main WSGI application entry point.""" + path = environ.get('PATH_INFO', '/') + method = environ.get('REQUEST_METHOD', 'GET') + + # Route to appropriate handler + if path == '/': + return handle_root(environ, start_response) + elif path == '/echo': + return handle_echo(environ, start_response) + elif path == '/headers': + return handle_headers(environ, start_response) + elif path == '/environ': + return handle_environ(environ, start_response) + elif path.startswith('/error/'): + return handle_error(environ, start_response, path) + elif path == '/large': + return handle_large(environ, start_response) + elif path == '/json': + return handle_json(environ, start_response) + elif path == '/query': + return handle_query(environ, start_response) + else: + return handle_not_found(environ, start_response) + + +def handle_root(environ, start_response): + """Basic root endpoint.""" + status = '200 OK' + headers = [('Content-Type', 'text/plain')] + start_response(status, headers) + return [b'Hello from gunicorn uWSGI!\n'] + + +def handle_echo(environ, start_response): + """Echo back the request body.""" + try: + content_length = int(environ.get('CONTENT_LENGTH', 0)) + except (ValueError, TypeError): + content_length = 0 + + body = b'' + if content_length > 0: + body = environ['wsgi.input'].read(content_length) + + status = '200 OK' + headers = [ + ('Content-Type', 'application/octet-stream'), + ('Content-Length', str(len(body))) + ] + start_response(status, headers) + return [body] + + +def handle_headers(environ, start_response): + """Return received HTTP headers as JSON.""" + headers_dict = {} + for key, value in environ.items(): + if key.startswith('HTTP_'): + # Convert HTTP_X_CUSTOM_HEADER to X-Custom-Header + header_name = key[5:].replace('_', '-').title() + headers_dict[header_name] = value + + # Also include some special headers + if 'CONTENT_TYPE' in environ: + headers_dict['Content-Type'] = environ['CONTENT_TYPE'] + if 'CONTENT_LENGTH' in environ: + headers_dict['Content-Length'] = environ['CONTENT_LENGTH'] + + body = json.dumps(headers_dict, indent=2).encode('utf-8') + status = '200 OK' + headers = [ + ('Content-Type', 'application/json'), + ('Content-Length', str(len(body))) + ] + start_response(status, headers) + return [body] + + +def handle_environ(environ, start_response): + """Return WSGI environ variables as JSON.""" + # Filter to serializable values + safe_environ = {} + skip_keys = {'wsgi.input', 'wsgi.errors', 'wsgi.file_wrapper'} + + for key, value in environ.items(): + if key in skip_keys: + continue + try: + # Test if value is JSON serializable + json.dumps(value) + safe_environ[key] = value + except (TypeError, ValueError): + safe_environ[key] = str(value) + + body = json.dumps(safe_environ, indent=2).encode('utf-8') + status = '200 OK' + headers = [ + ('Content-Type', 'application/json'), + ('Content-Length', str(len(body))) + ] + start_response(status, headers) + return [body] + + +def handle_error(environ, start_response, path): + """Return specified HTTP error code.""" + try: + code = int(path.split('/')[-1]) + except ValueError: + code = 500 + + status_messages = { + 400: 'Bad Request', + 401: 'Unauthorized', + 403: 'Forbidden', + 404: 'Not Found', + 500: 'Internal Server Error', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + } + + message = status_messages.get(code, 'Error') + status = f'{code} {message}' + body = json.dumps({'error': message, 'code': code}).encode('utf-8') + + headers = [ + ('Content-Type', 'application/json'), + ('Content-Length', str(len(body))) + ] + start_response(status, headers) + return [body] + + +def handle_large(environ, start_response): + """Return a 1MB response body for testing large responses.""" + # Generate 1MB of data (1024 * 1024 bytes) + chunk_size = 1024 + num_chunks = 1024 + chunk = b'X' * chunk_size + + status = '200 OK' + headers = [ + ('Content-Type', 'application/octet-stream'), + ('Content-Length', str(chunk_size * num_chunks)) + ] + start_response(status, headers) + + # Return as generator for streaming + def generate(): + for _ in range(num_chunks): + yield chunk + + return generate() + + +def handle_json(environ, start_response): + """Handle JSON POST requests.""" + try: + content_length = int(environ.get('CONTENT_LENGTH', 0)) + except (ValueError, TypeError): + content_length = 0 + + if content_length > 0: + body = environ['wsgi.input'].read(content_length) + try: + data = json.loads(body.decode('utf-8')) + response = {'received': data, 'status': 'ok'} + except json.JSONDecodeError: + response = {'error': 'Invalid JSON', 'status': 'error'} + else: + response = {'error': 'No body', 'status': 'error'} + + body = json.dumps(response).encode('utf-8') + status = '200 OK' + headers = [ + ('Content-Type', 'application/json'), + ('Content-Length', str(len(body))) + ] + start_response(status, headers) + return [body] + + +def handle_query(environ, start_response): + """Return query string parameters as JSON.""" + from urllib.parse import parse_qs + query_string = environ.get('QUERY_STRING', '') + params = parse_qs(query_string) + + # Convert lists to single values where appropriate + simple_params = {k: v[0] if len(v) == 1 else v for k, v in params.items()} + + body = json.dumps(simple_params).encode('utf-8') + status = '200 OK' + headers = [ + ('Content-Type', 'application/json'), + ('Content-Length', str(len(body))) + ] + start_response(status, headers) + return [body] + + +def handle_not_found(environ, start_response): + """Handle 404 for unknown paths.""" + body = json.dumps({'error': 'Not Found', 'path': environ.get('PATH_INFO')}).encode('utf-8') + status = '404 Not Found' + headers = [ + ('Content-Type', 'application/json'), + ('Content-Length', str(len(body))) + ] + start_response(status, headers) + return [body] diff --git a/tests/docker/uwsgi/conftest.py b/tests/docker/uwsgi/conftest.py new file mode 100644 index 000000000..a31e0de31 --- /dev/null +++ b/tests/docker/uwsgi/conftest.py @@ -0,0 +1,121 @@ +""" +pytest fixtures for uWSGI Docker integration tests. +""" + +import os +import subprocess +import time + +import pytest +import requests + + +COMPOSE_FILE = os.path.join(os.path.dirname(__file__), 'docker-compose.yml') +NGINX_URL = 'http://127.0.0.1:8080' +STARTUP_TIMEOUT = 60 # seconds + + +def is_docker_available(): + """Check if Docker is available.""" + try: + result = subprocess.run( + ['docker', 'info'], + capture_output=True, + timeout=10 + ) + return result.returncode == 0 + except (subprocess.TimeoutExpired, FileNotFoundError): + return False + + +def is_compose_available(): + """Check if docker compose is available.""" + try: + result = subprocess.run( + ['docker', 'compose', 'version'], + capture_output=True, + timeout=10 + ) + return result.returncode == 0 + except (subprocess.TimeoutExpired, FileNotFoundError): + return False + + +docker_available = pytest.mark.skipif( + not is_docker_available() or not is_compose_available(), + reason="Docker or docker compose not available" +) + + +@pytest.fixture(scope='session') +def docker_services(): + """ + Start Docker Compose services for the test session. + + This fixture builds and starts the gunicorn and nginx containers, + waits for them to be healthy, and tears them down after all tests. + """ + if not is_docker_available() or not is_compose_available(): + pytest.skip("Docker or docker compose not available") + + # Build and start services + subprocess.run( + ['docker', 'compose', '-f', COMPOSE_FILE, 'build'], + check=True, + capture_output=True + ) + + subprocess.run( + ['docker', 'compose', '-f', COMPOSE_FILE, 'up', '-d'], + check=True, + capture_output=True + ) + + # Wait for services to be healthy + start_time = time.time() + while time.time() - start_time < STARTUP_TIMEOUT: + try: + response = requests.get(f'{NGINX_URL}/', timeout=2) + if response.status_code == 200: + break + except requests.RequestException: + pass + time.sleep(1) + else: + # Get logs for debugging + logs = subprocess.run( + ['docker', 'compose', '-f', COMPOSE_FILE, 'logs'], + capture_output=True, + text=True + ) + subprocess.run( + ['docker', 'compose', '-f', COMPOSE_FILE, 'down', '-v'], + capture_output=True + ) + pytest.fail( + f"Services did not become healthy within {STARTUP_TIMEOUT}s.\n" + f"Logs:\n{logs.stdout}\n{logs.stderr}" + ) + + yield + + # Teardown + subprocess.run( + ['docker', 'compose', '-f', COMPOSE_FILE, 'down', '-v'], + capture_output=True + ) + + +@pytest.fixture +def nginx_url(docker_services): + """Return the nginx base URL.""" + return NGINX_URL + + +@pytest.fixture +def session(docker_services): + """Return a requests Session with keep-alive enabled.""" + with requests.Session() as s: + # Enable keep-alive + s.headers['Connection'] = 'keep-alive' + yield s diff --git a/tests/docker/uwsgi/docker-compose.yml b/tests/docker/uwsgi/docker-compose.yml new file mode 100644 index 000000000..71c303553 --- /dev/null +++ b/tests/docker/uwsgi/docker-compose.yml @@ -0,0 +1,29 @@ +services: + gunicorn: + build: + context: ../../.. + dockerfile: tests/docker/uwsgi/Dockerfile.gunicorn + expose: + - "8000" + healthcheck: + test: ["CMD", "python", "-c", "import socket; s=socket.socket(); s.connect(('localhost', 8000)); s.close()"] + interval: 2s + timeout: 5s + retries: 10 + start_period: 5s + + nginx: + build: + context: . + dockerfile: Dockerfile.nginx + ports: + - "8080:8080" + depends_on: + gunicorn: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8080/"] + interval: 2s + timeout: 5s + retries: 10 + start_period: 5s diff --git a/tests/docker/uwsgi/nginx.conf b/tests/docker/uwsgi/nginx.conf new file mode 100644 index 000000000..052f4f81b --- /dev/null +++ b/tests/docker/uwsgi/nginx.conf @@ -0,0 +1,46 @@ +worker_processes 1; + +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent"'; + + access_log /var/log/nginx/access.log main; + error_log /var/log/nginx/error.log debug; + + sendfile on; + keepalive_timeout 65; + + upstream gunicorn { + server gunicorn:8000; + } + + server { + listen 8080; + server_name localhost; + + # Increase buffer sizes for large headers + uwsgi_buffer_size 32k; + uwsgi_buffers 8 32k; + uwsgi_busy_buffers_size 64k; + + # Read timeout for large responses + uwsgi_read_timeout 300s; + + location / { + uwsgi_pass gunicorn; + include uwsgi_params; + + # Pass additional headers + uwsgi_param HTTP_X_FORWARDED_FOR $proxy_add_x_forwarded_for; + uwsgi_param HTTP_X_REAL_IP $remote_addr; + } + } +} diff --git a/tests/docker/uwsgi/test_uwsgi_integration.py b/tests/docker/uwsgi/test_uwsgi_integration.py new file mode 100644 index 000000000..eea9a9e50 --- /dev/null +++ b/tests/docker/uwsgi/test_uwsgi_integration.py @@ -0,0 +1,312 @@ +""" +Integration tests for gunicorn's uWSGI binary protocol with nginx. + +These tests verify that gunicorn correctly implements the uWSGI binary +protocol by running actual requests through nginx's uwsgi_pass directive. +""" + +import concurrent.futures +import json + +import pytest +import requests + +from conftest import docker_available + + +@docker_available +class TestBasicRequests: + """Test basic HTTP request handling through uWSGI protocol.""" + + def test_get_root(self, nginx_url): + """Test basic GET request to root endpoint.""" + response = requests.get(f'{nginx_url}/') + assert response.status_code == 200 + assert b'Hello from gunicorn uWSGI!' in response.content + + def test_get_with_query_string(self, nginx_url): + """Test GET request with query string parameters.""" + response = requests.get(f'{nginx_url}/query?foo=bar&baz=qux') + assert response.status_code == 200 + data = response.json() + assert data['foo'] == 'bar' + assert data['baz'] == 'qux' + + def test_post_echo(self, nginx_url): + """Test POST request with body echo.""" + test_body = b'This is a test body content' + response = requests.post(f'{nginx_url}/echo', data=test_body) + assert response.status_code == 200 + assert response.content == test_body + + def test_post_json(self, nginx_url): + """Test POST request with JSON body.""" + test_data = {'key': 'value', 'number': 42, 'nested': {'a': 1}} + response = requests.post( + f'{nginx_url}/json', + json=test_data, + headers={'Content-Type': 'application/json'} + ) + assert response.status_code == 200 + data = response.json() + assert data['status'] == 'ok' + assert data['received'] == test_data + + def test_post_large_body(self, nginx_url): + """Test POST with large request body (100KB).""" + large_body = b'X' * (100 * 1024) + response = requests.post(f'{nginx_url}/echo', data=large_body) + assert response.status_code == 200 + assert len(response.content) == len(large_body) + assert response.content == large_body + + +@docker_available +class TestHeaderPreservation: + """Test that headers are correctly passed through uWSGI protocol.""" + + def test_custom_headers(self, nginx_url): + """Test custom headers are passed to the application.""" + custom_headers = { + 'X-Custom-Header': 'custom-value', + 'X-Another-Header': 'another-value' + } + response = requests.get(f'{nginx_url}/headers', headers=custom_headers) + assert response.status_code == 200 + data = response.json() + assert data.get('X-Custom-Header') == 'custom-value' + assert data.get('X-Another-Header') == 'another-value' + + def test_host_header(self, nginx_url): + """Test Host header is passed correctly.""" + response = requests.get( + f'{nginx_url}/headers', + headers={'Host': 'test.example.com'} + ) + assert response.status_code == 200 + data = response.json() + assert data.get('Host') == 'test.example.com' + + def test_content_type_header(self, nginx_url): + """Test Content-Type header is passed correctly.""" + response = requests.post( + f'{nginx_url}/headers', + data='test', + headers={'Content-Type': 'application/x-custom-type'} + ) + assert response.status_code == 200 + data = response.json() + assert data.get('Content-Type') == 'application/x-custom-type' + + def test_user_agent_header(self, nginx_url): + """Test User-Agent header is passed correctly.""" + response = requests.get( + f'{nginx_url}/headers', + headers={'User-Agent': 'TestAgent/1.0'} + ) + assert response.status_code == 200 + data = response.json() + assert data.get('User-Agent') == 'TestAgent/1.0' + + +@docker_available +class TestKeepAlive: + """Test HTTP keep-alive with multiple requests per connection.""" + + def test_multiple_requests_same_session(self, session, nginx_url): + """Test multiple requests using same session/connection.""" + for i in range(5): + response = session.get(f'{nginx_url}/') + assert response.status_code == 200 + + def test_mixed_requests_same_session(self, session, nginx_url): + """Test mixed GET and POST requests using same session.""" + # GET request + response = session.get(f'{nginx_url}/') + assert response.status_code == 200 + + # POST request + response = session.post(f'{nginx_url}/echo', data=b'test') + assert response.status_code == 200 + assert response.content == b'test' + + # Another GET + response = session.get(f'{nginx_url}/headers') + assert response.status_code == 200 + + # JSON POST + response = session.post(f'{nginx_url}/json', json={'test': 1}) + assert response.status_code == 200 + + +@docker_available +class TestErrorResponses: + """Test HTTP error responses through uWSGI protocol.""" + + @pytest.mark.parametrize('code', [400, 401, 403, 404, 500, 502, 503]) + def test_error_codes(self, nginx_url, code): + """Test various HTTP error codes are returned correctly.""" + response = requests.get(f'{nginx_url}/error/{code}') + assert response.status_code == code + data = response.json() + assert data['code'] == code + + def test_not_found(self, nginx_url): + """Test 404 for non-existent path.""" + response = requests.get(f'{nginx_url}/nonexistent/path') + assert response.status_code == 404 + data = response.json() + assert data['error'] == 'Not Found' + assert data['path'] == '/nonexistent/path' + + +@docker_available +class TestEnvironVariables: + """Test WSGI environ variables are correctly set.""" + + def test_request_method(self, nginx_url): + """Test REQUEST_METHOD is set correctly.""" + response = requests.get(f'{nginx_url}/environ') + assert response.status_code == 200 + data = response.json() + assert data.get('REQUEST_METHOD') == 'GET' + + response = requests.post(f'{nginx_url}/environ', data='') + data = response.json() + assert data.get('REQUEST_METHOD') == 'POST' + + def test_path_info(self, nginx_url): + """Test PATH_INFO is set correctly.""" + response = requests.get(f'{nginx_url}/environ') + assert response.status_code == 200 + data = response.json() + assert data.get('PATH_INFO') == '/environ' + + def test_query_string(self, nginx_url): + """Test QUERY_STRING is set correctly.""" + response = requests.get(f'{nginx_url}/environ?foo=bar&test=123') + assert response.status_code == 200 + data = response.json() + assert data.get('QUERY_STRING') == 'foo=bar&test=123' + + def test_server_protocol(self, nginx_url): + """Test SERVER_PROTOCOL is set.""" + response = requests.get(f'{nginx_url}/environ') + assert response.status_code == 200 + data = response.json() + assert 'SERVER_PROTOCOL' in data + assert data['SERVER_PROTOCOL'].startswith('HTTP/') + + def test_content_length(self, nginx_url): + """Test CONTENT_LENGTH is set for POST requests.""" + body = 'test body content' + response = requests.post(f'{nginx_url}/environ', data=body) + assert response.status_code == 200 + data = response.json() + assert data.get('CONTENT_LENGTH') == str(len(body)) + + +@docker_available +class TestLargeResponses: + """Test large response handling through uWSGI protocol.""" + + def test_1mb_response(self, nginx_url): + """Test 1MB response body is received correctly.""" + response = requests.get(f'{nginx_url}/large') + assert response.status_code == 200 + assert len(response.content) == 1024 * 1024 + # Verify content is all 'X' characters + assert response.content == b'X' * (1024 * 1024) + + def test_large_response_content_length(self, nginx_url): + """Test Content-Length header for large response.""" + response = requests.get(f'{nginx_url}/large') + assert response.status_code == 200 + assert response.headers.get('Content-Length') == str(1024 * 1024) + + +@docker_available +class TestConcurrency: + """Test concurrent request handling.""" + + def test_parallel_requests(self, nginx_url): + """Test handling multiple parallel requests.""" + num_requests = 20 + + def make_request(i): + response = requests.get(f'{nginx_url}/query?id={i}') + return response.status_code, response.json().get('id') + + with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor: + futures = [executor.submit(make_request, i) for i in range(num_requests)] + results = [f.result() for f in concurrent.futures.as_completed(futures)] + + # All requests should succeed + assert all(status == 200 for status, _ in results) + # All IDs should be present + ids = set(id_val for _, id_val in results) + assert ids == set(str(i) for i in range(num_requests)) + + def test_parallel_mixed_requests(self, nginx_url): + """Test parallel GET and POST requests.""" + def get_request(): + return requests.get(f'{nginx_url}/').status_code + + def post_request(data): + response = requests.post(f'{nginx_url}/echo', data=data) + return response.status_code, response.content + + with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor: + get_futures = [executor.submit(get_request) for _ in range(10)] + post_futures = [ + executor.submit(post_request, f'data-{i}'.encode()) + for i in range(10) + ] + + get_results = [f.result() for f in get_futures] + post_results = [f.result() for f in post_futures] + + assert all(status == 200 for status in get_results) + assert all(status == 200 for status, _ in post_results) + + +@docker_available +class TestSpecialCases: + """Test edge cases and special scenarios.""" + + def test_empty_body_post(self, nginx_url): + """Test POST with empty body.""" + response = requests.post(f'{nginx_url}/echo', data=b'') + assert response.status_code == 200 + assert response.content == b'' + + def test_binary_body(self, nginx_url): + """Test POST with binary body containing null bytes.""" + binary_data = bytes(range(256)) + response = requests.post(f'{nginx_url}/echo', data=binary_data) + assert response.status_code == 200 + assert response.content == binary_data + + def test_unicode_in_query_string(self, nginx_url): + """Test unicode characters in query string.""" + response = requests.get(f'{nginx_url}/query', params={'name': 'test'}) + assert response.status_code == 200 + data = response.json() + assert data.get('name') == 'test' + + def test_special_characters_in_path(self, nginx_url): + """Test handling of special path that triggers 404.""" + # This should return 404 since the path doesn't exist + response = requests.get(f'{nginx_url}/path/with/slashes') + assert response.status_code == 404 + + def test_long_header_value(self, nginx_url): + """Test handling of long header values.""" + long_value = 'X' * 4096 # 4KB header value + response = requests.get( + f'{nginx_url}/headers', + headers={'X-Long-Header': long_value} + ) + assert response.status_code == 200 + data = response.json() + assert data.get('X-Long-Header') == long_value diff --git a/tests/docker/uwsgi/uwsgi_params b/tests/docker/uwsgi/uwsgi_params new file mode 100644 index 000000000..5abf809bd --- /dev/null +++ b/tests/docker/uwsgi/uwsgi_params @@ -0,0 +1,16 @@ +uwsgi_param QUERY_STRING $query_string; +uwsgi_param REQUEST_METHOD $request_method; +uwsgi_param CONTENT_TYPE $content_type; +uwsgi_param CONTENT_LENGTH $content_length; + +uwsgi_param REQUEST_URI $request_uri; +uwsgi_param PATH_INFO $document_uri; +uwsgi_param DOCUMENT_ROOT $document_root; +uwsgi_param SERVER_PROTOCOL $server_protocol; +uwsgi_param REQUEST_SCHEME $scheme; +uwsgi_param HTTPS $https if_not_empty; + +uwsgi_param REMOTE_ADDR $remote_addr; +uwsgi_param REMOTE_PORT $remote_port; +uwsgi_param SERVER_PORT $server_port; +uwsgi_param SERVER_NAME $server_name; From 99ffa0cc6b1bb199c27cf42d5ececf3487274e41 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 19:24:30 +0100 Subject: [PATCH 025/356] tests: Exclude docker tests from regular pytest runs - Add tests/docker to norecursedirs in pyproject.toml to prevent docker tests from running during regular test suite (they require docker and the requests library) - Add -p no:cov to docker integration workflow to disable coverage plugin since pytest-cov is not installed in that environment --- .github/workflows/docker-integration.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-integration.yml b/.github/workflows/docker-integration.yml index c63c7bff8..2e9187801 100644 --- a/.github/workflows/docker-integration.yml +++ b/.github/workflows/docker-integration.yml @@ -42,4 +42,4 @@ jobs: - name: Run uWSGI integration tests run: | - pytest tests/docker/uwsgi/ -v --tb=short + pytest tests/docker/uwsgi/ -v --tb=short -p no:cov diff --git a/pyproject.toml b/pyproject.toml index 7803dc55f..3fecbd301 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,7 +71,7 @@ main = "gunicorn.app.pasterapp:serve" [tool.pytest.ini_options] # # can override these: python -m pytest --override-ini="addopts=" -norecursedirs = ["examples", "lib", "local", "src"] +norecursedirs = ["examples", "lib", "local", "src", "tests/docker"] testpaths = ["tests/"] addopts = "--assert=plain --cov=gunicorn --cov-report=xml" From 1521266e2fda309f590dac365b47521615279b0e Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 19:28:11 +0100 Subject: [PATCH 026/356] asgi/uwsgi: Address PR review feedback - asgi: Check HTTP method is GET for WebSocket upgrade per RFC 6455 Section 4.1. Previously HEAD and other methods with upgrade headers could trigger WebSocket handling. - uwsgi: Add detailed docstring explaining header mapping from CGI-style environment variables to HTTP headers, including the lossy nature of underscore-to-hyphen conversion. --- gunicorn/asgi/protocol.py | 12 +++++++++++- gunicorn/uwsgi/message.py | 27 +++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/gunicorn/asgi/protocol.py b/gunicorn/asgi/protocol.py index 0eb1d045b..01569ce4a 100644 --- a/gunicorn/asgi/protocol.py +++ b/gunicorn/asgi/protocol.py @@ -143,7 +143,17 @@ async def _handle_connection(self): self._close_transport() def _is_websocket_upgrade(self, request): - """Check if request is a WebSocket upgrade.""" + """Check if request is a WebSocket upgrade. + + Per RFC 6455 Section 4.1, the opening handshake requires: + - HTTP method MUST be GET + - Upgrade header MUST be "websocket" (case-insensitive) + - Connection header MUST contain "Upgrade" + """ + # RFC 6455: The method of the request MUST be GET + if request.method != "GET": + return False + upgrade = None connection = None for name, value in request.headers: diff --git a/gunicorn/uwsgi/message.py b/gunicorn/uwsgi/message.py index a63172ebc..db69b5e2d 100644 --- a/gunicorn/uwsgi/message.py +++ b/gunicorn/uwsgi/message.py @@ -172,7 +172,29 @@ def _parse_vars(self, data): var_count += 1 def _extract_request_info(self): - """Extract HTTP request info from uWSGI vars.""" + """Extract HTTP request info from uWSGI vars. + + Header Mapping (CGI/WSGI to HTTP): + + The uWSGI protocol passes HTTP headers using CGI-style environment + variable naming. This method converts them back to HTTP header format: + + - HTTP_* vars: Strip 'HTTP_' prefix, replace '_' with '-' + Example: HTTP_X_FORWARDED_FOR -> X-FORWARDED-FOR + Example: HTTP_ACCEPT_ENCODING -> ACCEPT-ENCODING + + - CONTENT_TYPE: Mapped directly to CONTENT-TYPE header + (CGI spec excludes HTTP_ prefix for this header) + + - CONTENT_LENGTH: Mapped directly to CONTENT-LENGTH header + (CGI spec excludes HTTP_ prefix for this header) + + Note: The underscore-to-hyphen conversion is lossy. Headers that + originally contained underscores (e.g., X_Custom_Header) cannot be + distinguished from hyphenated headers (X-Custom-Header) after + passing through nginx/uWSGI. This is a CGI/WSGI specification + limitation, not specific to this implementation. + """ # Method self.method = self.uwsgi_vars.get('REQUEST_METHOD', 'GET') @@ -192,7 +214,8 @@ def _extract_request_info(self): elif 'wsgi.url_scheme' in self.uwsgi_vars: self.scheme = self.uwsgi_vars['wsgi.url_scheme'] - # Extract HTTP headers (HTTP_* vars) + # Extract HTTP headers from CGI-style vars + # See docstring above for mapping details for key, value in self.uwsgi_vars.items(): if key.startswith('HTTP_'): # Convert HTTP_HEADER_NAME to HEADER-NAME From 81b653457c72b506ab85b66ef92c78f101f59dbf Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 19:33:57 +0100 Subject: [PATCH 027/356] ci: Fix test dependencies for Docker and FreeBSD workflows - Docker integration: Install pytest-cov to support coverage addopts - FreeBSD: Install pytest-asyncio for ASGI async test support --- .github/workflows/docker-integration.yml | 4 ++-- .github/workflows/freebsd.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-integration.yml b/.github/workflows/docker-integration.yml index 2e9187801..1333b103c 100644 --- a/.github/workflows/docker-integration.yml +++ b/.github/workflows/docker-integration.yml @@ -38,8 +38,8 @@ jobs: - name: Install test dependencies run: | python -m pip install --upgrade pip - python -m pip install pytest requests + python -m pip install pytest pytest-cov requests - name: Run uWSGI integration tests run: | - pytest tests/docker/uwsgi/ -v --tb=short -p no:cov + pytest tests/docker/uwsgi/ -v --tb=short diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index 060f40cab..120cc9096 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -40,7 +40,7 @@ jobs: python${{ matrix.python-version }} -m venv venv . venv/bin/activate pip install --upgrade pip - pip install pytest pytest-cov coverage + pip install pytest pytest-cov pytest-asyncio coverage pip install -e . pytest --cov=gunicorn -v tests/ \ --ignore=tests/workers/test_ggevent.py \ From 4b9d787c933cfaec7151df17c27a6c70b3d46edc Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 00:02:01 +0100 Subject: [PATCH 028/356] tornado: Require Tornado 6.5.0+ for security fixes Update minimum Tornado version to 6.5.0 to address: - CVE-2024-52804 (Medium): HTTP Cookie Parsing DoS - CVE-2025-47287 (High 7.5): Multipart/Form-Data Parser DoS This simplifies the tornado worker by removing legacy code paths for Tornado < 5.0 and < 6.0, reducing the codebase by ~30%. Changes: - pyproject.toml: Update tornado requirement to >=6.5.0 - gtornado.py: Remove TORNADO5 constant and legacy code paths - tornadoapp.py: Update example to use async/await syntax - test_gtornado.py: Add comprehensive test suite --- examples/frameworks/tornadoapp.py | 14 +- gunicorn/workers/gtornado.py | 84 +---- pyproject.toml | 2 +- tests/test_gtornado.py | 511 ++++++++++++++++++++++++++++++ 4 files changed, 537 insertions(+), 74 deletions(-) create mode 100644 tests/test_gtornado.py diff --git a/examples/frameworks/tornadoapp.py b/examples/frameworks/tornadoapp.py index 0285fcd5c..fdf5b5d27 100644 --- a/examples/frameworks/tornadoapp.py +++ b/examples/frameworks/tornadoapp.py @@ -7,23 +7,27 @@ # $ gunicorn -k tornado tornadoapp:app # +import asyncio import tornado.ioloop import tornado.web -from tornado import gen + class MainHandler(tornado.web.RequestHandler): - @gen.coroutine - def get(self): + async def get(self): # Your asynchronous code here - yield gen.sleep(1) # Example of an asynchronous operation + await asyncio.sleep(1) # Example of an asynchronous operation self.write("Hello, World!") + def make_app(): return tornado.web.Application([ (r"/", MainHandler), ]) + +app = make_app() + + if __name__ == "__main__": - app = make_app() app.listen(8888) tornado.ioloop.IOLoop.current().start() diff --git a/gunicorn/workers/gtornado.py b/gunicorn/workers/gtornado.py index 544af7d09..cac0f925d 100644 --- a/gunicorn/workers/gtornado.py +++ b/gunicorn/workers/gtornado.py @@ -18,15 +18,6 @@ from gunicorn.sock import ssl_context -# Tornado 5.0 updated its IOLoop, and the `io_loop` arguments to many -# Tornado functions have been removed in Tornado 5.0. Also, they no -# longer store PeriodCallbacks in ioloop._callbacks. Instead we store -# them on our side, and use stop() on them when stopping the worker. -# See https://www.tornadoweb.org/en/stable/releases/v5.0.0.html#backwards-compatibility-notes -# for more details. -TORNADO5 = tornado.version_info >= (5, 0, 0) - - class TornadoWorker(Worker): @classmethod @@ -69,13 +60,9 @@ def heartbeat(self): pass self.server_alive = False else: - if TORNADO5: - for callback in self.callbacks: - callback.stop() - self.ioloop.stop() - else: - if not self.ioloop._callbacks: - self.ioloop.stop() + for callback in self.callbacks: + callback.stop() + self.ioloop.stop() def init_process(self): # IOLoop cannot survive a fork or be shared across processes @@ -90,75 +77,36 @@ def run(self): self.alive = True self.server_alive = False - if TORNADO5: - self.callbacks = [] - self.callbacks.append(PeriodicCallback(self.watchdog, 1000)) - self.callbacks.append(PeriodicCallback(self.heartbeat, 1000)) - for callback in self.callbacks: - callback.start() - else: - PeriodicCallback(self.watchdog, 1000, io_loop=self.ioloop).start() - PeriodicCallback(self.heartbeat, 1000, io_loop=self.ioloop).start() + self.callbacks = [] + self.callbacks.append(PeriodicCallback(self.watchdog, 1000)) + self.callbacks.append(PeriodicCallback(self.heartbeat, 1000)) + for callback in self.callbacks: + callback.start() # Assume the app is a WSGI callable if its not an - # instance of tornado.web.Application or is an - # instance of tornado.wsgi.WSGIApplication + # instance of tornado.web.Application or WSGIContainer app = self.wsgi - - if tornado.version_info[0] < 6: - if not isinstance(app, tornado.web.Application) or \ - isinstance(app, tornado.wsgi.WSGIApplication): - app = WSGIContainer(app) - elif not isinstance(app, WSGIContainer) and \ + if not isinstance(app, WSGIContainer) and \ not isinstance(app, tornado.web.Application): app = WSGIContainer(app) - # Monkey-patching HTTPConnection.finish to count the - # number of requests being handled by Tornado. This - # will help gunicorn shutdown the worker if max_requests - # is exceeded. - httpserver = sys.modules["tornado.httpserver"] - if hasattr(httpserver, 'HTTPConnection'): - old_connection_finish = httpserver.HTTPConnection.finish + class _HTTPServer(tornado.httpserver.HTTPServer): - def finish(other): + def on_close(instance, server_conn): self.handle_request() - old_connection_finish(other) - httpserver.HTTPConnection.finish = finish - sys.modules["tornado.httpserver"] = httpserver - - server_class = tornado.httpserver.HTTPServer - else: - - class _HTTPServer(tornado.httpserver.HTTPServer): - - def on_close(instance, server_conn): - self.handle_request() - super().on_close(server_conn) - - server_class = _HTTPServer + super().on_close(server_conn) if self.cfg.is_ssl: - if TORNADO5: - server = server_class(app, ssl_options=ssl_context(self.cfg)) - else: - server = server_class(app, io_loop=self.ioloop, - ssl_options=ssl_context(self.cfg)) + server = _HTTPServer(app, ssl_options=ssl_context(self.cfg)) else: - if TORNADO5: - server = server_class(app) - else: - server = server_class(app, io_loop=self.ioloop) + server = _HTTPServer(app) self.server = server self.server_alive = True for s in self.sockets: s.setblocking(0) - if hasattr(server, "add_socket"): # tornado > 2.0 - server.add_socket(s) - elif hasattr(server, "_sockets"): # tornado 2.0 - server._sockets[s.fileno()] = s + server.add_socket(s) server.no_keep_alive = self.cfg.keepalive <= 0 server.start(num_processes=1) diff --git a/pyproject.toml b/pyproject.toml index 3fecbd301..b247360e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ Changelog = "https://docs.gunicorn.org/en/stable/news.html" [project.optional-dependencies] gevent = ["gevent>=1.4.0"] eventlet = ["eventlet>=0.24.1,!=0.36.0"] -tornado = ["tornado>=0.2"] +tornado = ["tornado>=6.5.0"] gthread = [] setproctitle = ["setproctitle"] testing = [ diff --git a/tests/test_gtornado.py b/tests/test_gtornado.py new file mode 100644 index 000000000..68e4d2012 --- /dev/null +++ b/tests/test_gtornado.py @@ -0,0 +1,511 @@ +# +# This file is part of gunicorn released under the MIT license. +# See the NOTICE for more information. + +"""Tests for the tornado worker.""" + +import os +from unittest import mock + +import pytest + +tornado = pytest.importorskip("tornado") + +from gunicorn.config import Config +from gunicorn.workers import gtornado + + +class FakeSocket: + """Mock socket for testing.""" + + def __init__(self, data=b''): + self.data = data + self.closed = False + self.blocking = True + self._fileno = id(self) % 65536 + + def fileno(self): + return self._fileno + + def setblocking(self, blocking): + self.blocking = blocking + + def recv(self, size): + result = self.data[:size] + self.data = self.data[size:] + return result + + def send(self, data): + return len(data) + + def close(self): + self.closed = True + + def getsockname(self): + return ('127.0.0.1', 8000) + + def getpeername(self): + return ('127.0.0.1', 12345) + + +class TestTornadoWorkerInit: + """Tests for TornadoWorker initialization.""" + + def create_worker(self, cfg=None): + """Create a worker instance for testing.""" + if cfg is None: + cfg = Config() + cfg.set('workers', 1) + cfg.set('max_requests', 0) + + worker = gtornado.TornadoWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + return worker + + def test_worker_init(self): + """Test worker initialization.""" + worker = self.create_worker() + assert worker.nr == 0 + + def test_init_process_clears_ioloop(self): + """Test that init_process clears the current IOLoop.""" + worker = self.create_worker() + worker.tmp = mock.Mock() + worker.log = mock.Mock() + + with mock.patch.object(gtornado.IOLoop, 'clear_current') as mock_clear: + with mock.patch.object(gtornado.Worker, 'init_process'): + worker.init_process() + mock_clear.assert_called_once() + + +class TestRequestCounting: + """Tests for request counting and max_requests behavior.""" + + def create_worker(self, cfg=None): + """Create a worker instance for testing.""" + if cfg is None: + cfg = Config() + cfg.set('workers', 1) + + worker = gtornado.TornadoWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + return worker + + def test_handle_request_increments_counter(self): + """Test that handle_request increments the request counter.""" + worker = self.create_worker() + worker.nr = 0 + worker.max_requests = 100 + worker.alive = True + + worker.handle_request() + + assert worker.nr == 1 + assert worker.alive is True + + def test_max_requests_triggers_shutdown(self): + """Test that reaching max_requests triggers shutdown.""" + cfg = Config() + cfg.set('max_requests', 5) + worker = self.create_worker(cfg) + worker.nr = 4 + worker.alive = True + worker.max_requests = 5 + + worker.handle_request() + + assert worker.nr == 5 + assert worker.alive is False + + +class TestSignalHandling: + """Tests for signal handling in tornado worker.""" + + def create_worker(self): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + + worker = gtornado.TornadoWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + return worker + + def test_handle_exit_sets_alive_false(self): + """Test that handle_exit sets alive=False through parent.""" + worker = self.create_worker() + worker.alive = True + + # The parent's handle_exit is what sets alive=False + worker.handle_exit(None, None) + + assert worker.alive is False + + def test_handle_exit_only_once(self): + """Test that handle_exit only triggers once when alive.""" + worker = self.create_worker() + worker.alive = True + + # First call should set alive=False + worker.handle_exit(None, None) + assert worker.alive is False + + # Second call should do nothing (alive is already False) + # Track that super().handle_exit is not called again + with mock.patch.object(gtornado.Worker, 'handle_exit') as mock_exit: + worker.handle_exit(None, None) + mock_exit.assert_not_called() + + +class TestWatchdog: + """Tests for watchdog functionality.""" + + def create_worker(self): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + + worker = gtornado.TornadoWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + return worker + + def test_watchdog_notifies_when_alive(self): + """Test that watchdog calls notify when alive.""" + worker = self.create_worker() + worker.alive = True + worker.ppid = os.getppid() + worker.tmp = mock.Mock() + + worker.watchdog() + + worker.tmp.notify.assert_called_once() + + def test_watchdog_detects_parent_death(self): + """Test that watchdog detects parent death.""" + worker = self.create_worker() + worker.alive = True + worker.ppid = 99999999 # Invalid ppid + worker.tmp = mock.Mock() + + worker.watchdog() + + assert worker.alive is False + + +class TestHeartbeat: + """Tests for heartbeat functionality.""" + + def create_worker(self): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + + worker = gtornado.TornadoWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + return worker + + def test_heartbeat_stops_server_when_not_alive(self): + """Test that heartbeat stops the server when not alive.""" + worker = self.create_worker() + worker.alive = False + worker.server_alive = True + worker.server = mock.Mock() + + worker.heartbeat() + + worker.server.stop.assert_called_once() + assert worker.server_alive is False + + def test_heartbeat_stops_ioloop_after_server(self): + """Test that heartbeat stops IOLoop after server is stopped.""" + worker = self.create_worker() + worker.alive = False + worker.server_alive = False + worker.callbacks = [mock.Mock(), mock.Mock()] + worker.ioloop = mock.Mock() + + worker.heartbeat() + + for callback in worker.callbacks: + callback.stop.assert_called_once() + worker.ioloop.stop.assert_called_once() + + +class TestAppWrapping: + """Tests for app wrapping logic.""" + + def create_worker(self): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + + worker = gtornado.TornadoWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + return worker + + def test_wsgi_callable_wrapped_in_container(self): + """Test that a plain WSGI callable gets wrapped in WSGIContainer.""" + from tornado.wsgi import WSGIContainer + + def wsgi_app(environ, start_response): + pass + + # Test that WSGIContainer is used for plain WSGI apps + app = wsgi_app + if not isinstance(app, WSGIContainer) and \ + not isinstance(app, tornado.web.Application): + app = WSGIContainer(app) + + assert isinstance(app, WSGIContainer) + + def test_tornado_application_not_wrapped(self): + """Test that tornado.web.Application is not wrapped.""" + from tornado.wsgi import WSGIContainer + + tornado_app = tornado.web.Application([]) + + # Test the wrapping logic + app = tornado_app + if not isinstance(app, WSGIContainer) and \ + not isinstance(app, tornado.web.Application): + app = WSGIContainer(app) + + # Should NOT be wrapped + assert isinstance(app, tornado.web.Application) + assert not isinstance(app, WSGIContainer) + + +class TestSetup: + """Tests for the setup class method.""" + + def test_setup_patches_request_handler(self): + """Test that setup patches RequestHandler.clear.""" + # Save original + original_clear = tornado.web.RequestHandler.clear + + try: + gtornado.TornadoWorker.setup() + + # Create a mock handler to test the patched clear method + mock_handler = mock.Mock() + mock_handler._headers = {"Server": "TornadoServer/1.0"} + + # Call the patched clear + new_clear = tornado.web.RequestHandler.clear + assert new_clear is not original_clear + + finally: + # Restore original + tornado.web.RequestHandler.clear = original_clear + + +class TestRunMethod: + """Tests for the run method.""" + + def create_worker(self): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + cfg.set('keepalive', 2) + + worker = gtornado.TornadoWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + return worker + + def test_run_sets_up_callbacks(self): + """Test that run sets up periodic callbacks.""" + worker = self.create_worker() + worker.wsgi = tornado.web.Application([]) + worker.sockets = [] + + mock_ioloop = mock.Mock() + mock_callback = mock.Mock() + + with mock.patch.object(gtornado.IOLoop, 'instance', return_value=mock_ioloop): + with mock.patch.object(gtornado, 'PeriodicCallback', return_value=mock_callback) as mock_pc: + # Start the run method but stop it immediately + mock_ioloop.start.side_effect = lambda: None + + worker.run() + + # Should create two callbacks (watchdog and heartbeat) + assert mock_pc.call_count == 2 + assert mock_callback.start.call_count == 2 + + def test_run_creates_http_server(self): + """Test that run creates an HTTP server.""" + worker = self.create_worker() + worker.wsgi = tornado.web.Application([]) + worker.sockets = [] + + mock_ioloop = mock.Mock() + mock_ioloop.start.side_effect = lambda: None + + with mock.patch.object(gtornado.IOLoop, 'instance', return_value=mock_ioloop): + with mock.patch.object(gtornado, 'PeriodicCallback', return_value=mock.Mock()): + worker.run() + + assert worker.server is not None + assert worker.server_alive is True + + def test_run_adds_sockets_to_server(self): + """Test that run adds sockets to the server.""" + worker = self.create_worker() + worker.wsgi = tornado.web.Application([]) + + mock_socket = FakeSocket() + worker.sockets = [mock_socket] + + mock_ioloop = mock.Mock() + mock_ioloop.start.side_effect = lambda: None + + with mock.patch.object(gtornado.IOLoop, 'instance', return_value=mock_ioloop): + with mock.patch.object(gtornado, 'PeriodicCallback', return_value=mock.Mock()): + with mock.patch.object(tornado.httpserver.HTTPServer, 'add_socket'): + worker.run() + + # Socket should be set to non-blocking (setblocking(0)) + assert not mock_socket.blocking + + +class TestSSLSupport: + """Tests for SSL support.""" + + def create_worker(self): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + cfg.set('keepalive', 2) + + worker = gtornado.TornadoWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + return worker + + def test_ssl_server_creation(self): + """Test that SSL server is created when is_ssl is True.""" + worker = self.create_worker() + worker.wsgi = tornado.web.Application([]) + worker.sockets = [] + + mock_ioloop = mock.Mock() + mock_ioloop.start.side_effect = lambda: None + + mock_ssl_context = mock.Mock() + + # Mock cfg.is_ssl property to return True + with mock.patch.object(type(worker.cfg), 'is_ssl', new_callable=mock.PropertyMock, return_value=True): + with mock.patch.object(gtornado.IOLoop, 'instance', return_value=mock_ioloop): + with mock.patch.object(gtornado, 'PeriodicCallback', return_value=mock.Mock()): + with mock.patch.object(gtornado, 'ssl_context', return_value=mock_ssl_context): + worker.run() + + # Server should be created with ssl_options + assert worker.server is not None + + +class TestKeepAlive: + """Tests for keep-alive configuration.""" + + def create_worker(self): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + + worker = gtornado.TornadoWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + return worker + + def test_keep_alive_enabled(self): + """Test that keep-alive is enabled when keepalive > 0.""" + worker = self.create_worker() + worker.wsgi = tornado.web.Application([]) + worker.cfg.set('keepalive', 2) + worker.sockets = [] + + mock_ioloop = mock.Mock() + mock_ioloop.start.side_effect = lambda: None + + with mock.patch.object(gtornado.IOLoop, 'instance', return_value=mock_ioloop): + with mock.patch.object(gtornado, 'PeriodicCallback', return_value=mock.Mock()): + worker.run() + + assert worker.server.no_keep_alive is False + + def test_keep_alive_disabled(self): + """Test that keep-alive is disabled when keepalive <= 0.""" + worker = self.create_worker() + worker.wsgi = tornado.web.Application([]) + worker.cfg.set('keepalive', 0) + worker.sockets = [] + + mock_ioloop = mock.Mock() + mock_ioloop.start.side_effect = lambda: None + + with mock.patch.object(gtornado.IOLoop, 'instance', return_value=mock_ioloop): + with mock.patch.object(gtornado, 'PeriodicCallback', return_value=mock.Mock()): + worker.run() + + assert worker.server.no_keep_alive is True From 543854c123018b5c5d62e7344924931e21bafaf3 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 00:14:11 +0100 Subject: [PATCH 029/356] gevent: Require gevent 23.9.0+ for security fixes Address CVE-2023-41419 (Critical - remote privilege escalation via WSGIServer) by requiring gevent 23.9.0 or higher. Changes: - Update minimum gevent version from 1.4.0 to 23.9.0 - Remove legacy server.kill() code path (gevent < 1.0) - Update documentation to reflect new version requirement - Add comprehensive tests for gevent worker --- gunicorn/config.py | 2 +- gunicorn/workers/ggevent.py | 11 +- pyproject.toml | 2 +- tests/workers/test_ggevent.py | 210 ++++++++++++++++++++++++++++++++++ 4 files changed, 216 insertions(+), 9 deletions(-) diff --git a/gunicorn/config.py b/gunicorn/config.py index 1c36f9871..a789142c0 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -680,7 +680,7 @@ class WorkerClass(Setting): * ``sync`` * ``eventlet`` - Requires eventlet >= 0.24.1 (or install it via ``pip install gunicorn[eventlet]``) - * ``gevent`` - Requires gevent >= 1.4 (or install it via + * ``gevent`` - Requires gevent >= 23.9.0 (or install it via ``pip install gunicorn[gevent]``) * ``tornado`` - Requires tornado >= 0.2 (or install it via ``pip install gunicorn[tornado]``) diff --git a/gunicorn/workers/ggevent.py b/gunicorn/workers/ggevent.py index 437eb7d02..ad9ecc835 100644 --- a/gunicorn/workers/ggevent.py +++ b/gunicorn/workers/ggevent.py @@ -11,11 +11,11 @@ try: import gevent except ImportError: - raise RuntimeError("gevent worker requires gevent 1.4 or higher") + raise RuntimeError("gevent worker requires gevent 23.9.0 or higher") else: from packaging.version import parse as parse_version - if parse_version(gevent.__version__) < parse_version('1.4'): - raise RuntimeError("gevent worker requires gevent 1.4 or higher") + if parse_version(gevent.__version__) < parse_version('23.9.0'): + raise RuntimeError("gevent worker requires gevent 23.9.0 or higher") from gevent.pool import Pool from gevent.server import StreamServer @@ -89,10 +89,7 @@ def run(self): try: # Stop accepting requests for server in servers: - if hasattr(server, 'close'): # gevent 1.0 - server.close() - if hasattr(server, 'kill'): # gevent < 1.0 - server.kill() + server.close() # Handle current requests until graceful_timeout ts = time.time() diff --git a/pyproject.toml b/pyproject.toml index b247360e8..3549632d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ Documentation = "https://docs.gunicorn.org" Changelog = "https://docs.gunicorn.org/en/stable/news.html" [project.optional-dependencies] -gevent = ["gevent>=1.4.0"] +gevent = ["gevent>=23.9.0"] eventlet = ["eventlet>=0.24.1,!=0.36.0"] tornado = ["tornado>=6.5.0"] gthread = [] diff --git a/tests/workers/test_ggevent.py b/tests/workers/test_ggevent.py index f9a7bbfad..7e5d581ed 100644 --- a/tests/workers/test_ggevent.py +++ b/tests/workers/test_ggevent.py @@ -2,5 +2,215 @@ # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. +from unittest import mock + +import pytest + +try: + import gevent + HAS_GEVENT = True +except ImportError: + HAS_GEVENT = False + +pytestmark = pytest.mark.skipif(not HAS_GEVENT, reason="gevent not installed") + + def test_import(): __import__('gunicorn.workers.ggevent') + + +def test_version_requirement(): + """Test that gevent 23.9.0+ is required.""" + from gunicorn.workers import ggevent + from packaging.version import parse as parse_version + assert parse_version(gevent.__version__) >= parse_version('23.9.0') + + +class TestGeventWorkerInit: + """Test GeventWorker initialization.""" + + def test_worker_has_no_server_class(self): + """Test that GeventWorker has no server_class by default.""" + from gunicorn.workers.ggevent import GeventWorker + assert GeventWorker.server_class is None + + def test_worker_has_no_wsgi_handler(self): + """Test that GeventWorker has no wsgi_handler by default.""" + from gunicorn.workers.ggevent import GeventWorker + assert GeventWorker.wsgi_handler is None + + def test_init_process_patches_and_reinits(self): + """Test that init_process calls patch and reinits the hub.""" + from gunicorn.workers.ggevent import GeventWorker + + worker = mock.Mock(spec=GeventWorker) + worker.sockets = [] + + with mock.patch('gunicorn.workers.ggevent.hub') as mock_hub, \ + mock.patch.object(GeventWorker.__bases__[0], 'init_process'): + GeventWorker.init_process(worker) + + # Verify patch was called + worker.patch.assert_called_once() + mock_hub.reinit.assert_called_once() + + +class TestGeventWorkerRun: + """Test GeventWorker run method.""" + + def test_run_creates_stream_servers(self): + """Test that run creates StreamServer instances for each socket.""" + from gunicorn.workers.ggevent import GeventWorker + + worker = mock.Mock(spec=GeventWorker) + worker.sockets = [mock.Mock()] + worker.cfg = mock.Mock(is_ssl=False, workers=1, graceful_timeout=30) + worker.server_class = None + worker.worker_connections = 1000 + + # Make alive return True once, then False to exit the loop + worker.alive = False + + with mock.patch('gunicorn.workers.ggevent.Pool') as mock_pool, \ + mock.patch('gunicorn.workers.ggevent.StreamServer') as mock_server_cls, \ + mock.patch('gunicorn.workers.ggevent.gevent') as mock_gevent: + + mock_server = mock.Mock() + mock_server.pool = mock.Mock() + mock_server.pool.free_count.return_value = mock_server.pool.size + mock_server_cls.return_value = mock_server + + GeventWorker.run(worker) + + mock_server_cls.assert_called_once() + mock_server.start.assert_called_once() + mock_server.close.assert_called_once() + + def test_run_with_ssl(self): + """Test that run configures SSL context when is_ssl is True.""" + from gunicorn.workers.ggevent import GeventWorker + + worker = mock.Mock(spec=GeventWorker) + worker.sockets = [mock.Mock()] + worker.cfg = mock.Mock(is_ssl=True, workers=1, graceful_timeout=30) + worker.server_class = None + worker.worker_connections = 1000 + worker.alive = False + + with mock.patch('gunicorn.workers.ggevent.Pool'), \ + mock.patch('gunicorn.workers.ggevent.StreamServer') as mock_server_cls, \ + mock.patch('gunicorn.workers.ggevent.gevent'), \ + mock.patch('gunicorn.workers.ggevent.ssl_context') as mock_ssl_ctx: + + mock_server = mock.Mock() + mock_server.pool = mock.Mock() + mock_server.pool.free_count.return_value = mock_server.pool.size + mock_server_cls.return_value = mock_server + mock_ssl_ctx.return_value = mock.Mock() + + GeventWorker.run(worker) + + mock_ssl_ctx.assert_called_once_with(worker.cfg) + # Verify ssl_context was passed to StreamServer + call_kwargs = mock_server_cls.call_args[1] + assert 'ssl_context' in call_kwargs + + +class TestSignalHandling: + """Test signal handling in GeventWorker.""" + + def test_handle_quit_spawns_greenlet(self): + """Test that handle_quit spawns a greenlet instead of blocking.""" + from gunicorn.workers.ggevent import GeventWorker + + worker = mock.Mock(spec=GeventWorker) + + with mock.patch('gunicorn.workers.ggevent.gevent') as mock_gevent: + GeventWorker.handle_quit(worker, mock.Mock(), mock.Mock()) + mock_gevent.spawn.assert_called_once() + + def test_handle_usr1_spawns_greenlet(self): + """Test that handle_usr1 spawns a greenlet instead of blocking.""" + from gunicorn.workers.ggevent import GeventWorker + + worker = mock.Mock(spec=GeventWorker) + + with mock.patch('gunicorn.workers.ggevent.gevent') as mock_gevent: + GeventWorker.handle_usr1(worker, mock.Mock(), mock.Mock()) + mock_gevent.spawn.assert_called_once() + + def test_notify_exits_on_parent_change(self): + """Test that notify exits when parent PID changes.""" + from gunicorn.workers.ggevent import GeventWorker + + worker = mock.Mock(spec=GeventWorker) + worker.ppid = 1234 + worker.log = mock.Mock() + + with mock.patch('gunicorn.workers.ggevent.os') as mock_os, \ + mock.patch.object(GeventWorker.__bases__[0], 'notify'): + mock_os.getppid.return_value = 5678 # Different PID + + with pytest.raises(SystemExit): + GeventWorker.notify(worker) + + +class TestPyWSGIWorker: + """Test PyWSGI-based worker classes.""" + + def test_pywsgi_worker_has_server_class(self): + """Test that GeventPyWSGIWorker has proper server_class.""" + from gunicorn.workers.ggevent import GeventPyWSGIWorker, PyWSGIServer + assert GeventPyWSGIWorker.server_class is PyWSGIServer + + def test_pywsgi_worker_has_handler(self): + """Test that GeventPyWSGIWorker has proper wsgi_handler.""" + from gunicorn.workers.ggevent import GeventPyWSGIWorker, PyWSGIHandler + assert GeventPyWSGIWorker.wsgi_handler is PyWSGIHandler + + def test_pywsgi_handler_get_environ(self): + """Test that PyWSGIHandler adds gunicorn-specific environ keys.""" + from gunicorn.workers.ggevent import PyWSGIHandler + + handler = mock.Mock(spec=PyWSGIHandler) + handler.socket = mock.Mock() + handler.path = '/test/path' + + # Mock the parent get_environ + with mock.patch.object(PyWSGIHandler.__bases__[0], 'get_environ', return_value={}): + env = PyWSGIHandler.get_environ(handler) + assert env['gunicorn.sock'] == handler.socket + assert env['RAW_URI'] == '/test/path' + + +class TestGeventResponse: + """Test GeventResponse helper class.""" + + def test_response_attributes(self): + """Test GeventResponse stores status, headers, and sent.""" + from gunicorn.workers.ggevent import GeventResponse + + resp = GeventResponse('200 OK', {'Content-Type': 'text/html'}, 1024) + assert resp.status == '200 OK' + assert resp.headers == {'Content-Type': 'text/html'} + assert resp.sent == 1024 + + +class TestTimeoutContext: + """Test timeout context manager.""" + + def test_timeout_ctx_uses_keepalive(self): + """Test that timeout_ctx uses cfg.keepalive.""" + from gunicorn.workers.ggevent import GeventWorker + + worker = mock.Mock(spec=GeventWorker) + worker.cfg = mock.Mock(keepalive=30) + + with mock.patch('gunicorn.workers.ggevent.gevent') as mock_gevent: + mock_timeout = mock.Mock() + mock_gevent.Timeout.return_value = mock_timeout + + result = GeventWorker.timeout_ctx(worker) + + mock_gevent.Timeout.assert_called_once_with(30, False) + assert result == mock_timeout From 4062a82ba75fcbb1839a8cb086cabfd95325c9d7 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 00:25:50 +0100 Subject: [PATCH 030/356] eventlet: Require eventlet 0.40.3+ for security fixes Upgrade minimum eventlet version to 0.40.3 to address security vulnerabilities: - CVE-2021-21419 (Moderate 6.9): Websocket memory exhaustion via large/compressed frames (fixed in 0.31.0) - CVE-2025-58068 (Moderate 6.3): HTTP Request Smuggling via improper trailer handling (fixed in 0.40.3) Also restructure module to call monkey_patch() at import time for better patching coverage, while keeping hubs.use_hub() in the worker's patch() method since it creates OS resources that don't survive fork. Add comprehensive tests for the eventlet worker. --- gunicorn/config.py | 2 +- gunicorn/workers/geventlet.py | 26 +- pyproject.toml | 2 +- tests/workers/test_geventlet.py | 404 +++++++++++++++++++++++++++++++- 4 files changed, 423 insertions(+), 11 deletions(-) diff --git a/gunicorn/config.py b/gunicorn/config.py index a789142c0..56c7df3cf 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -678,7 +678,7 @@ class WorkerClass(Setting): A string referring to one of the following bundled classes: * ``sync`` - * ``eventlet`` - Requires eventlet >= 0.24.1 (or install it via + * ``eventlet`` - Requires eventlet >= 0.40.3 (or install it via ``pip install gunicorn[eventlet]``) * ``gevent`` - Requires gevent >= 23.9.0 (or install it via ``pip install gunicorn[gevent]``) diff --git a/gunicorn/workers/geventlet.py b/gunicorn/workers/geventlet.py index 087eb61ec..9082a1ad1 100644 --- a/gunicorn/workers/geventlet.py +++ b/gunicorn/workers/geventlet.py @@ -2,17 +2,26 @@ # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. -from functools import partial -import sys - +# NOTE: eventlet import and monkey_patch() must happen before any other imports +# to ensure all standard library modules are properly patched. try: import eventlet except ImportError: - raise RuntimeError("eventlet worker requires eventlet 0.24.1 or higher") + raise RuntimeError("eventlet worker requires eventlet 0.40.3 or higher") else: from packaging.version import parse as parse_version - if parse_version(eventlet.__version__) < parse_version('0.24.1'): - raise RuntimeError("eventlet worker requires eventlet 0.24.1 or higher") + if parse_version(eventlet.__version__) < parse_version('0.40.3'): + raise RuntimeError("eventlet worker requires eventlet 0.40.3 or higher") + +# Perform monkey patching early, before importing other modules. +# This ensures that all subsequent imports get the patched versions. +# NOTE: hubs.use_hub() must NOT be called here - it creates OS resources +# (like kqueue on macOS) that don't survive fork. It must be called in +# each worker process after fork, in the patch() method. +eventlet.monkey_patch() + +from functools import partial +import sys from eventlet import hubs, greenthread from eventlet.greenio import GreenSocket @@ -124,8 +133,11 @@ def patch_sendfile(): class EventletWorker(AsyncWorker): def patch(self): + # NOTE: eventlet.monkey_patch() is called at module import time to + # ensure all imports are properly patched. However, hubs.use_hub() + # must be called here (after fork) because it creates OS resources + # like kqueue that don't survive fork. hubs.use_hub() - eventlet.monkey_patch() patch_sendfile() def is_already_handled(self, respiter): diff --git a/pyproject.toml b/pyproject.toml index 3549632d6..63ef2cd83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ Changelog = "https://docs.gunicorn.org/en/stable/news.html" [project.optional-dependencies] gevent = ["gevent>=23.9.0"] -eventlet = ["eventlet>=0.24.1,!=0.36.0"] +eventlet = ["eventlet>=0.40.3"] tornado = ["tornado>=6.5.0"] gthread = [] setproctitle = ["setproctitle"] diff --git a/tests/workers/test_geventlet.py b/tests/workers/test_geventlet.py index 446f7037b..0719f0388 100644 --- a/tests/workers/test_geventlet.py +++ b/tests/workers/test_geventlet.py @@ -4,13 +4,413 @@ import pytest import sys +from unittest import mock -def test_import(): +def test_import(): + """Test that the eventlet worker module can be imported.""" try: import eventlet except AttributeError: - if (3,13) > sys.version_info >= (3, 12): + if (3, 13) > sys.version_info >= (3, 12): pytest.skip("Ignoring eventlet failures on Python 3.12") raise __import__('gunicorn.workers.geventlet') + + +class TestVersionRequirement: + """Tests for eventlet version requirement checks.""" + + def test_import_error_message(self): + """Test that ImportError gives correct version message.""" + with mock.patch.dict('sys.modules', {'eventlet': None}): + # Clear cached module if present + sys.modules.pop('gunicorn.workers.geventlet', None) + with pytest.raises(RuntimeError, match="eventlet 0.40.3"): + import importlib + import gunicorn.workers.geventlet + importlib.reload(gunicorn.workers.geventlet) + + def test_version_check_requires_0_40_3(self): + """Test that version check requires eventlet 0.40.3 or higher.""" + try: + import eventlet + except (ImportError, AttributeError): + pytest.skip("eventlet not available") + + from packaging.version import parse as parse_version + min_version = parse_version('0.40.3') + current_version = parse_version(eventlet.__version__) + + # If we got this far, the import succeeded, meaning version is sufficient + assert current_version >= min_version + + +@pytest.fixture +def eventlet_worker(): + """Fixture to create an EventletWorker instance for testing.""" + try: + import eventlet + except (ImportError, AttributeError): + pytest.skip("eventlet not available") + + from gunicorn.workers.geventlet import EventletWorker + + # Create a minimal mock config + cfg = mock.MagicMock() + cfg.keepalive = 2 + cfg.graceful_timeout = 30 + cfg.is_ssl = False + cfg.worker_connections = 1000 + + # Create worker with mocked dependencies + worker = EventletWorker.__new__(EventletWorker) + worker.cfg = cfg + worker.alive = True + worker.sockets = [] + worker.log = mock.MagicMock() + + return worker + + +class TestEventletWorker: + """Tests for EventletWorker class.""" + + def test_worker_class_exists(self): + """Test that EventletWorker class is properly defined.""" + try: + import eventlet + except (ImportError, AttributeError): + pytest.skip("eventlet not available") + + from gunicorn.workers.geventlet import EventletWorker + from gunicorn.workers.base_async import AsyncWorker + + assert issubclass(EventletWorker, AsyncWorker) + + def test_patch_method_calls_use_hub(self, eventlet_worker): + """Test that patch() calls hubs.use_hub(). + + hubs.use_hub() must be called in patch() (after fork) because it creates + OS resources like kqueue that don't survive fork. + """ + from eventlet import hubs + + with mock.patch.object(hubs, 'use_hub') as mock_use_hub: + with mock.patch('gunicorn.workers.geventlet.patch_sendfile'): + eventlet_worker.patch() + + mock_use_hub.assert_called_once() + + def test_patch_method_calls_patch_sendfile(self, eventlet_worker): + """Test that patch() calls patch_sendfile().""" + from eventlet import hubs + + with mock.patch.object(hubs, 'use_hub'): + with mock.patch('gunicorn.workers.geventlet.patch_sendfile') as mock_sf: + eventlet_worker.patch() + + mock_sf.assert_called_once() + + def test_monkey_patch_called_at_import_time(self): + """Test that monkey_patch is called at module import time. + + Note: hubs.use_hub() and eventlet.monkey_patch() are called at module + import time (not in patch()) to ensure all imports are properly patched. + This test verifies the module was patched by checking eventlet state. + """ + try: + import eventlet + except (ImportError, AttributeError): + pytest.skip("eventlet not available") + + # Verify eventlet has been patched by checking that socket is patched + import socket + from eventlet.greenio import GreenSocket + + # After monkey patching, socket.socket should be GreenSocket + assert socket.socket is GreenSocket + + def test_timeout_ctx_returns_eventlet_timeout(self, eventlet_worker): + """Test that timeout_ctx() returns an eventlet.Timeout.""" + import eventlet + + timeout = eventlet_worker.timeout_ctx() + assert isinstance(timeout, eventlet.Timeout) + + def test_timeout_ctx_uses_keepalive_config(self, eventlet_worker): + """Test that timeout_ctx() uses cfg.keepalive value.""" + import eventlet + + eventlet_worker.cfg.keepalive = 5 + with mock.patch.object(eventlet, 'Timeout') as mock_timeout: + eventlet_worker.timeout_ctx() + + mock_timeout.assert_called_once_with(5, False) + + def test_timeout_ctx_with_no_keepalive(self, eventlet_worker): + """Test that timeout_ctx() handles no keepalive (None or 0).""" + import eventlet + + eventlet_worker.cfg.keepalive = 0 + with mock.patch.object(eventlet, 'Timeout') as mock_timeout: + eventlet_worker.timeout_ctx() + + mock_timeout.assert_called_once_with(None, False) + + def test_handle_quit_spawns_greenthread(self, eventlet_worker): + """Test that handle_quit() spawns a greenthread.""" + import eventlet + + with mock.patch.object(eventlet, 'spawn') as mock_spawn: + eventlet_worker.handle_quit(None, None) + + mock_spawn.assert_called_once() + + def test_handle_usr1_spawns_greenthread(self, eventlet_worker): + """Test that handle_usr1() spawns a greenthread.""" + import eventlet + + with mock.patch.object(eventlet, 'spawn') as mock_spawn: + eventlet_worker.handle_usr1(None, None) + + mock_spawn.assert_called_once() + + def test_handle_wraps_ssl_when_configured(self, eventlet_worker): + """Test that handle() wraps socket with SSL when is_ssl is True.""" + from gunicorn.workers import geventlet + + eventlet_worker.cfg.is_ssl = True + mock_client = mock.MagicMock() + mock_listener = mock.MagicMock() + + with mock.patch.object(geventlet, 'ssl_wrap_socket') as mock_ssl: + mock_ssl.return_value = mock_client + with mock.patch('gunicorn.workers.base_async.AsyncWorker.handle'): + eventlet_worker.handle(mock_listener, mock_client, ('127.0.0.1', 8000)) + + mock_ssl.assert_called_once_with(mock_client, eventlet_worker.cfg) + + def test_handle_no_ssl_when_not_configured(self, eventlet_worker): + """Test that handle() does not wrap SSL when is_ssl is False.""" + from gunicorn.workers import geventlet + + eventlet_worker.cfg.is_ssl = False + mock_client = mock.MagicMock() + mock_listener = mock.MagicMock() + + with mock.patch.object(geventlet, 'ssl_wrap_socket') as mock_ssl: + with mock.patch('gunicorn.workers.base_async.AsyncWorker.handle'): + eventlet_worker.handle(mock_listener, mock_client, ('127.0.0.1', 8000)) + + mock_ssl.assert_not_called() + + +class TestAlreadyHandled: + """Tests for is_already_handled() method.""" + + def test_is_already_handled_new_style(self, eventlet_worker): + """Test is_already_handled with eventlet >= 0.30.3 (WSGI_LOCAL).""" + from gunicorn.workers import geventlet + + # Mock the new-style WSGI_LOCAL.already_handled + mock_wsgi_local = mock.MagicMock() + mock_wsgi_local.already_handled = True + + with mock.patch.object(geventlet, 'EVENTLET_WSGI_LOCAL', mock_wsgi_local): + with pytest.raises(StopIteration): + eventlet_worker.is_already_handled(mock.MagicMock()) + + def test_is_already_handled_old_style(self, eventlet_worker): + """Test is_already_handled with eventlet < 0.30.3 (ALREADY_HANDLED).""" + from gunicorn.workers import geventlet + + sentinel = object() + + with mock.patch.object(geventlet, 'EVENTLET_WSGI_LOCAL', None): + with mock.patch.object(geventlet, 'EVENTLET_ALREADY_HANDLED', sentinel): + with pytest.raises(StopIteration): + eventlet_worker.is_already_handled(sentinel) + + def test_is_already_handled_returns_parent_result(self, eventlet_worker): + """Test is_already_handled falls through to parent when not handled.""" + from gunicorn.workers import geventlet + + with mock.patch.object(geventlet, 'EVENTLET_WSGI_LOCAL', None): + with mock.patch.object(geventlet, 'EVENTLET_ALREADY_HANDLED', None): + with mock.patch('gunicorn.workers.base_async.AsyncWorker.is_already_handled') as mock_parent: + mock_parent.return_value = False + result = eventlet_worker.is_already_handled(mock.MagicMock()) + + assert result is False + mock_parent.assert_called_once() + + +class TestPatchSendfile: + """Tests for patch_sendfile() function.""" + + def test_patch_sendfile_adds_method_when_missing(self): + """Test that patch_sendfile adds sendfile to GreenSocket if missing.""" + try: + import eventlet + except (ImportError, AttributeError): + pytest.skip("eventlet not available") + + from gunicorn.workers.geventlet import patch_sendfile, _eventlet_socket_sendfile + from eventlet.greenio import GreenSocket + + # Remove sendfile if it exists + original = getattr(GreenSocket, 'sendfile', None) + if hasattr(GreenSocket, 'sendfile'): + delattr(GreenSocket, 'sendfile') + + try: + patch_sendfile() + assert hasattr(GreenSocket, 'sendfile') + assert GreenSocket.sendfile == _eventlet_socket_sendfile + finally: + # Restore original state + if original is not None: + GreenSocket.sendfile = original + elif hasattr(GreenSocket, 'sendfile'): + delattr(GreenSocket, 'sendfile') + + def test_patch_sendfile_preserves_existing_method(self): + """Test that patch_sendfile does not override existing sendfile.""" + try: + import eventlet + except (ImportError, AttributeError): + pytest.skip("eventlet not available") + + from gunicorn.workers.geventlet import patch_sendfile + from eventlet.greenio import GreenSocket + + # If sendfile exists, it should be preserved + if hasattr(GreenSocket, 'sendfile'): + original = GreenSocket.sendfile + patch_sendfile() + assert GreenSocket.sendfile == original + + +class TestEventletSocketSendfile: + """Tests for _eventlet_socket_sendfile() function.""" + + def test_sendfile_raises_on_non_blocking(self): + """Test that sendfile raises ValueError for non-blocking sockets.""" + try: + import eventlet + except (ImportError, AttributeError): + pytest.skip("eventlet not available") + + from gunicorn.workers.geventlet import _eventlet_socket_sendfile + + mock_socket = mock.MagicMock() + mock_socket.gettimeout.return_value = 0 + + with pytest.raises(ValueError, match="non-blocking"): + _eventlet_socket_sendfile(mock_socket, mock.MagicMock()) + + def test_sendfile_seeks_to_offset(self): + """Test that sendfile seeks to offset if provided.""" + try: + import eventlet + except (ImportError, AttributeError): + pytest.skip("eventlet not available") + + from gunicorn.workers.geventlet import _eventlet_socket_sendfile + + mock_socket = mock.MagicMock() + mock_socket.gettimeout.return_value = 1 + mock_file = mock.MagicMock() + mock_file.read.return_value = b'' + + _eventlet_socket_sendfile(mock_socket, mock_file, offset=100) + + mock_file.seek.assert_any_call(100) + + def test_sendfile_returns_total_sent(self): + """Test that sendfile returns the total bytes sent.""" + try: + import eventlet + except (ImportError, AttributeError): + pytest.skip("eventlet not available") + + from gunicorn.workers.geventlet import _eventlet_socket_sendfile + + mock_socket = mock.MagicMock() + mock_socket.gettimeout.return_value = 1 + mock_socket.send.return_value = 10 + + mock_file = mock.MagicMock() + mock_file.read.side_effect = [b'x' * 10, b''] + + result = _eventlet_socket_sendfile(mock_socket, mock_file) + + assert result == 10 + + +class TestEventletServe: + """Tests for _eventlet_serve() function.""" + + def test_serve_creates_green_pool(self): + """Test that _eventlet_serve creates a GreenPool.""" + try: + import eventlet + except (ImportError, AttributeError): + pytest.skip("eventlet not available") + + from gunicorn.workers.geventlet import _eventlet_serve + + mock_sock = mock.MagicMock() + mock_sock.accept.side_effect = eventlet.StopServe() + + with mock.patch.object(eventlet.greenpool, 'GreenPool') as mock_pool: + mock_pool_instance = mock.MagicMock() + mock_pool.return_value = mock_pool_instance + mock_pool_instance.waitall.return_value = None + + _eventlet_serve(mock_sock, mock.MagicMock(), 100) + + mock_pool.assert_called_once_with(100) + + +class TestEventletStop: + """Tests for _eventlet_stop() function.""" + + def test_stop_waits_for_client(self): + """Test that _eventlet_stop waits for the client greenlet.""" + try: + import eventlet + except (ImportError, AttributeError): + pytest.skip("eventlet not available") + + from gunicorn.workers.geventlet import _eventlet_stop + + mock_client = mock.MagicMock() + mock_server = mock.MagicMock() + mock_conn = mock.MagicMock() + + _eventlet_stop(mock_client, mock_server, mock_conn) + + mock_client.wait.assert_called_once() + mock_conn.close.assert_called_once() + + def test_stop_closes_connection_on_greenlet_exit(self): + """Test that connection is closed even on GreenletExit.""" + try: + import eventlet + import greenlet + except (ImportError, AttributeError): + pytest.skip("eventlet not available") + + from gunicorn.workers.geventlet import _eventlet_stop + + mock_client = mock.MagicMock() + mock_client.wait.side_effect = greenlet.GreenletExit() + mock_server = mock.MagicMock() + mock_conn = mock.MagicMock() + + # Should not raise + _eventlet_stop(mock_client, mock_server, mock_conn) + + mock_conn.close.assert_called_once() From 086dadfa1e2bdf8a67d445a31398e7c46b5a2717 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 00:26:35 +0100 Subject: [PATCH 031/356] testing: Pin gevent and eventlet minimum versions --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 63ef2cd83..97caf78ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,8 +53,8 @@ tornado = ["tornado>=6.5.0"] gthread = [] setproctitle = ["setproctitle"] testing = [ - "gevent", - "eventlet", + "gevent>=23.9.0", + "eventlet>=0.40.3", "coverage", "pytest", "pytest-cov", From 9aaa75c0bf9f02dd6d7cbeaf6552073026cd03b0 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 00:36:05 +0100 Subject: [PATCH 032/356] fix: Add noqa comments for E402 in geventlet worker --- gunicorn/workers/geventlet.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gunicorn/workers/geventlet.py b/gunicorn/workers/geventlet.py index 9082a1ad1..20f179276 100644 --- a/gunicorn/workers/geventlet.py +++ b/gunicorn/workers/geventlet.py @@ -20,16 +20,16 @@ # each worker process after fork, in the patch() method. eventlet.monkey_patch() -from functools import partial -import sys +from functools import partial # noqa: E402 +import sys # noqa: E402 -from eventlet import hubs, greenthread -from eventlet.greenio import GreenSocket -import eventlet.wsgi -import greenlet +from eventlet import hubs, greenthread # noqa: E402 +from eventlet.greenio import GreenSocket # noqa: E402 +import eventlet.wsgi # noqa: E402 +import greenlet # noqa: E402 -from gunicorn.workers.base_async import AsyncWorker -from gunicorn.sock import ssl_wrap_socket +from gunicorn.workers.base_async import AsyncWorker # noqa: E402 +from gunicorn.sock import ssl_wrap_socket # noqa: E402 # ALREADY_HANDLED is removed in 0.30.3+ now it's `WSGI_LOCAL.already_handled: bool` # https://github.com/eventlet/eventlet/pull/544 From db3b0819dc3ba6e49a18bb5611fe4c36b014d297 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 00:51:32 +0100 Subject: [PATCH 033/356] build: Update license config to PEP 639 format for uv compatibility --- pyproject.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 97caf78ce..b1a386cd0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,14 +6,14 @@ build-backend = "setuptools.build_meta" # see https://packaging.python.org/en/latest/specifications/pyproject-toml/ name = "gunicorn" authors = [{name = "Benoit Chesneau", email = "benoitc@gunicorn.org"}] -license = {text = "MIT"} +license = "MIT" +license-files = ["LICENSE"] description = "WSGI HTTP Server for UNIX" readme = "README.rst" classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Other Environment", "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX", "Programming Language :: Python", @@ -78,7 +78,6 @@ addopts = "--assert=plain --cov=gunicorn --cov-report=xml" [tool.setuptools] zip-safe = false include-package-data = true -license-files = ["LICENSE"] [tool.setuptools.packages] find = {namespaces = false} From f9df39f600a784f6edabdb9f1777c0eef78a7527 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 00:59:51 +0100 Subject: [PATCH 034/356] gevent: Require gevent 24.10.1+ to address CVE-2024-3219 --- gunicorn/config.py | 4 ++-- gunicorn/workers/ggevent.py | 6 +++--- pyproject.toml | 4 ++-- tests/workers/test_ggevent.py | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gunicorn/config.py b/gunicorn/config.py index 56c7df3cf..2dcf64d0d 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -680,9 +680,9 @@ class WorkerClass(Setting): * ``sync`` * ``eventlet`` - Requires eventlet >= 0.40.3 (or install it via ``pip install gunicorn[eventlet]``) - * ``gevent`` - Requires gevent >= 23.9.0 (or install it via + * ``gevent`` - Requires gevent >= 24.10.1 (or install it via ``pip install gunicorn[gevent]``) - * ``tornado`` - Requires tornado >= 0.2 (or install it via + * ``tornado`` - Requires tornado >= 6.5.0 (or install it via ``pip install gunicorn[tornado]``) * ``gthread`` - Python 2 requires the futures package to be installed (or install it via ``pip install gunicorn[gthread]``) diff --git a/gunicorn/workers/ggevent.py b/gunicorn/workers/ggevent.py index ad9ecc835..2e6238743 100644 --- a/gunicorn/workers/ggevent.py +++ b/gunicorn/workers/ggevent.py @@ -11,11 +11,11 @@ try: import gevent except ImportError: - raise RuntimeError("gevent worker requires gevent 23.9.0 or higher") + raise RuntimeError("gevent worker requires gevent 24.10.1 or higher") else: from packaging.version import parse as parse_version - if parse_version(gevent.__version__) < parse_version('23.9.0'): - raise RuntimeError("gevent worker requires gevent 23.9.0 or higher") + if parse_version(gevent.__version__) < parse_version('24.10.1'): + raise RuntimeError("gevent worker requires gevent 24.10.1 or higher") from gevent.pool import Pool from gevent.server import StreamServer diff --git a/pyproject.toml b/pyproject.toml index b1a386cd0..c176784f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,13 +47,13 @@ Documentation = "https://docs.gunicorn.org" Changelog = "https://docs.gunicorn.org/en/stable/news.html" [project.optional-dependencies] -gevent = ["gevent>=23.9.0"] +gevent = ["gevent>=24.10.1"] eventlet = ["eventlet>=0.40.3"] tornado = ["tornado>=6.5.0"] gthread = [] setproctitle = ["setproctitle"] testing = [ - "gevent>=23.9.0", + "gevent>=24.10.1", "eventlet>=0.40.3", "coverage", "pytest", diff --git a/tests/workers/test_ggevent.py b/tests/workers/test_ggevent.py index 7e5d581ed..8c3c21992 100644 --- a/tests/workers/test_ggevent.py +++ b/tests/workers/test_ggevent.py @@ -20,10 +20,10 @@ def test_import(): def test_version_requirement(): - """Test that gevent 23.9.0+ is required.""" + """Test that gevent 24.10.1+ is required.""" from gunicorn.workers import ggevent from packaging.version import parse as parse_version - assert parse_version(gevent.__version__) >= parse_version('23.9.0') + assert parse_version(gevent.__version__) >= parse_version('24.10.1') class TestGeventWorkerInit: From 58d803977d3a124dd16d97ed7af1df5a2d352c90 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 01:12:46 +0100 Subject: [PATCH 035/356] bump version to 24.0.0, remove sphinx docs --- docs/Makefile | 160 --- docs/README.rst | 19 - docs/gunicorn_ext.py | 102 -- docs/logo/gunicorn.png | Bin 21550 -> 0 bytes docs/logo/gunicorn.svg | 119 -- docs/make.bat | 190 --- docs/site/.nojekyll | 0 docs/site/CNAME | 1 - docs/site/community.html | 13 - docs/site/configuration.html | 13 - docs/site/configure.html | 13 - docs/site/css/style.css | 402 ------ docs/site/deploy.html | 13 - docs/site/deployment.html | 13 - docs/site/design.html | 13 - docs/site/faq.html | 13 - docs/site/images/about.jpg | Bin 17551 -> 0 bytes docs/site/images/arrow.png | Bin 408 -> 0 bytes docs/site/images/banner-bg.jpg | Bin 611 -> 0 bytes docs/site/images/community.jpg | Bin 15593 -> 0 bytes docs/site/images/documents.jpg | Bin 17566 -> 0 bytes docs/site/images/downloads.jpg | Bin 15962 -> 0 bytes docs/site/images/favicon.png | Bin 1771 -> 0 bytes docs/site/images/footer-arrow.png | Bin 255 -> 0 bytes docs/site/images/footer-logo.jpg | Bin 2499 -> 0 bytes docs/site/images/greenbutton.jpg | Bin 335 -> 0 bytes docs/site/images/gunicorn.png | Bin 1553 -> 0 bytes docs/site/images/large_gunicorn.png | Bin 21956 -> 0 bytes docs/site/images/logo-bottom.png | Bin 3145 -> 0 bytes docs/site/images/logo.jpg | Bin 10238 -> 0 bytes docs/site/images/logo.png | Bin 7343 -> 0 bytes docs/site/images/redbutton.jpg | Bin 577 -> 0 bytes docs/site/images/separator.jpg | Bin 440 -> 0 bytes docs/site/images/title.png | Bin 3450 -> 0 bytes docs/site/images/user1.jpg | Bin 2184 -> 0 bytes docs/site/index.html | 185 --- docs/site/install.html | 13 - docs/site/installation.html | 13 - docs/site/js/main.js | 46 - docs/site/news.html | 13 - docs/site/run.html | 13 - docs/site/sitemap.xml | 73 -- docs/site/tuning.html | 13 - docs/site/usage.html | 13 - docs/sitemap_gen.py | 41 - docs/source/2010-news.rst | 211 ---- docs/source/2011-news.rst | 73 -- docs/source/2012-news.rst | 128 -- docs/source/2013-news.rst | 90 -- docs/source/2014-news.rst | 228 ---- docs/source/2015-news.rst | 219 ---- docs/source/2016-news.rst | 91 -- docs/source/2017-news.rst | 46 - docs/source/2018-news.rst | 68 - docs/source/2019-news.rst | 121 -- docs/source/2020-news.rst | 7 - docs/source/2021-news.rst | 54 - docs/source/2023-news.rst | 39 - docs/source/2024-news.rst | 61 - docs/source/_static/gunicorn.png | Bin 14398 -> 0 bytes docs/source/community.rst | 37 - docs/source/conf.py | 72 -- docs/source/configure.rst | 118 -- docs/source/custom.rst | 72 -- docs/source/deploy.rst | 380 ------ docs/source/design.rst | 150 --- docs/source/faq.rst | 244 ---- docs/source/index.rst | 46 - docs/source/install.rst | 172 --- docs/source/instrumentation.rst | 36 - docs/source/news.rst | 83 -- docs/source/run.rst | 184 --- docs/source/settings.rst | 1795 --------------------------- docs/source/signals.rst | 119 -- gunicorn/__init__.py | 2 +- 75 files changed, 1 insertion(+), 6452 deletions(-) delete mode 100644 docs/Makefile delete mode 100644 docs/README.rst delete mode 100755 docs/gunicorn_ext.py delete mode 100644 docs/logo/gunicorn.png delete mode 100644 docs/logo/gunicorn.svg delete mode 100644 docs/make.bat delete mode 100644 docs/site/.nojekyll delete mode 100644 docs/site/CNAME delete mode 100644 docs/site/community.html delete mode 100644 docs/site/configuration.html delete mode 100644 docs/site/configure.html delete mode 100644 docs/site/css/style.css delete mode 100644 docs/site/deploy.html delete mode 100644 docs/site/deployment.html delete mode 100644 docs/site/design.html delete mode 100644 docs/site/faq.html delete mode 100644 docs/site/images/about.jpg delete mode 100644 docs/site/images/arrow.png delete mode 100644 docs/site/images/banner-bg.jpg delete mode 100644 docs/site/images/community.jpg delete mode 100644 docs/site/images/documents.jpg delete mode 100644 docs/site/images/downloads.jpg delete mode 100644 docs/site/images/favicon.png delete mode 100644 docs/site/images/footer-arrow.png delete mode 100644 docs/site/images/footer-logo.jpg delete mode 100644 docs/site/images/greenbutton.jpg delete mode 100644 docs/site/images/gunicorn.png delete mode 100644 docs/site/images/large_gunicorn.png delete mode 100644 docs/site/images/logo-bottom.png delete mode 100644 docs/site/images/logo.jpg delete mode 100644 docs/site/images/logo.png delete mode 100644 docs/site/images/redbutton.jpg delete mode 100644 docs/site/images/separator.jpg delete mode 100644 docs/site/images/title.png delete mode 100644 docs/site/images/user1.jpg delete mode 100644 docs/site/index.html delete mode 100644 docs/site/install.html delete mode 100644 docs/site/installation.html delete mode 100755 docs/site/js/main.js delete mode 100644 docs/site/news.html delete mode 100644 docs/site/run.html delete mode 100644 docs/site/sitemap.xml delete mode 100644 docs/site/tuning.html delete mode 100644 docs/site/usage.html delete mode 100644 docs/sitemap_gen.py delete mode 100644 docs/source/2010-news.rst delete mode 100644 docs/source/2011-news.rst delete mode 100644 docs/source/2012-news.rst delete mode 100644 docs/source/2013-news.rst delete mode 100644 docs/source/2014-news.rst delete mode 100644 docs/source/2015-news.rst delete mode 100644 docs/source/2016-news.rst delete mode 100644 docs/source/2017-news.rst delete mode 100644 docs/source/2018-news.rst delete mode 100644 docs/source/2019-news.rst delete mode 100644 docs/source/2020-news.rst delete mode 100644 docs/source/2021-news.rst delete mode 100644 docs/source/2023-news.rst delete mode 100644 docs/source/2024-news.rst delete mode 100644 docs/source/_static/gunicorn.png delete mode 100644 docs/source/community.rst delete mode 100644 docs/source/conf.py delete mode 100644 docs/source/configure.rst delete mode 100644 docs/source/custom.rst delete mode 100644 docs/source/deploy.rst delete mode 100644 docs/source/design.rst delete mode 100644 docs/source/faq.rst delete mode 100644 docs/source/index.rst delete mode 100644 docs/source/install.rst delete mode 100644 docs/source/instrumentation.rst delete mode 100644 docs/source/news.rst delete mode 100644 docs/source/run.rst delete mode 100644 docs/source/settings.rst delete mode 100644 docs/source/signals.rst diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 7fa4085e6..000000000 --- a/docs/Makefile +++ /dev/null @@ -1,160 +0,0 @@ -# Makefile for Sphinx documentation -# -# if you want to compare this file to current sphinx defaults, recreate it: -# BUILDDIR=build sphinx-quickstart --sep --extensions=gunicorn_ext --templatedir=_templates --makefile --batchfile --no-use-make-mode --master=index - -# You can set these variables from the command line. -PYTHON = python -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = build - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source - -.PHONY: help clean html htmlview dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " htmlview to open the index page built by the html target in your browser" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -htmlview: html - $(PYTHON) -c "import webbrowser; webbrowser.open('build/html/index.html')" - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Gunicorn.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Gunicorn.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/Gunicorn" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Gunicorn" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." diff --git a/docs/README.rst b/docs/README.rst deleted file mode 100644 index 9ec55d05a..000000000 --- a/docs/README.rst +++ /dev/null @@ -1,19 +0,0 @@ -Generate Documentation -====================== - -Requirements ------------- - -To generate documentation you need to install: - - - Python >= 3.7 - - Sphinx (https://www.sphinx-doc.org/) - - -Generate html -------------- -:: - - $ make html - -The command generates html document inside ``build/html`` dir. diff --git a/docs/gunicorn_ext.py b/docs/gunicorn_ext.py deleted file mode 100755 index 4310162eb..000000000 --- a/docs/gunicorn_ext.py +++ /dev/null @@ -1,102 +0,0 @@ -import os -import inspect - -from docutils import nodes, utils - -import gunicorn.config as guncfg - -HEAD = """\ -.. Please update gunicorn/config.py instead. - -.. _settings: - -Settings -======== - -This is an exhaustive list of settings for Gunicorn. Some settings are only -able to be set from a configuration file. The setting name is what should be -used in the configuration file. The command line arguments are listed as well -for reference on setting at the command line. - -.. note:: - - Settings can be specified by using environment variable - ``GUNICORN_CMD_ARGS``. All available command line arguments can be used. - For example, to specify the bind address and number of workers:: - - $ GUNICORN_CMD_ARGS="--bind=127.0.0.1 --workers=3" gunicorn app:app - - .. versionadded:: 19.7 - -""" -ISSUE_URI = 'https://github.com/benoitc/gunicorn/issues/%s' -PULL_REQUEST_URI = 'https://github.com/benoitc/gunicorn/pull/%s' - - -def format_settings(app): - settings_file = os.path.join(app.srcdir, "settings.rst") - ret = [] - known_settings = sorted(guncfg.KNOWN_SETTINGS, key=lambda s: s.section) - for i, s in enumerate(known_settings): - if i == 0 or s.section != known_settings[i - 1].section: - ret.append("%s\n%s\n\n" % (s.section, "-" * len(s.section))) - ret.append(fmt_setting(s)) - - with open(settings_file, 'w') as settings: - settings.write(HEAD) - settings.write(''.join(ret)) - - -def fmt_setting(s): - if hasattr(s, "default_doc"): - val = s.default_doc - elif callable(s.default): - val = inspect.getsource(s.default) - val = "\n".join(" %s" % line for line in val.splitlines()) - val = "\n\n.. code-block:: python\n\n" + val - elif s.default == '': - val = "``''``" - else: - val = "``%r``" % s.default - - if s.cli and s.meta: - cli = " or ".join("``%s %s``" % (arg, s.meta) for arg in s.cli) - elif s.cli: - cli = " or ".join("``%s``" % arg for arg in s.cli) - else: - cli = "" - - out = [] - out.append(".. _%s:\n" % s.name.replace("_", "-")) - out.append("``%s``" % s.name) - out.append("~" * (len(s.name) + 4)) - out.append("") - if s.cli: - out.append("**Command line:** %s" % cli) - out.append("") - out.append("**Default:** %s" % val) - out.append("") - out.append(s.desc) - out.append("") - out.append("") - return "\n".join(out) - - -def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): - issue = utils.unescape(text) - text = 'issue ' + issue - refnode = nodes.reference(text, text, refuri=ISSUE_URI % issue) - return [refnode], [] - - -def pull_request_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): - issue = utils.unescape(text) - text = 'pull request ' + issue - refnode = nodes.reference(text, text, refuri=PULL_REQUEST_URI % issue) - return [refnode], [] - - -def setup(app): - app.connect('builder-inited', format_settings) - app.add_role('issue', issue_role) - app.add_role('pr', pull_request_role) diff --git a/docs/logo/gunicorn.png b/docs/logo/gunicorn.png deleted file mode 100644 index 8b9e4c9e37d16b2127ed4fb97dbba68c1d974d05..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21550 zcmX`T1yq#Z_dWd3-Q6kO4bqJ?f^?U3N|$tpbeDki|Kaofz3(E| zux94Qx##Y)_ddjEs3~BelA;0tfT5%)s|5hCTj1}7$cW%~6p?u`@CTxWvVtt|{POX+ zqd4{D53Y*(9^f_E|j2^YtN{ zndx8SrCV~hV8ljFu0DNz3;m^K0F{hpH{?}gLN!#@cZ#ZzynUmr?1tva`8tLo1OKi@ zPSP>Kae+aj4j*}4((p4oyJ3h(@~1I1Hp6V;H7dg7NVY~Bc~Yg_8&O}q!WNIy7Tc5d zoAH)iTu0niW^EA-kuw=4q3A4sc7(W*CT3I8d

?8|Dz+nSHCguwYKUu1#rsk>U8_C1EBr3T5Qo=EsF z9iF084+*go*Y>LJV1lv;TFdG>FSp~-E?(Onm6i_IVm!?ms_1>rKIplQTU^8O{@;_a zFQk)$<*(Wg^uMjonH^njcWuvQl?XfcQ4LO)`W`PYIQAqpw?sT!@Fw;l0O5;fH4M45Hrj_87cd2#;wHw@Jk}8F^PD{0%ekAbsBVzqNt? z5`u7RJ3U^pGD~}iiXBV@4Ig_rq6ncwkFESnF!5L5FGFsn!six0v5?=R_1U^%?@5SH z;e4=up27_;+5A2_?rgq?bCdYrYklMi>@968V_;^egrBkohMUf&_|ZL?N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nKw-_arSf;gSPGKntu86T16>tg?^4%OFqZ zGWYa~_WpYd4vxJaKf)6juoe{#TWVNa9 zMV?3@A0$k~!Z^2nH1A5sR#@%*8MuQ(l_i-;51&+x^}> zNElJA&mSKn0PqDRnx6>E8IZGk|4fBKO} z%I=HLanVrnTL$cvEOmOendmQx&Cf%HT8CnsU@n-I?yDDconU=XwqF!XJixHB+gjmQeICsCY3C8h7m5EWXc{JF_ z=)E63lFZM^=~Hp52A?G{!BA9h5#IB`ZNH&da)P@565F(I7e8ND)p%oolqRiaG`py% z$e&Z6FHQ)KvU%xImNC?4>Y4qhTp5nyi9#aZ{q854N)?W&cY$hf!|wNF?2ffogDUM& zsDjm+QQNbGEK5CTARf2Cj4lJ-Kk6vOJhzsEQ88k-li)0?9lhoT9B|8+q{D`8);gl< zgEpO;e5SQcU=bSd|Ff?Y!xhOin)>$d)OQsXvge}IQbyL+q|e`i!+BrzdgNtg-D0Ev z)E5$ODl5zD7Co-0v?@Y6emvRdRBGrHn41{xljIN~V~#SS{2&VXp~~sozZcilk0#*k zLEXE@I-{zerDg3(N1B~vdq0K*dV8CLUN<#O1O^1CgMwE|igQv`LjU}guSv(uJMlg1 UDTUz|0cB5+k-j;sLf0kwe>b0C>;M1& diff --git a/docs/logo/gunicorn.svg b/docs/logo/gunicorn.svg deleted file mode 100644 index 073f2029c..000000000 --- a/docs/logo/gunicorn.svg +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - g - - - - - diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 705fcdcdf..000000000 --- a/docs/make.bat +++ /dev/null @@ -1,190 +0,0 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set BUILDDIR=build -set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source -set I18NSPHINXOPTS=%SPHINXOPTS% source -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% - set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. singlehtml to make a single large HTML file - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. devhelp to make HTML files and a Devhelp project - echo. epub to make an epub - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. text to make text files - echo. man to make manual pages - echo. texinfo to make Texinfo files - echo. gettext to make PO message catalogs - echo. changes to make an overview over all changed/added/deprecated items - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - goto end -) - -if "%1" == "clean" ( - for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i - del /q /s %BUILDDIR%\* - goto end -) - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/html. - goto end -) - -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. - goto end -) - -if "%1" == "singlehtml" ( - %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in %BUILDDIR%/htmlhelp. - goto end -) - -if "%1" == "qthelp" ( - %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run "qcollectiongenerator" with the ^ -.qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Gunicorn.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Gunicorn.ghc - goto end -) - -if "%1" == "devhelp" ( - %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. - goto end -) - -if "%1" == "epub" ( - %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub file is in %BUILDDIR%/epub. - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "text" ( - %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The text files are in %BUILDDIR%/text. - goto end -) - -if "%1" == "man" ( - %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The manual pages are in %BUILDDIR%/man. - goto end -) - -if "%1" == "texinfo" ( - %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. - goto end -) - -if "%1" == "gettext" ( - %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The message catalogs are in %BUILDDIR%/locale. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes - if errorlevel 1 exit /b 1 - echo. - echo.The overview file is in %BUILDDIR%/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - if errorlevel 1 exit /b 1 - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest - if errorlevel 1 exit /b 1 - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in %BUILDDIR%/doctest/output.txt. - goto end -) - -:end diff --git a/docs/site/.nojekyll b/docs/site/.nojekyll deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/site/CNAME b/docs/site/CNAME deleted file mode 100644 index b9f0ffbce..000000000 --- a/docs/site/CNAME +++ /dev/null @@ -1 +0,0 @@ -gunicorn.org diff --git a/docs/site/community.html b/docs/site/community.html deleted file mode 100644 index f6fae4d49..000000000 --- a/docs/site/community.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Green Unicorn - Community - - -

- Redirecting to here -

- - diff --git a/docs/site/configuration.html b/docs/site/configuration.html deleted file mode 100644 index 88bcf3026..000000000 --- a/docs/site/configuration.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Green Unicorn - Configuration - - -

- Redirecting to here -

- - diff --git a/docs/site/configure.html b/docs/site/configure.html deleted file mode 100644 index 3028eb9c2..000000000 --- a/docs/site/configure.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Green Unicorn - Configure - - -

- Redirecting to here -

- - diff --git a/docs/site/css/style.css b/docs/site/css/style.css deleted file mode 100644 index aec17c997..000000000 --- a/docs/site/css/style.css +++ /dev/null @@ -1,402 +0,0 @@ -html,body { - margin: 0; - padding: 0; -} - -h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,cite, -code,del,dfn,em,img,q,s,samp,small,strike,strong,sub,sup,tt,var, -dd,dl,dt,li,ol,ul,fieldset,form,label,legend,button,table,caption, -tbody,tfoot,thead,tr,th,td { - margin: 0; - padding: 0; - border: 0; - font: inherit; - vertical-align: baseline; -} - -ol,ul { - list-style: none; -} - -html { - overflow-y: scroll; - font-size: 100%; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; -} - -a:hover, a:active, a:focus { - outline: 0; -} - -img { - border: 0; - -ms-interpolation-mode: bicubic; -} - -body { - background: #F8F8F3; - margin: 0; - font: 14px/1.4 "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, "Lucida Grande", sans-serif; - color: #67686B; - height: auto; -} - -a, -a:hover { - text-decoration: none; -} - -.clearall { - clear: both; - display: block; - overflow: hidden; - visibility: hidden; - width: 0; - height: 0; -} - -.logo-wrapper { - border-bottom: 1px solid #2A8729; -} - -.latest { - width: 150px; - top: 0; - display: block; - float: right; - font-weight: bold; -} - - -.logo-div { - width: 1000px; - margin: 0 auto; - padding: 5px; - height: 72px; -} - -.logo { - width: 250px; - margin: 0 auto; - height: 119px; - background: url(../images/logo-bottom.png) no-repeat bottom center; - position: relative; - z-index: 99999; -} - -.banner-wrapper { - background: url(../images/banner-bg.jpg) repeat; - display: block; - width: 100%; - min-height: 365px; - margin-top: 1px; - margin-bottom: 1px; -} - -.banner { - width: 1000px; - margin: 0 auto; - padding: 15px; -} - -.title { - width: 250px; - margin: 0 auto; - margin-top: 32px; - text-align:center; -} - -.banner h1 { - font-size: 20px; - color: #FFF; - margin: 15px 10px 0; - padding: 5px 40px; - text-align: center; - line-height: 28px; -} - -.greenbutton { - background: url(../images/greenbutton.jpg) repeat-x; - height: 54px; - width: 224px; - line-height: 54px; - display: inline-block; - text-align: center; - border-radius: 3px; - border: solid 1px #1D692D; - color: #fff; - font-size: 22px; - letter-spacing: 1px; - text-shadow: 1px 1px 1px #000; -} - -.greenbutton:hover { - background: url(../images/greenbutton.jpg) repeat-x bottom; -} - -.redbutton { - background: url(../images/redbutton.jpg) repeat-x; - height: 54px; - width: 224px; - line-height: 54px; - display: inline-block; - text-align: center; - border-radius: 3px; - border: solid 1px #7D180A; - color: #fff; - font-size: 22px; - letter-spacing: 1px; - text-shadow: 1px 1px 1px #000; -} - -.redbutton:hover { - background: url(../images/redbutton.jpg) repeat-x bottom; -} - -.banner-button { - width: 460px; - margin: 0 auto; - margin-top: 30px; -} - -.banner-link { - width: 250px; - margin: 0 auto; - margin-top: 15px; - padding: 5px; - text-align: center; -} - -.banner-link a { - color: #fff; - font-weight: 700; - letter-spacing: 1px; -} - -.banner-link a:hover { - color: #000; -} - -.mid-wrapper { - width: 100%; - border-top: 1px solid #2A8729; - padding-top: 15px; -} - -.tabs { - width: 1000px; - margin: 0 auto; - padding: 3px; - margin-top: 5px; - margin-bottom: 25px; -} - -.tab-bar li { - width: 230px; - padding: 3px; - text-align: center; - float: left; - margin-right: 5px; - margin-left: 6px; -} - -.tab-bar li a { - display: inline-block; -} - -.tab-bar li a:hover > p, -.tab-bar li a:hover > h2 { - color: #1D692D; -} - -.tab-bar li a p, -.tab-bar li a h2 { - color: #404028; - margin-top: 8px; - line-height: 1.2; -} - -.tab-bar li a h2 { - font-weight: 700; - text-transform: uppercase; -} - -.withborder { - background: url(../images/separator.jpg) no-repeat; -} - -.gabout, .gcommunity, .gdownloads, .gdocuments { - height: 80px; - width: 230px; - padding-top: 118px; -} - -.gabout { - background: url(../images/about.jpg) no-repeat 50% 0; -} - -.gcommunity { - background: url(../images/community.jpg) no-repeat 50% 0; -} - -.gdocuments { - background: url(../images/documents.jpg) no-repeat 50% 0; -} - -.gdownloads { - background: url(../images/downloads.jpg) no-repeat 50% 0; -} - -.tabs li.active a, -.gabout:hover, -.gcommunity:hover, -.gdocuments:hover, -.gdownloads:hover { - background-position: 50% -220px; -} - -.tabs div { - display:none; -} - -.tabs div.active { - display: block; -} - -.tab-box { - color: #3F3F27; - border: 1px solid #DDDDD5; - padding: 25px 35px; - position: relative; - margin-top: 20px; - border-radius: 3px; -} - -.tab-box h1 { - font-size: 28px; - color: #2A8729; -} - -.tab-box p { - margin: 0 0 9px; -} - -.tab-box ul { - padding-left: 40px; -} - -.tab-box li { - list-style: disc; - margin: 0 0 9px; -} - -.tab-box a, -.latest a { - color: #3F3F27; - text-decoration: underline; -} - -.tab-box a:hover, -.latest a:hover { - color: #1D692D; -} - -.arrow { - background: url(../images/arrow.png) no-repeat; - position: absolute; - left: 115px; - top: -7px; - height: 10px; - width: 20px; -} - -pre { - font-family: Menlo, Monaco, Consolas, "Courier New", monospace; - font-size: 14px; - color: #333333; - display: block; - padding: 8.5px; - margin: 0 0 9px; - font-size: 14px; - line-height: 18px; - word-break: break-all; - word-wrap: break-word; - white-space: pre; - white-space: pre-wrap; - background-color: #EEFFCC; - border-top: 1px solid #A9CC99; - border-bottom: 1px solid #A9CC99; -} - -.user-wrapper { - background: url(../images/banner-bg.jpg) repeat; - height: 110px; -} - -.users { - width: 1000px; - padding: 20px 5px; - margin: 0 auto; - color: #fff; -} - -.users h3 { - font-size: 12px; - margin-left: 5px; - padding-top: 15px; -} - -.users h2 { - font-size: 26px; - margin-left: 5px; -} - -.users .left-details { - width: 120px; - float: left; - height: 66px; - background: url(../images/footer-arrow.png) no-repeat top right; - padding-right: 15px; - text-align: right; -} - -.users .company-logos { - float: left; - width: 820px; - height: 70px; - margin-left: 20px; -} - -.users .company-logos a img { - float: left; - border: solid 1px #004000; - margin: 0 6px; -} - -.users .company-logos a:hover img { - border: solid 1px #000; -} - -.footer { - background-color: #F8F8F3; - display: block; - height: 70px; -} - -.footer .footer-wp { - margin: 0 auto; - padding: 15px 5px; - width: 930px; - background: url(../images/footer-logo.jpg) no-repeat 0 50%; - padding-left: 70px; -} - -.footer-wp a { - color: #3F3F27; - text-decoration: underline; -} - -.footer-wp a:hover { - color: #1D692D; -} diff --git a/docs/site/deploy.html b/docs/site/deploy.html deleted file mode 100644 index 97568d2e0..000000000 --- a/docs/site/deploy.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Green Unicorn - Deployment - - -

- Redirecting to here -

- - diff --git a/docs/site/deployment.html b/docs/site/deployment.html deleted file mode 100644 index 2ccee4bbd..000000000 --- a/docs/site/deployment.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Green Unicorn - Deployment - - -

- Redirecting to here -

- - \ No newline at end of file diff --git a/docs/site/design.html b/docs/site/design.html deleted file mode 100644 index 38f04705f..000000000 --- a/docs/site/design.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Green Unicorn - Design - - -

- Redirecting to here -

- - diff --git a/docs/site/faq.html b/docs/site/faq.html deleted file mode 100644 index 5dbdc0b1b..000000000 --- a/docs/site/faq.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Green Unicorn - FAQ - - -

- Redirecting to here -

- - diff --git a/docs/site/images/about.jpg b/docs/site/images/about.jpg deleted file mode 100644 index 4aab4d50f53ffc2f77e8ee20667b3e4d648bcf06..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17551 zcmeIZXH-*dw=Nt(ML?uUZz8=*@1Q6k9Rh?73euYa>FrUPLMTE4(xrsZLJutz1p*S9 z^b(2?iuB&w=d;gw_u1cmpFd}uaejT@${1^8t-0@(%l5DpBgk&kTqjioFJNr~qx>f6lGir4je~KJ?u1L(;+?r-XMkEghGU zU0%WP%{1UX;h)>5B%}l=1GX1le|t)C`xfATXLswsqEU~{v|eNysri*-B?vUYKNe1Y z5#y~%z#KLvE6yvG)a%SO){@AP87&TulIr89^X#6MdZ67w(%U`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6l>J0|ghp|#SY#0!{ z&t&HME^zRtZidbcV4d-5t9?+*!Xk)vJkSBD^Sp!g&kOd<0y~|G1iPz@nY4%TIjHYT z-|%0g=Ysm5f370{RnBP#nj6yzS48#?ZI2MMn=l%n10iNqhPy}Senh|1-$A!(n}DUv zws`#vbm?9kpR^hjzk2W4#bw=txZej65`1dNa+qdIpJ;69s=zc>t6%|lV303T;i(CU z9g4x<4|*fuSbx9#dGO>qnyO`HgAJY|Z{=vkLrIfOgyHcK#$IrS@ q0u)dp4GQ)8-4?~dak?F(>nW7F(V0AEtN)+q{NG~z|N7z0)c*rOlRKIK diff --git a/docs/site/images/arrow.png b/docs/site/images/arrow.png deleted file mode 100644 index 754d3091963e5732e509ce7914c6a021a87ec9c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 408 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~g!3HGv?z=Y!NU;<zo7-q&JnvO(0TEc)td-$wI-PP4EAvE+TxSAF+M9ho8jh~stUt(um& z^}9QY?>taxd9(JC!m&RL))Dg#7|grAq4RM*o8hx!i=#|om$&>3T6+6+Y5MWydz1BB z-dJjO`7vLAkz6ljM3& tdw#xe6wpooxa#93@wBi1-=zMN;lq^Zk4qO`%>eqH!PC{xWt~$(698>8q}Kod diff --git a/docs/site/images/banner-bg.jpg b/docs/site/images/banner-bg.jpg deleted file mode 100644 index 0ba44ffab74b351732f74137593e3caf861c9222..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 611 zcmex=zQ(>wG|JTI;ezJF5U&x*yqSK9k#cRnw``w^4 z`9|4ibBnZUej8ur*AFJ2Wwu}m7T4K3=WKq8z|q}%(t5Y=t#H;o(LI^bV*={|fd?Y; zk8TysUmA5nYu{Wg@hkgQf3KDQm^jhCb@lGe546@9hQ|GISreYrvQ#M6^PSAAHoednaeqs7+lv1OgQPhDo#>{XZ zf#AjMu)p)|v+vB__srZmGxv`>cV*_C=Y7|^R#u)o@_XcN=I%F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site/images/documents.jpg deleted file mode 100644 index d96d8ca90217e6df4e7cb8aa75970ce685c571e0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17566 zcmeIZWl&sC*DpE=5l8}o5ZsdB?rsSQBn&XPTX2Uk=%7h(7$Csl41~ZykbxkBOK^wa z?hG<8gS*}Q&pFRIZ`Jd>A8y?bx9ZmIUA3#aSMRlD?OyA*q;IEgmjJ{-1w{qGojZ2` zAO0SI+gZTde|rCq+CNPGA2Imn;@jT<68t;XfOWh(B!IglckoE=+_nSg0e1j*?*Bsv z{Hx*LfAEmt(LKDo|ImTNfIIi@-no14-ralmpFR9L3lH$O_jd}(GkntLFA2zA@iV?5 zr(jYS5ERlGqhuBq)i5)6_3-=xOH8V)8XjR0Q_u{GOUVAqi}s(J{KMk^v^#h4{^5oH zm#X&nsqWzY(|?Hn;NgRZe<%GzCAt6d!83l+S8voGJ{K@^mDBhVmtD5UsA&%V+A=&s zCa7f*4`X5$F0ZIu7O{47_t+c7=P2tzo4ORa+18jr!R|Kkby@` z6u^0ubCNBZC?5XWxQiPczLKQ$)5f5kx8&30xK?&qHg9$cd^)(6m1K*k`mU$So%JF9 z9q;DCN+xKd&6{S8__h`-_Hj2a-`1(%pAx6_o6&Cp`JGGVEq4ZR80U${r4qM*eeD}L z%79&DAZg$G#2VZ=6A3n@E-dJzM(~*k;CgYcUHtcIk9Yv+4-}p?{YE$U#=sOgAE@<9 z+%zr_8pOAx7Jr}Q)hN|NwtlzZ^kOT5js*c|`h4!-4)#R*14HG1|CR2zIHrRrG;?UC z(@m5p%a97+6_mtj;Un%Jhdb5rKpnHz>7B&H-?8-Tsh0dgc_Sd#ul-rIJjiCIBy5~w zQ|P0)b6!?uF5_g8IXmbtUYU~mNIK;WHY*HC_@B7cnhuWL0%)5fXnC2BDWsi0t$hGIFHZ#;ig0P}vT$0r znU^0sdt`*~)quxhJ`8V*EAUJ%y@{SOPg$l^5WMIxGV1}!inu}(&d@g4m%U94gi*8l zXt;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R2_KQ%$wI<#KO?*p@l`8A3eORlfOnN>HZuJ#=B|2ZQ3ggyr`BPh?r>;y6@ zmgjwmM-E+Kb*bab9(&QKiOqtLEGYK-Opnu@-PZBeBCU)i>oB`A%Tzn)2)QD z?ui7&tEp*Emsk2xstRc;;;bHCKNrppMi8LEglijN4ezdj0*c)|!4vwRqenynW5Oy5 z=Uqq%{}4EPK&1sunA-xYAk5L{8l`*f|RNxt5Vx8oMFjF{vjw>vvio7=M__fE58G-*vYm95SNiH(FN65zt$L0#GA(bic)_iwRO^RV Pk8A&5EZLO3o&LW7$>xZ$ diff --git a/docs/site/images/downloads.jpg b/docs/site/images/downloads.jpg deleted file mode 100644 index 9c4f93734aaf6a1ab0512e63b07d84cb3d9ebdb3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15962 zcmeHtXHZ*Nlc;Qu12)(O6HFd*29q<4$&wJ5Y>fE$3D zxBkH#@K3mV?+(TN+dtj9ar64V&SL=J&dr-QZr%Lp<_#+9zaF`9^VUzd@7$%Pd2)}I zgMyBplS`cYx!O}k2}vm#byFKh_q=5WUIVjNwn*>alQH>~Rik6XYfdcJCIQ^N{`?30 zgVXhJ*LQWVWxDwf`re(px9{Hm_i?CcIK=Nfd2Vo*^OgJWv=VBDHu2fzbX*<@Uxy^s zjf~&U?J!88K9A6Io7m&pO=c!ad?WLUq@3zfl^SMyS;bYR7%E9@dG_#Lo;eJO5ry$W3mcNbkF{XMG zQl55%{Pq;cPL`H~g$JBAHO*FH*gJrnN)lwrqBBsh?~+7b2UWTzBSr$d)S1Q#5}OMD zF(5}u36bFOP%DCieJhEn0cC$Cp0)k*Kbs}6!cn~>oHOWs9*5dTLMBSksK7pyNxLT< zNu=Ue17AK-oqa2Y;VP%;gz6ZY9DY` ziRVEuU74AiX!Mhfi(b-spO)((NrK5(N0!?CbUTaATiFO|&L$Xwa?j9p~>bc8VsPnu_Z3@Xu*i03h<@ zGLX!@U2;hXX}AKUu%Z*rV*Q(a5r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W`8TRqqPK{VG)JSSWVpyKnUkBuxXj_z@JpxGlr z*PQ8kUmK|C>STgMJLTagY@ek)4bwAFmMnFAhc=Bb&rX`1Hf48U=+j+p4&&ecizolT Jx)5?j`d_V&u)qKS diff --git a/docs/site/images/favicon.png b/docs/site/images/favicon.png deleted file mode 100644 index 63bef255b39f70d9ad144a76b16f1340178077a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1771 zcmV;P)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RX2Nw_q8Tip@^Z)<`eMv+?R7l6Q zR&9(GR~deuGc)(jUGDAzyTAeqwLqXPx>_QLVq(OaGze+>qXf|cEv3PxYMNLR5)(C5 zYfNlN6Jyf;Xwnp@5>nbo3lfcy+F!5=f)r?>eC znVECmujhT9_b`eFJbI~3Ndh1Z0m%u3B!Yq{0t5x*%l`Mvoa;aT;(^~)N)-S`eE;(M zM=u>K2VvPO1%BYcfS?E%cjwjtFiD0!ymscde|uqG`@FS_*7Vo=9(-w4TeYpV+|pic zUova)rllLJr3oYf5yTz(U_GhR+wJ>$K5=DnwOJq;Q|NVzf9;(^`kcP^TBf0iYpxp6P)@-+Y@kQ@o@1`J4o zBx#*pzTlgmpV8%h;dq}H(I`)~Y!q-aQykn(>{G7|GAN$1=+Ame7}taU{ZNC3td z0QD?6bnZ~GNJW)$R3rxokl;uoj_2U!ngL+uvLuU1I43}<&0g!?k(*sSG-TwH++C>1Axz!+}c%ZN>Rm#;3+aKR|V(+Of$9o5QSHHS8P7|@HS;MAtC*R$$ z$(7-2Q5yTkGsYMi>ukVa%L70D&f;}ZG*HlHWS4(qPsGXa#w8m%CQJ>yprhJR^2>>B z2t7?egE)}yhsKiT`!l3#jg;mS;w0#(rdlMF`jBWUF$yW-`CFArbJ zo9xq@T@qn@&)c=`_0HB#QUXXb7K2=c9Grmw10y3sx3>;JP(7*d`OiD0pd^qm`FC^6 zQp!mnAW9-Y-JY)^pui8d9(d97LqTG}BQp-UNrJVwHr$Ac#N;H51gfI%rTn9qOB5S6 zwa_c?y&U@GoTs;xh(*v=_L(=I9Y|`qeJ4XWz{ycCfK!o|02v2DQ5tPt`b60)?>Vv0 zNf1awa-0mpu;uApKkUBnPmewT$`#54j}Ty8QM00Uj!0d0@6-hkbv;}O!k${sP-A#h z6USl@_`%NZ*AJZihwu9iF0+|H&{X`UB#VaAC~CxUmNc>ia0UcmAc75>&Y!wqTJw}z zT*K2dy=6uw5q5FLImuD{?Cj$aK1HC7%oFKVn`Lp{r@BQ|owV_u^ zWlvxI&_m!Ek08OW>0JT+%%wm2`ZH_pU!7zP-}rAF+x^wMmo>8F;Dv)D-FpkjgUOI{ zwzb^4VabNfX3ar3scEv6J<@wrR8DDy|vWpncwv zo+GI&#}zvgsch%O=`cQs_G;T_+GZP?fAtSw@UR(Q$4~xFDpl^8x-cJQhGt9`p}jh}qq!rt(F=dy3LtaYBa7C|XrA65 z_1B`BA#;*mt6!D$#m+@tGd?HDN;}tWuSK=qfnL&(#Y7wja;W<1HEV6x%q~Mi0&vacYG>=r(|udZKf;w%9$I5^bSHkrfq>v;weoO9M%N!HrjU!GQy zCaFt9FC59zIXOtA8I3Fm0xMT3mp#ufl}f(va>a+Qj#vNx|1UYgP?%ZFf%jnh zeYsaj!7qP*xb0k+b8E4DUG<4Zy%Pry91!R|tMm~l`%B>I67NqjpQ2}6V4Vr(fz~j1y85}Sb4q9e0GH@hApigX diff --git a/docs/site/images/footer-logo.jpg b/docs/site/images/footer-logo.jpg deleted file mode 100644 index cf6e5e399db2676ca79e0691690a06d6e26f443f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2499 zcmbtVc{tQ-8~)A0vBt=fZRTW#$* zK!E*j06TAi<3CUT2tP&sk-*R5ogM%t2IvAuAs`q4hJhe3&<+Ps1po->=lUN+e-Q&g zMI?4feOUku27@3_5Evr<_l4aADgqM)^Jw+Fyq56`tE9YERBq$7YsS-#3)X9oz}j>@sBNtLnhKZ zuj9%cY{9d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vH`$E8Dtb(4nOhTX*^fA} z9}#ATEyzSFo9wviyxOGFYj=2$gT1<*WHF+&Rca{SLEl25EkLTu|b+WJ82hL7XcnoPoi%F0V<%%U^zG5U^SUu9| zN&fqrI2I|3IX`~NC|YUSez{jiw@@d?n^EGbpt`m)>89@{{Jo`zFEBRCSWn%fS`WSl z#L3g_NU=wx=WxGIcHD2o*Thy~*PB%DNzpI$rR?DlH~%nZE(K71 zSwu4evhTG5p|9-Q<5GWrKE0xm$7yMn5Fe|RoG%S6qxbmD_Hw2r0!O}twHovFEZ&6- zilcm5x~*&ok`Hi9lJ@G8gW4SG)bbQq5fK;^@!2)8UM9PkQ!$uPtVZ@WdGMO@=-snB zo%(ByH(=%N>iw)YwHSVnoP)Xfe7-<$%mEqWxVi(J^^ck^|LO`r>Y5Fzh{QYtM(Bw~ SXC~Dw&sm5@vAUCXxc>p~s!|jH diff --git a/docs/site/images/greenbutton.jpg b/docs/site/images/greenbutton.jpg deleted file mode 100644 index 0f8d7ac3bdb0c3edf4b6d33cdf4fbdf46b867044..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 335 zcmex=i3*BJ!6k`h{6D}T z$ia}qz{Jcb$iO7X$SlbC{|JL50|PV2u}FZCg_VgJC?zYv$iT$FjwHh%B+SSnC=$Hz zB2Zcas102w6Du1~MpO{hK%fbN|8FtyFaymKWENzwXSlZUL?z2Mj#&qV&&Ub0d}h9x ZZt?r@g>0@T+<}~u3lfw?l==VP1OPDBGjIR^ diff --git a/docs/site/images/gunicorn.png b/docs/site/images/gunicorn.png deleted file mode 100644 index 98aaf382c1e58d9cc7eb6b6e49f15c0e2ec0e914..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1553 zcmV+s2JZQZP)#d>2 z=nOG2NKrHb5^=D)-mu=V3SMFWK|=+cK%*!hXcY@+W+2f@^aJ&hWhq`zgBn^$vD8|j zmhSe<@x${@cXr*`w$Nxl_)jM9c`xU^JkS66Kku2WEKAj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n.png deleted file mode 100644 index 403301fc0610ea6699749b5c14916e23737fd49a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21956 zcmYIw2RzjOAO9U8WE|P6uB6Zqvgun#Nmkt1BQyJC@4HkkGnJ8G0?lg#v;f9gTdIeZ=&wNVDv=r?~bF4 z;7{xPDI4(D5ua%n~(intm6f*`_AbLs)8`s379tOALGD`Kf?hTqUiO_Wqlmywckf?K0ov0 zA5`?wJ1DG{>e@Kp5l!EsSH7BW&Po#47=-su>bl(FP^ACyM(6p6%FV^6N9eTwZnS1T z;;g9Ce;@E=HDhCLz5eyxjrO)PJAX3XZ)C~3+SX;?li#Zg;b{vMZTi;M3mtiV#bbem0qve^Hgh@H{=5QD}k z#!bQ48UDhYUM^^8&}Xn@JQLrV|L}a~PKMS7{41OrKY`D!JRMOmQ1pLyR`cRc5qos^ zJx5v!neXxDQx$JwalVuGzOl=bs=H}+e&38~*(B;jgn~;_-+#NCg?|3KyX+4<#o2=6 z*YoI1U=na=XKnTJq9Luzk#>IOrSM+*-to?<5!3vkxc_8uPVyXvsm0|T!;+6}%U$(9 zY_wyvX6d%l^Wx=qV-1S*7DX&?Ot#`$^LN%GNE(CSTlt%v-T%Eat>}jx&k4QUmv}4u zbzIAh%_SxrH~u+s;EZto_XhGx)~Cie6?&Cgc_yarz5 zsJ(BQ^hDr)Pv4esHTqXrp0*LT`nG?0)g56ZxCtrix%k#6c=sv2+(A70y7i|@=W{G3 zG|W)Js}xAL?Y|Q|HmUnpYOM58a2p0E&k3VNSSN+2B!J=boRclvsJD*Xqm9yA8dl!w z|Jn?Ne-&PJ{$Gh9u}8{+n6mdzl$=#j(OF4X{k1A)>mgR|Y76VF3QUl0^CBw$x5Zci z-lr3`8oN0%iOG<$`ZxJmu+c=-KT&Ufcu311WeD;@A7|d>Q4PvxQ1kQ zQc_QXFJe}lc8wNF8~1n00go}1-R0{osXU;od)%k)@t@($-!m>(KC748@2#8qmx1Ch zu%Ju3LsO+a09MI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edvaY(4C%_3o%k@5m`GGpr-$M~QB@)o10zcc1km z#{C-DYp%1!eE2JfbC0L0?L9o((w!Eqn^W0aqex@YiHt1+{MQ@pPfXnQK7z|xky{iqn%I3^@&5d!K@Ba1%Ndwr`C^NLq3Xt* z#olZcjGFYJsJaDrs0O0+!k8iy9EPBH_OkcrQ=Ddmggs)lb3ab_9jZmY0!{Tr=jkr@ zgjFBxSi7k7)Fz*B8S-jeD#ytD4xBIh=Ezoq!#(cH4gQ;kR_@s`h7nZ!_ua=gPcAU6 z41W3Y1rMotC62-YH9JkLq$cv8`JrV#|GIH;t%Ngc1wP`mg2967mUV~E5*}Vxw5yZ` z9}h|9uCLf4dg$zCXLV-WQCHIBeAAdY(RkOAD&6G<_2gAb{)-j~+*00NcIr&?m}|ps zPE^wYPhcQ(F^7xsX(cYq`KTVFXbq5#ToZ~&ke{Im+Xub+s{pIHi!iMAc&xPe0xEQ`L7QRo4Rngidj4yv;eW{nHr9yAk5>=V5)ox)G zYi>S;`=7(D4x=j8juG!E?vnb7vixU3mQNq(BJ!E@r<%))D78|C$v#Io4|%UD?4_uV`BbR>jVx{C*D~?Rc0z-JwHk+O(Pt34? z@?i8A&H;D%iNoSRApQ|aB$ZBvlY48> zi+lz7N?&8*p6G8>L>pU_6ZBq@sbw|2lxX&i^u>CRaKe`fjfL zei>E;vs>?RQ)Dbr=~dvbP?gmFSq1VAD&OnKPj>o=L@ECGv2g$iE`6#C7-)N{@zIm9 zlVd%vxnN`_5tf}`1VQI1l8PYlyGSat5%3in6W3IIc}ViXb1Lpm^s?Um{%o7l)X52n3;KEAAgvV=&^jOPs9Sex=SBnic9(xSuss5s6FD)T+GR zguJ{|>RK8em4B;usn@I5pWZ$rQYth=fZn~1%_L^ht4NX`Pl*6mvnY%T#-jGym1vU M);G~B({X(If7)*~H2?qr diff --git a/docs/site/images/logo-bottom.png b/docs/site/images/logo-bottom.png deleted file mode 100644 index 9264bed93577d581d2b8d72898e97197c019fb48..0000000000000000000000000000000000000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-b|_~^@}h9Ot)A8MnoJ3qXzJaV_=mz7`E2P*9PNeHYE3@no{M=q)h+hl)V0e^n!`; zvGHz&r04+ZfpZL;n>!73A?~9S;S-`(JOfvfX9Ck0xW_OZh?D)Y{(ASd?sKiRzNi`@L#!z^e!Z1DLc%vWMJ!T@;Dqpd51!Che_n(=+OfU-_zZ zeP=zra_=p#xqNQy9rjyZt8x7K)R{dpb5ki*Xq1{ztU5Me)EWbNtzN#vnBq$tlOD{7 z%Lo)$3U%WX#+$V&t%rfPdR>h?E(5i|`N-=baTtm42_r`=Fg_B*EWpCR=Mts>CLj(l z$bMPf=5BM_+wGmrUCr8?o|~$ho{pf)*Q@sUJW8+MtC9nNH&;#i3YPWF*YGEE@8ZHYUI4x!K@fx?{~HT}Ac*h@f*^?S j34$Pq@Ckw-3}62XjM4dXePSI400000NkvXXu0mjftcxZ` diff --git a/docs/site/images/logo.jpg b/docs/site/images/logo.jpg deleted file mode 100644 index f96c50cf5291d8d93ba80a4a52e774b77ab812ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10238 zcmd6NRZtv2x8~r%f(CbYcXtL4u7f)a1P_EjLU4DN;I6~q?l4Gj3lKDTaLvHxuUlJt zA9kPa%btEX-F3RpS6y|w`}EiSy7Kx9fUBycq69!dKmY*$6~OB{K>k0i|B?L1$^Xc~ ze+Iwy0r1`clmQP&2zUTQJOm^>gx4VeB>(|{i1Z&j;C~AmI_et?6eMKKe`Yyc00J^1 zA^-&u2?YTg{a=@VHDpu-G{75lJbVJecSOXrbQmNI{6bdrj7+?Ig2J+feji&}MMULP zw4<8F7XAbA&o=_fe@FO-h>U`YhVTacpIH&_9|Qs-G7=Ih2HJlR0EhqtBxF1kd{hEj zUNl*4LOMP*jqm9Bb#y(G`e!fR5HrXtY+n*7THAztD{2~eT?1et{hJ6L5*|Pr zaK4-At%)b1uuTy9|Fu#)$oR&PIR1l{gx(^JOFXv0RbGyYiFbH+obOljN9~4bpvzxy zNn!{df5E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xZwxO(~d`=^o@yhmm9 z&gQRK3i#SVakp!+Tq-DHedhOLfD~WwqfqW+@X_xADV1DFY4@wcV%SngLSx85cLST? z$&^3AHgTV+V+TA`RV6AIe!SW`XoqsGd4#L>7~>C`MIt$Hmi zmSNvGlsO@b{2XbOCh?s3cqX=~xwCwBq3{l@lxMoQ20Yj^3t{KEw&uK4fn}--fAzs1 zF%E#aZ9hI)WWftYA+LbLeHb`sa;p(k6?d#0k$yN2YS`#5U0WhkNx9$2DDq)hunx=f zB-}`HNwaDq;QmGz!h{@NR7p=OA3+1t6i|=OPu{dq){A!-_)F}ix}#wc>0?UhkbIgx zUE)LKxnfw8dOc3BhRlIX|L`5)Z@i|$r_t=^QHOD{uKVL*)M97DZ7IhdtOSxX;dR=# zZC9?`U^lSKDz8UUkfV-@rDt6oG4=#E`+`|*41rnx1#9&CJdwf0c0AVoXNam2ey=5Bk^uKvDjss$5o zWxYXD_&%EUq_a$%b2nbZ&5dijvjbUJS?g2z`}qF8JCu;xHt^|wY(sC?hX@dycXdg5 zi4)uJBtLdJKpnvlrc@Z7guSB;0Vr5AsAkXwj-x7x=(y4DI3+_$o}_fo9k}-0#7b)e z>j$6IO^D*;RY=L)ZKC?h95=aKlYw4pOjDz+-c1C%{?g{h*I@#H?I5bT8al^%R|=M+lsE*5BYO>ap^tKK-&^pO$`3|Hq{^%vpl7|FOP(u< zBt5}bXZLhtzaP~6B7AVB)SB~|p2??zrzq)tpo}_KPIH82_&2r2w3F1< zw!AUru%O~QIN$>%U7*UvO8{aga&9bl8-)z0zS}E3GCy@CfvIW!>mSL7|C@SU{a?%v BgQWlf diff --git a/docs/site/images/logo.png b/docs/site/images/logo.png deleted file mode 100644 index c162d6ae18e1f433c5950aebc0fdbb36dbcd35b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7343 zcmWkz2RK!47(ceixc1&VD;H5#+(<^&B|G6FGkd#)tWf4Pi;R1fS!TGhxfxm6*UDZg zBkOP;!Sj@cf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#AF}KqCR~zhW zexh)5B*K~keR&q~PCzznJncJTpZmc*y@h2M!ANn6%H0^$NhH0R{0%i%S+>^zk~TS} z`p<|-uyku5vHFvNZ4dFUUfCaUEzA4Vt-MD(r2O(bcIZp~IJX>asO=F&gEUO>xY;cI z3t#0sH-7`kzTam`nUdDeJ0T)qJ^vP@wFdN&pUkXY#CVo@q>gj$MJ6XFzXa#m#xT8e zPA~fy@vAl7*;8TfPY|CN@N)=v3CQ2zEf8f&q-p8*&6Q=98>M2G|H|&@X(d%0bh_QW zm{`TNrp#=%oHFd5e_rcW%E!JhbY3;KH0|gnqjx+g%k+@)89&!Id5<)YWGhW#tN@~b z_^B$Q=g;QYosMZnNruXnAd##iAw9MSvP_A}P-*FdyU4IOXKsbr3ppzn3vHgDs&0{b zlH{wRKgrBK7Qalsq)mqp{E^VoTx`fzi(=6=*m=2$heQdBA9aO9T&Djvsfp{5C!B`B z0=TebZWM-aY=29225Rx=7uP9|{DAk`^sGi?)xBIHA3?&d7fbl@2qu`{lUmTJ{0xZQ zlp9ESG!<1jSh=TADr#%j6iZhZV&H*6Q5IUP}<)pCCd<3Q{9j|w3Ph)Da`kQ+L? zyGw}Md~ICHrIB;_;r#rV!@4b0@q2;tJsD|f1EXZkY()y5Z#W15nXTss_|)Ux(#csg zo7NVjbE}g_K`U7P&0A{v4}FPCsxD72lrp!zK)SwxsNXaX_o!uHahuQi@=|Yfc67@Sf%>YsQ&<|cIk-# diff --git a/docs/site/images/redbutton.jpg b/docs/site/images/redbutton.jpg deleted file mode 100644 index 735f73040151f9924bd4432af7a6a45a89c7eac1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 577 zcmex=rI!if`Eg#tgYun8(AH7>mPkex%+ z$kZ{cux!f4%hw+Lzs0}u7+S&+e=;j+-PnE8d$C%!b#x;kAby}RPo>ZLu+TDLZ< z{n*~O((>~x35I(gyU!o_y>)YP^a0V1Ij71N9bhznUQz11t2z7%Y zLb~tj&S5A|D0g?6Tm9r;Lm`OOePe5F+SQ~p$7d9r(0reC_3Ny*SEYwNPOe-rnb)k} z;M9Dx7&XmMxy3xfN-fr*3~y|2F#Kn54A1H~crjG&q2$!yb;qw2?_5{*XYr=X9#iyG Qo@EAa&b;^ZtK$Eg0BT>LlmGw# diff --git a/docs/site/images/separator.jpg b/docs/site/images/separator.jpg deleted file mode 100644 index 6e6cbb8b49fc80774bd36a2d2bf7542531a51eb3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 440 zcmex=``=7@3(_k>nUfm=Y%j1}zd*XLeuH%#2Jd ztRU@zj0}uSY)s4uIYz-iCZWWM3ojOKESmK2|1Aa{W=5bhm<1W^8Fop&ETUSASr#x*}|-^F7&=HD)KzAri{pjLI~lef(a7XRh(IS)8r#VHEZ9e zT+_ZPu7@`hr*l2LJ#ouyzk@N>HcC4SZr=#yJI(WMo_XJ)9c53#=F6{t5zcp> YR^6w#S?6UHW0mKfT6lZnn)?4Y0e-+`8UO$Q diff --git a/docs/site/images/title.png b/docs/site/images/title.png deleted file mode 100644 index e257bf20673385998fcd4c0bf4b8dabf0297ca6c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3450 zcmV-=4TbWFP)2Dvf^{kgUBTKFT)KkD6R^po}t4Beiqx#8LPRD38R;5!;O~S2r}B z;GXkdemfhErNohLq>3`psdXmQ1$#uM%`MHN@gAKAJ2C^J5}z&!cKPj)CwDAPSxi1737lYMJ`8Wo-7gzKhNY9E_*;-+@7Zo7ISyq3dk@lq>MrWfXb7(Q9XlPk@d4n$ z7}ILUjD!U<*KYb3ku}XxW~nhI4QTF`<^YMLWm&LtZfOo{eQ;$oBWvb4e%QX21y%Baeo)sXY;wH?Q$pQdp9<`e#UG3*I9%g zXSF3nWGP{^8Z|`ZDxi(rQ`gpW{??V#{xVN}ZOSGhl6%U&ky|0FkC5v|L>8{y=RjG@ zX5etrzdK3x^Deq`DA0 zdWVt(lucXIKP9%<-A39?B?Vs@_u3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vyM z<~e@Nv~r1uhDMh0?MKf#)IB*)O^LxS)PEOUTA<4S=bO(2oAPp&h8+Ls(>14;_Fg~Z zpPt+X)K_MMe?FYGsCTkdDeZd9tK9vi+bY`_LTyTTmOk82j$tF&HBnF*Qv`H+tz>aR$*p48>Z`o+x zvm5l0fmi5KKs_*z4*54#Ikr+x#}m84ZyH@-Uzoa=YK{Lzd1f9;oTE$Z_8ogqmWr}# z?7b;>g72}60rnr__QK`hnm|bcA@P=+*1sD{!xj-8hz_FH4LV}1x}H>nAV@@=7`#1 zU%*pYFYijxVSS*VIpY?6#>*;M60GuteAw@hM<>JVmXoUZ?VT2p4Sp}-dZg`v_jLHg zr7`9&5xK*5Mk{m?L_6$5*M1;thy6TBUt|r(##pz{u>Oi7YAYmmd53*w-{@!hQA~|C z_%m0Qd2r`uf$im@&fD8 zE;^$f-4nCTmGXT9J4)uf+^Y<0HRTLT;(kls2B2ivXP7Zx|3xE(67TQ_J^VS==SD-6 z*m=Bt^>q~~5}7RTT(E>sf%g;rUU1)^mWf18j(6xbgHP22x$}lxMM!ABp(TD)EIf zr&S+l_Ln}M!MBYg5f$&yFVwGx6T{+0Va*7;9axk|V0%9-aW{#`1aEPyx?N9IgfiM4rq%j~gAm}(WQw1l)_BojU=ab(WC z+5zN}v43w_*PfRxVO1=#>&+pf{S!UxVU9{1nKN&;@rlR^otJoMz5&}l=D<;jBXg#5 zFRnAKQ^H2gzIXyQeJ&$KC63IQ%7`sv%+45dMfY4sA^ZeB8Dp;EI&dVSN0SvJ)DacJ z9=j7M9a3@QNF13nUL`K$vVbJ+7wV*f*Wc2~#u{;>5=Z7tkP=tn6np6@_B>LS%u1pX cN9N4`0hV#W>CdK(hyVZp07*qoM6N<$g3a)wZU6uP diff --git a/docs/site/images/user1.jpg b/docs/site/images/user1.jpg deleted file mode 100644 index 6373b77f6d8c13e00ceee6b5ba6d1f9752a061c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2184 zcmbuAXIR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#Gsxzw{8E2}$ry?!2b(4|1sqclcSgWif%_+YcwKhS zd45}CN$6gwumqG&GA^L}F#9Y1TGH;~S;VK#0fb7;!6#WqbSvi9x1BA*4DfE4gqM9= zFIN6yWrInp#$qM+4$JoJ6Q_kn7;DadzEpm2&F?1dyS*_jmXT8q71dRNulGvv2bR@?>pK^Ib*nv@B zGmRxlHnwh@?6p7&=^JO*LxK+XWDeW;c%*#U{!6t^kjQ^a0>$%-2x5Z&sPHv=`KD`6 zU{~7X<1iLsPy4R$Q>$M+oLP}bBqKk!l_VPbOrbXFi|z|rZ9!-HD+#&W5zK)KNb{tf zd8Gg@cra9uu>#Yn-!<{_9ta72C&ubQTJ=eeN>;DFFX$Ue46eWXwP`kjXmLEIkfYX0 zzerHbj#BTPjFA$uZezZ7_O`x)X^T_EkvPm>qa{7BoabPA6@<~9R6h=VF4{s1o$_&b z8q<`-i#&g*|6HgQH{67}w{53Vqb}r?4nbJXKwO2Dh+{sV9;%TkO_Lw9C5wyWknvaZ sY0>C&7|^R22@O;;77(I($mgW3&V16kzj&ShNyF*qr}zII$&J200cb3{Gynhq diff --git a/docs/site/index.html b/docs/site/index.html deleted file mode 100644 index f8f811ca8..000000000 --- a/docs/site/index.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - - Gunicorn - Python WSGI HTTP Server for UNIX - - - - - - - -

- - -
-
- -
- -
-

Installation

-

- Here's a quick rundown on how to get started with Gunicorn. For more details read the documentation. -

-
-  $ pip install gunicorn
-  $ cat myapp.py
-    def app(environ, start_response):
-        data = b"Hello, World!\n"
-        start_response("200 OK", [
-            ("Content-Type", "text/plain"),
-            ("Content-Length", str(len(data)))
-        ])
-        return iter([data])
-  $ gunicorn -w 4 myapp:app
-  [2014-09-10 10:22:28 +0000] [30869] [INFO] Listening at: http://127.0.0.1:8000 (30869)
-  [2014-09-10 10:22:28 +0000] [30869] [INFO] Using worker: sync
-  [2014-09-10 10:22:28 +0000] [30874] [INFO] Booting worker with pid: 30874
-  [2014-09-10 10:22:28 +0000] [30875] [INFO] Booting worker with pid: 30875
-  [2014-09-10 10:22:28 +0000] [30876] [INFO] Booting worker with pid: 30876
-  [2014-09-10 10:22:28 +0000] [30877] [INFO] Booting worker with pid: 30877
-
-
-
-

Deployment

-

- Gunicorn is a WSGI HTTP server. It is best to use Gunicorn behind an HTTP proxy server. We strongly advise you to use nginx. -

-

Here's an example to help you get started with using nginx:

-
-  server {
-    listen 80;
-    server_name example.org;
-    access_log  /var/log/nginx/example.log;
-
-    location / {
-        proxy_pass http://127.0.0.1:8000;
-        proxy_set_header Host $host;
-        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-    }
-  }
-
-

Nginx is set up as reverse proxy server to a Gunicorn server running on localhost port 8000.

-

Read the full documentation at docs.gunicorn.org

-
-
-

Project Management

-

Gunicorn uses GitHub for the project management. GitHub issues are used for 3 different purposes:

- -

Project maintenance guidelines are available on the wiki

- -

IRC

-

The Gunicorn channel is on the Libera Chat IRC - network. You can chat with the community on the #gunicorn channel.

- -

Issue Tracking

-

Bug reports, enhancement requests and tasks generally go in the Github - issue tracker.

- -

Security Issues

-

The security mailing list is a place to report security issues. Only - developers are subscribed to it. To post a message to the list use the - address security@gunicorn.org

- -
-
-

Documentation

-

You can read more comprehensive documentation at docs.gunicorn.org.

-

The contents are:

-
-
-
- - - - - - - - - diff --git a/docs/site/install.html b/docs/site/install.html deleted file mode 100644 index b3dfbd470..000000000 --- a/docs/site/install.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Green Unicorn - Install - - -

- Redirecting to here -

- - diff --git a/docs/site/installation.html b/docs/site/installation.html deleted file mode 100644 index b3dfbd470..000000000 --- a/docs/site/installation.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Green Unicorn - Install - - -

- Redirecting to here -

- - diff --git a/docs/site/js/main.js b/docs/site/js/main.js deleted file mode 100755 index c285c8fdd..000000000 --- a/docs/site/js/main.js +++ /dev/null @@ -1,46 +0,0 @@ -$(document).ready(function() { - Tabs.init(); -}); - -var Tabs = { - init: function(){ - var activateTab = function ($tab) { - var // this links tabs set - $tabs = $tab.parents('.tabs'), - // currently active tab - activeTab = { - 'tab' : $tabs.find('ul').children('li.active'), - 'content' : $tabs.find('div[data-tab].active') - }, - // newly clicked tab - newTab = { - 'tab' : $tab.parent('li'), - 'content' : $tabs.find('[data-tab=' + $tab.attr('href').replace('#', '') + ']') - }, - x, y; - - // remove active class from tab and content - for (x in activeTab) { - activeTab[x].removeClass('active'); - } - - // add active class to tab and content - for (y in newTab) { - newTab[y].addClass('active'); - } - }; - // hook up tab links - $(document).on('click', '.tabs ul li a', function(e) { - activateTab($(this)); - //alert($(this)); - }); - - // hook up initial load active tab - if (window.location.hash) { - var $activeTab = $('a[href="' + window.location.hash + '"]'); - if ($activeTab.length && $activeTab.parents('.tabs').length) { - activateTab($activeTab); - } - } - } -}; \ No newline at end of file diff --git a/docs/site/news.html b/docs/site/news.html deleted file mode 100644 index 318dcdf2e..000000000 --- a/docs/site/news.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Green Unicorn - News - - -

- Redirecting to here -

- - diff --git a/docs/site/run.html b/docs/site/run.html deleted file mode 100644 index 236fc3e46..000000000 --- a/docs/site/run.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Green Unicorn - Run - - -

- Redirecting to here -

- - diff --git a/docs/site/sitemap.xml b/docs/site/sitemap.xml deleted file mode 100644 index 6411a24e3..000000000 --- a/docs/site/sitemap.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - http://gunicorn.org/ - 2019-11-27T00:02:48+01:00 - 1.0 - - - http://gunicorn.org/community.html - 2012-10-04T00:43:15+05:45 - 0.5 - - - http://gunicorn.org/configuration.html - 2012-10-04T00:43:15+05:45 - 0.5 - - - http://gunicorn.org/configure.html - 2012-10-04T00:43:15+05:45 - 0.5 - - - http://gunicorn.org/deploy.html - 2012-10-04T00:43:15+05:45 - 0.5 - - - http://gunicorn.org/deployment.html - 2012-10-04T00:43:15+05:45 - 0.5 - - - http://gunicorn.org/design.html - 2012-10-04T00:43:15+05:45 - 0.5 - - - http://gunicorn.org/faq.html - 2012-10-04T00:43:15+05:45 - 0.5 - - - http://gunicorn.org/install.html - 2012-10-04T00:43:15+05:45 - 0.5 - - - http://gunicorn.org/installation.html - 2012-10-04T00:43:15+05:45 - 0.5 - - - http://gunicorn.org/news.html - 2012-10-04T00:43:15+05:45 - 0.5 - - - http://gunicorn.org/run.html - 2012-10-04T00:43:15+05:45 - 0.5 - - - http://gunicorn.org/tuning.html - 2012-10-04T00:43:15+05:45 - 0.5 - - - http://gunicorn.org/usage.html - 2012-10-04T00:43:15+05:45 - 0.5 - - diff --git a/docs/site/tuning.html b/docs/site/tuning.html deleted file mode 100644 index 5dbdc0b1b..000000000 --- a/docs/site/tuning.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Green Unicorn - FAQ - - -

- Redirecting to here -

- - diff --git a/docs/site/usage.html b/docs/site/usage.html deleted file mode 100644 index 236fc3e46..000000000 --- a/docs/site/usage.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Green Unicorn - Run - - -

- Redirecting to here -

- - diff --git a/docs/sitemap_gen.py b/docs/sitemap_gen.py deleted file mode 100644 index 29c7ca028..000000000 --- a/docs/sitemap_gen.py +++ /dev/null @@ -1,41 +0,0 @@ -import os -import subprocess -from xml.etree import ElementTree - - -def main(): - generate( - site_path=os.path.join(os.path.dirname(__file__), 'site'), - special_priorities={'index.html': 1.0}) - - -def generate(site_path, special_priorities, directory_index='index.html'): - urlset = ElementTree.Element('urlset', xmlns='http://www.sitemaps.org/schemas/sitemap/0.9') - urlset.text = '\n ' - for root, dirs, filenames in os.walk(site_path): - for filename in filenames: - if filename.endswith('.html'): - absolute_filepath = os.path.join(root, filename) - relative_path = os.path.relpath(absolute_filepath, site_path) - relative_url = os.path.dirname(relative_path) if filename == directory_index else relative_path - last_modification = subprocess.check_output( - ['git', 'log', '-1', '--pretty="%cI"', absolute_filepath]).decode('ascii').strip('\n"') - url_element = ElementTree.SubElement(urlset, 'url') - loc_element = ElementTree.SubElement(url_element, 'loc') - loc_element.text = 'http://gunicorn.org/' + relative_url - lastmod_element = ElementTree.SubElement(url_element, 'lastmod') - lastmod_element.text = last_modification - priority_element = ElementTree.SubElement(url_element, 'priority') - priority_element.text = str(special_priorities.get(relative_path, 0.5)) - url_element.tail = priority_element.tail = '\n ' - url_element.text = loc_element.tail = lastmod_element.tail = '\n ' - # We sort the url nodes instead of the filenames because - # filenames might be altered by the directory_index option - urlset[:] = sorted([url for url in urlset], key=lambda url: url[0].text) - urlset.tail = urlset[-1].tail = '\n' - with open(os.path.join(site_path, 'sitemap.xml'), 'wb') as sitemap_file: - ElementTree.ElementTree(urlset).write(sitemap_file, encoding='UTF-8', xml_declaration=True) - - -if __name__ == '__main__': - main() diff --git a/docs/source/2010-news.rst b/docs/source/2010-news.rst deleted file mode 100644 index e58c48198..000000000 --- a/docs/source/2010-news.rst +++ /dev/null @@ -1,211 +0,0 @@ -Changelog - 2010 -================ - -0.12.0 / 2010-12-22 -------------------- - -- Add support for logging configuration using a ini file. - It uses the standard Python logging's module Configuration - file format and allows anyone to use his custom file handler -- Add IPV6 support -- Add multidomain application example -- Improve gunicorn_django command when importing settings module - using DJANGO_SETTINGS_MODULE environment variable -- Send appropriate error status on http parsing -- Fix pidfile, set permissions so other user can read - it and use it. -- Fix temporary file leaking -- Fix setpgrp issue, can now be launched via ubuntu upstart -- Set the number of workers to zero on WINCH - -0.11.2 / 2010-10-30 -------------------- - -* Add SERVER_SOFTWARE to the os.environ -* Add support for django settings environment variable -* Add support for logging configuration in Paster ini-files -* Improve arbiter notification in asynchronous workers -* Display the right error when a worker can't be used -* Fix Django support -* Fix HUP with Paster applications -* Fix readline in wsgi.input - -0.11.1 / 2010-09-02 -------------------- - -* Implement max-requests feature to prevent memory leaks. -* Added 'worker_exit' server hook. -* Reseed the random number generator after fork(). -* Improve Eventlet worker. -* Fix Django command `run_gunicorn`. -* Fix the default proc name internal setting. -* Workaround to prevent Gevent worker to segfault on MacOSX. - -0.11.0 / 2010-08-12 -------------------- - -* Improve dramatically performances of Gevent and Eventlet workers -* Optimize HTTP parsing -* Drop Server and Date headers in start_response when provided. -* Fix latency issue in async workers - -0.10.1 / 2010-08-06 -------------------- - -* Improve gevent's workers. Add "egg:gunicorn#gevent_wsgi" worker using - `gevent.wsgi `_ and - "egg:gunicorn#gevent_pywsgi" worker using `gevent.pywsgi - `_ . - **"egg:gunicorn#gevent"** using our own HTTP parser is still here and - is **recommended** for normal uses. Use the "gevent.wsgi" parser if you - need really fast connections and don't need streaming, keepalive or ssl. -* Add pre/post request hooks -* Exit more quietly -* Fix gevent dns issue - -0.10.0 / 2010-07-08 -------------------- - -* New HTTP parser. -* New HUP behaviour. Re-reads the configuration and then reloads all - worker processes without changing the master process id. Helpful for - code reloading and monitoring applications like supervisord and runit. -* Added a preload configuration parameter. By default, application code - is now loaded after a worker forks. This couple with the new HUP - handling can be used for dev servers to do hot code reloading. Using - the preload flag can help a bit in small memory VM's. -* Allow people to pass command line arguments to WSGI applications. See: - `examples/alt_spec.py - `_ -* Added an example gevent reloader configuration: - `examples/example_gevent_reloader.py - `_. -* New gevent worker "egg:gunicorn#gevent2", working with gevent.wsgi. -* Internal refactoring and various bug fixes. -* New documentation website. - -0.9.1 / 2010-05-26 ------------------- - -* Support https via X-Forwarded-Protocol or X-Forwarded-Ssl headers -* Fix configuration -* Remove -d options which was used instead of -D for daemon. -* Fix umask in unix socket - -0.9.0 / 2010-05-24 ------------------- - -* Added *when_ready* hook. Called just after the server is started -* Added *preload* setting. Load application code before the worker processes - are forked. -* Refactored Config -* Fix pidfile -* Fix QUIT/HUP in async workers -* Fix reexec -* Documentation improvements - -0.8.1 / 2010-04-29 ------------------- - -* Fix builtins import in config -* Fix installation with pip -* Fix Tornado WSGI support -* Delay application loading until after processing all configuration - -0.8.0 / 2010-04-22 ------------------- - -* Refactored Worker management for better async support. Now use the -k option - to set the type of request processing to use -* Added support for Tornado_ - -0.7.2 / 2010-04-15 ------------------- - -* Added --spew option to help debugging (installs a system trace hook) -* Some fixes in async arbiters -* Fix a bug in start_response on error - -0.7.1 / 2010-04-01 ------------------- - -* Fix bug when responses have no body. - -0.7.0 / 2010-03-26 ------------------- - -* Added support for Eventlet_ and Gevent_ based workers. -* Added Websockets_ support -* Fix Chunked Encoding -* Fix SIGWINCH on OpenBSD_ -* Fix `PEP 333`_ compliance for the write callable. - -0.6.5 / 2010-03-11 ------------------- - -* Fix pidfile handling -* Fix Exception Error - -0.6.4 / 2010-03-08 ------------------- - -* Use cStringIO for performance when possible. -* Fix worker freeze when a remote connection closes unexpectedly. - -0.6.3 / 2010-03-07 ------------------- - -* Make HTTP parsing faster. -* Various bug fixes - -0.6.2 / 2010-03-01 ------------------- - -* Added support for chunked response. -* Added proc_name option to the config file. -* Improved the HTTP parser. It now uses buffers instead of strings to store - temporary data. -* Improved performance when sending responses. -* Workers are now murdered by age (the oldest is killed first). - -0.6.1 / 2010-02-24 ------------------- - -* Added gunicorn config file support for Django admin command -* Fix gunicorn config file. -c was broken. -* Removed TTIN/TTOU from workers which blocked other signals. - -0.6.0 / 2010-02-22 ------------------- - -* Added setproctitle support -* Change privilege switch behavior. We now work like NGINX, master keeps the - permissions, new uid/gid permissions are only set for workers. - -0.5.1 / 2010-02-22 ------------------- - -* Fix umask -* Added Debian packaging - -0.5.0 / 2010-02-20 ------------------- - -* Added `configuration file `_ handler. -* Added support for pre/post fork hooks -* Added support for before_exec hook -* Added support for unix sockets -* Added launch of workers processes under different user/group -* Added umask option -* Added SCRIPT_NAME support -* Better support of some exotic settings for Django projects -* Better support of Paste-compatible applications -* Some refactoring to make the code easier to hack -* Allow multiple keys in request and response headers - -.. _Tornado: http://www.tornadoweb.org/ -.. _`PEP 333`: https://www.python.org/dev/peps/pep-0333/ -.. _Eventlet: http://eventlet.net/ -.. _Gevent: http://www.gevent.org/ -.. _OpenBSD: https://www.openbsd.org/ -.. _Websockets: https://html.spec.whatwg.org/multipage/web-sockets.html diff --git a/docs/source/2011-news.rst b/docs/source/2011-news.rst deleted file mode 100644 index 3bc2a1a2d..000000000 --- a/docs/source/2011-news.rst +++ /dev/null @@ -1,73 +0,0 @@ -Changelog - 2011 -================ - -0.13.4 / 2011-09-23 -------------------- - -- fix util.closerange function used to prevent leaking fds on python 2.5 - (typo) - -0.13.3 / 2011-09-19 -------------------- -- refactor gevent worker -- prevent leaking fds on reexec -- fix inverted request_time computation - -0.13.2 / 2011-09-17 -------------------- - -- Add support for Tornado 2.0 in tornado worker -- Improve access logs: allows customisation of the log format & add - request time -- Logger module is now pluggable -- Improve graceful shutdown in Python versions >= 2.6 -- Fix post_request root arity for compatibility -- Fix sendfile support -- Fix Django reloading - -0.13.1 / 2011-08-22 -------------------- - -- Fix unix socket. log argument was missing. - -0.13.0 / 2011-08-22 -------------------- - -- Improve logging: allows file-reopening and add access log file - compatible with the `apache combined log format `_ -- Add the possibility to set custom SSL headers. X-Forwarded-Protocol - and X-Forwarded-SSL are still the default -- New `on_reload` hook to customize how gunicorn spawn new workers on - SIGHUP -- Handle projects with relative path in django_gunicorn command -- Preserve path parameters in PATH_INFO -- post_request hook now accepts the environ as argument. -- When stopping the arbiter, close the listener asap. -- Fix Django command `run_gunicorn` in settings reloading -- Fix Tornado_ worker exiting -- Fix the use of sendfile in wsgi.file_wrapper - - -0.12.2 / 2011-05-18 -------------------- - -- Add wsgi.file_wrapper optimised for FreeBSD, Linux & MacOSX (use - sendfile if available) -- Fix django run_gunicorn command. Make sure we reload the application - code. -- Fix django localisation -- Compatible with gevent 0.14dev - -0.12.1 / 2011-03-23 -------------------- - -- Add "on_starting" hook. This hook can be used to set anything before - the arbiter really start -- Support bdist_rpm in setup -- Improve content-length handling (pep 3333) -- Improve Django support -- Fix daemonizing (#142) -- Fix ipv6 handling - - -.. _Tornado: http://www.tornadoweb.org/ diff --git a/docs/source/2012-news.rst b/docs/source/2012-news.rst deleted file mode 100644 index ce4f7cc4d..000000000 --- a/docs/source/2012-news.rst +++ /dev/null @@ -1,128 +0,0 @@ -Changelog - 2012 -================ - -0.17.0 / 2012-12-25 -------------------- - -- allows gunicorn to bind to multiple address -- add SSL support -- add syslog support -- add nworkers_changed hook -- add response arg for post_request hook -- parse command line with argparse (replace deprecated optparse) -- fix PWD detection in arbiter -- miscellaneous PEP8 fixes - -0.16.1 / 2012-11-19 -------------------- - -- Fix packaging - -0.16.0 / 2012-11-19 -------------------- - -- **Added support for Python 3.2 & 3.3** -- Expose --pythonpath command to all gunicorn commands -- Honor $PORT environment variable, useful for deployment on heroku -- Removed support for Python 2.5 -- Make sure we reopen the logs on the console -- Fix django settings module detection from path -- Reverted timeout for client socket. Fix issue on blocking issues. -- Fixed gevent worker - -0.15.0 / 2012-10-18 -------------------- - -- new documentation site on http://docs.gunicorn.org -- new website on http://gunicorn.org -- add `haproxy PROXY protocol `_ support -- add ForwardedAllowIPS option: allows to filter Front-end's IPs - allowed to handle X-Forwarded-* headers. -- add callable hooks for paster config -- add x-forwarded-proto as secure scheme default (Heroku is using this) -- allows gunicorn to load a pre-compiled application -- support file reopening & reexec for all loggers -- initialize the logging config file with defaults. -- set timeout for client socket (slow client DoS). -- NoMoreData, ChunkMissingTerminator, InvalidChunkSize are now - IOError exceptions -- fix graceful shutdown in gevent -- fix limit request line check - -0.14.6 / 2012-07-26 -------------------- - - -- fix gevent & subproces -- fix request line length check -- fix keepalive = 0 -- fix tornado worker - -0.14.5 / 2012-06-24 --------------------- - -- fix logging during daemonisation - -0.14.4 / 2012-06-24 -------------------- - -- new --graceful-timeout option -- fix multiple issues with request limit -- more fixes in django settings resolutions -- fix gevent.core import -- fix keepalive=0 in eventlet worker -- fix handle_error display with the unix worker -- fix tornado.wsgi.WSGIApplication calling error - -- **breaking change**: take the control on graceful reload back. - graceful can't be overridden anymore using the on_reload function. - -0.14.3 / 2012-05-15 -------------------- - -- improvement: performance of http.body.Body.readline() -- improvement: log HTTP errors in access log like Apache -- improvement: display traceback when the worker fails to boot -- improvement: makes gunicorn work with gevent 1.0 -- examples: websocket example now supports hybi13 -- fix: reopen log files after initialization -- fix: websockets support -- fix: django1.4 support -- fix: only load the paster application 1 time - -0.14.2 / 2012-03-16 -------------------- - -- add validate_class validator: allows to use a class or a method to - initialize the app during in-code configuration -- add support for max_requests in tornado worker -- add support for disabling x_forwarded_for_header in tornado worker -- gevent_wsgi is now an alias of gevent_pywsgi -- Fix gevent_pywsgi worker - -0.14.1 / 2012-03-02 -------------------- - -- fixing source archive, reducing its size - -0.14.0 / 2012-02-27 -------------------- - -- check if Request line is too large: You can now pass the parameter - ``--limit-request-line`` or set the ``limit_request_line`` in your - configuration file to set the max size of the request line in bytes. -- limit the number of headers fields and their size. Add - ``--limit-request-field`` and ``limit-request-field-size`` settings -- add ``p`` variable to the log access format to log pidfile -- add ``{HeaderName}o`` variable to the logo access format to log the - response header HeaderName -- request header is now logged with the variable ``{HeaderName}i`` in the - access log file -- improve error logging -- support logging.configFile -- support django 1.4 in both gunicorn_django & run_gunicorn command -- improve reload in django run_gunicorn command (should just work now) -- allows people to set the ``X-Forwarded-For`` header key and disable it by - setting an empty string. -- fix support of Tornado -- many other fixes. diff --git a/docs/source/2013-news.rst b/docs/source/2013-news.rst deleted file mode 100644 index eb8cf556a..000000000 --- a/docs/source/2013-news.rst +++ /dev/null @@ -1,90 +0,0 @@ -Changelog - 2013 -================ - -18.0 / 2013-08-26 ------------------ - -- new: add ``-e/--env`` command line argument to pass an environment variables to - gunicorn -- new: add ``--chdir`` command line argument to specified directory - before apps loading. - new: add wsgi.file_wrapper support in async workers -- new: add ``--paste`` command line argument to set the paster config file -- deprecated: the command ``gunicorn_django`` is now deprecated. You should now - run your application with the WSGI interface installed with your project (see - https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/gunicorn/) for - more infos. -- deprecated: the command ``gunicorn_paste`` is deprecated. You now should use - the new ``--paste`` argument to set the configuration file of your paster - application. -- fix: Removes unmatched leading quote from the beginning of the default access - log format string -- fix: null timeout -- fix: gevent worker -- fix: don't reload the paster app when using pserve -- fix: after closing for error do not keep alive the connection -- fix: responses 1xx, 204 and 304 should not force the connection to be closed - -17.5 / 2013-07-03 ------------------- - -- new: add signals documentation -- new: add post_worker_init hook for workers -- new: try to use gunicorn.conf.py in current folder as the default - config file. -- fix graceful timeout with the Eventlet worker -- fix: don't raise an error when closing the socket if already closed -- fix: fix --settings parameter for django application and try to find - the django settings when using the ``gunicorn`` command. -- fix: give the initial global_conf to paster application -- fix: fix 'Expect: 100-continue' support on Python 3 - -New versioning: -++++++++++++++++ - -With this release, the versioning of Gunicorn is changing. Gunicorn is -stable since a long time and there is no point to release a "1.0" now. -It should have been done since a long time. 0.17 really meant it was the -17th stable version. From the beginning we have only 2 kind of -releases: - -major release: releases with major changes or huge features added -services releases: fixes and minor features added So from now we will -apply the following versioning ``.``. For example ``17.5`` is a -service release. - -0.17.4 / 2013-04-24 -------------------- - -- fix unix socket address parsing - -0.17.3 / 2013-04-23 -------------------- - -- add systemd sockets support -- add ``python -m gunicorn.app.wsgiapp`` support -- improve logger class inheritance -- exit when the config file isn't found -- add the -R option to enable stdio inheritance in daemon mode -- don't close file descriptors > 3 in daemon mode -- improve STDOUT/STDERR logging -- fix pythonpath option -- fix pidfile creation on Python 3 -- fix gevent worker exit -- fix ipv6 detection when the platform isn't supporting it - -0.17.2 / 2013-01-07 -------------------- - -- optimize readline -- make imports errors more visible when loading an app or a logging - class -- fix tornado worker: don't pass ssl options if there are none -- fix PEP3333: accept only bytetrings in the response body -- fix support on CYGWIN platforms - -0.17.1 / 2013-01-05 -------------------- - -- add syslog facility name setting -- fix ``--version`` command line argument -- fix wsgi url_scheme for https diff --git a/docs/source/2014-news.rst b/docs/source/2014-news.rst deleted file mode 100644 index 3eec18fcd..000000000 --- a/docs/source/2014-news.rst +++ /dev/null @@ -1,228 +0,0 @@ -================ -Changelog - 2014 -================ - -.. note:: - - Please see :doc:`news` for the latest changes. - -19.1.1 / 2014-08-16 -=================== - -Changes -------- - -Core -++++ - -- fix :issue:`835`: display correct pid of already running instance -- fix :pr:`833`: fix `PyTest` class in setup.py. - - -Logging -+++++++ - -- fix :issue:`838`: statsd logger, send statsd timing metrics in milliseconds -- fix :issue:`839`: statsd logger, allows for empty log message while pushing - metrics and restore worker number in DEBUG logs -- fix :issue:`850`: add timezone to logging -- fix :issue:`853`: Respect logger_class setting unless statsd is on - -AioHttp worker -++++++++++++++ - -- fix :issue:`830` make sure gaiohttp worker is shipped with gunicorn. - -19.1 / 2014-07-26 -================= - -Changes -------- - -Core -++++ - -- fix :issue:`785`: handle binary type address given to a client socket address -- fix graceful shutdown. make sure QUIT and TERMS signals are switched everywhere. -- :issue:`799`: fix support loading config from module -- :issue:`805`: fix check for file-like objects -- fix :issue:`815`: args validation in WSGIApplication.init -- fix :issue:`787`: check if we load a pyc file or not. - - -Tornado worker -++++++++++++++ - -- fix :issue:`771`: support tornado 4.0 -- fix :issue:`783`: x_headers error. The x-forwarded-headers option has been removed - in `c4873681299212d6082cd9902740eef18c2f14f1 - `_. - The discussion is available on :pr:`633`. - - -AioHttp worker -++++++++++++++ - -- fix: fetch all body in input. fix :issue:`803` -- fix: don't install the worker if python < 3.3 -- fix :issue:`822`: Support UNIX sockets in gaiohttp worker - - -Async worker -++++++++++++ - -- fix :issue:`790`: StopIteration shouldn't be caught at this level. - - -Logging -+++++++ - -- add statsd logging handler fix :issue:`748` - - -Paster -++++++ - -- fix :issue:`809`: Set global logging configuration from a Paste config. - - -Extra -+++++ - -- fix RuntimeError in gunicorn.reloader (:issue:`807`) - - -Documentation -+++++++++++++ - -- update faq: put a note on how `watch logs in the console - `_ - since many people asked for it. - - -19.0 / 2014-06-12 -================= - -Gunicorn 19.0 is a major release with new features and fixes. This -version improve a lot the usage of Gunicorn with python 3 by adding `two -new workers `_ -to it: `gthread` a fully threaded async worker using futures and `gaiohttp` a -worker using asyncio. - - -Breaking Changes ----------------- - -Switch QUIT and TERM signals -++++++++++++++++++++++++++++ - -With this change, when gunicorn receives a QUIT all the workers are -killed immediately and exit and TERM is used for the graceful shutdown. - -Note: the old behaviour was based on the NGINX but the new one is more -correct according the following doc: - -https://www.gnu.org/software/libc/manual/html_node/Termination-Signals.html - -also it is complying with the way the signals are sent by heroku: - -https://devcenter.heroku.com/articles/python-faq#what-constraints-exist-when-developing-applications-on-heroku - -Deprecations -++++++++++++ - -`run_gunicorn`, `gunicorn_django` and `gunicorn_paster` are now -completely deprecated and will be removed in the next release. Use the -`gunicorn` command instead. - - -Changes -------- - -core -++++ - -- add aiohttp worker named `gaiohttp` using asyncio. Full async worker - on python 3. -- fix HTTP-violating excess whitespace in write_error output -- fix: try to log what happened in the worker after a timeout, add a - `worker_abort` hook on SIGABRT signal. -- fix: save listener socket name in workers so we can handle buffered - keep-alive requests after the listener has closed. -- add on_exit hook called just before exiting gunicorn. -- add support for python 3.4 -- fix: do not swallow unexpected errors when reaping -- fix: remove incompatible SSL option with python 2.6 -- add new async gthread worker and `--threads` options allows to set multiple - threads to listen on connection -- deprecate `gunicorn_django` and `gunicorn_paster` -- switch QUIT and TERM signal -- reap workers in SIGCHLD handler -- add universal wheel support -- use `email.utils.formatdate` in gunicorn.util.http_date -- deprecate the `--debug` option -- fix: log exceptions that occur after response start … -- allows loading of applications from `.pyc` files (#693) -- fix: issue #691, raw_env config file parsing -- use a dynamic timeout to wait for the optimal time. (Reduce power - usage) -- fix python3 support when notifying the arbiter -- add: honor $WEB_CONCURRENCY environment variable. Useful for heroku - setups. -- add: include tz offset in access log -- add: include access logs in the syslog handler. -- add --reload option for code reloading -- add the capability to load `gunicorn.base.Application` without the loading of - the arguments of the command line. It allows you to :ref:`embed gunicorn in - your own application `. -- improve: set wsgi.multithread to True for async workers -- fix logging: make sure to redirect wsgi.errors when needed -- add: syslog logging can now be done to a unix socket -- fix logging: don't try to redirect stdout/stderr to the logfile. -- fix logging: don't propagate log -- improve logging: file option can be overridden by the gunicorn options - `--error-logfile` and `--access-logfile` if they are given. -- fix: don't override SERVER_* by the Host header -- fix: handle_error -- add more option to configure SSL -- fix: sendfile with SSL -- add: worker_int callback (to react on SIGTERM) -- fix: don't depend on entry point for internal classes, now absolute - modules path can be given. -- fix: Error messages are now encoded in latin1 -- fix: request line length check -- improvement: proxy_allow_ips: Allow proxy protocol if "*" specified -- fix: run worker's `setup` method before setting num_workers -- fix: FileWrapper inherit from `object` now -- fix: Error messages are now encoded in latin1 -- fix: don't spam the console on SIGWINCH. -- fix: logging -don't stringify T and D logging atoms (#621) -- add support for the latest django version -- deprecate `run_gunicorn` django option -- fix: sys imported twice - - -gevent worker -+++++++++++++ - -- fix: make sure to stop all listeners -- fix: monkey patching is now done in the worker -- fix: "global name 'hub' is not defined" -- fix: reinit `hub` on old versions of gevent -- support gevent 1.0 -- fix: add subprocess in monkey patching -- fix: add support for multiple listener - - -eventlet worker -+++++++++++++++ - -- fix: merge duplicate EventletWorker.init_process method (fixes #657) -- fix: missing errno import for eventlet sendfile patch -- fix: add support for multiple listener - - -tornado worker -++++++++++++++ - -- add graceful stop support diff --git a/docs/source/2015-news.rst b/docs/source/2015-news.rst deleted file mode 100644 index 61ea225b4..000000000 --- a/docs/source/2015-news.rst +++ /dev/null @@ -1,219 +0,0 @@ -================ -Changelog - 2015 -================ - -.. note:: - - Please see :doc:`news` for the latest changes. - -19.4.3 / 2015/12/30 -=================== - -- fix: don't check if a file is writable using os.stat with SELINUX (:issue:`1171`) - -19.4.2 / 2015/12/29 -=================== - -Core -++++ - -- improvement: handle HaltServer in manage_workers (:issue:`1095`) -- fix: Do not rely on sendfile sending requested count (:issue:`1155`) -- fix: claridy --no-sendfile default (:issue:`1156`) -- fix: LoggingCatch sendfile failure from no file descriptor (:issue:`1160`) - -Logging -+++++++ - -- fix: Always send access log to syslog if syslog is on -- fix: check auth before trying to own a file (:issue:`1157`) - - -Documentation -+++++++++++++ - -- fix: Fix Slowloris broken link. (:issue:`1142`) -- Tweak markup in faq.rst - -Testing -+++++++ - -- fix: gaiohttp test (:issue:`1164`) - -19.4.1 / 2015/11/25 -=================== - -- fix tornado worker (:issue:`1154`) - -19.4.0 / 2015/11/20 -=================== - -Core -++++ - -- fix: make sure that a user is able to access to the logs after dropping a - privilege (:issue:`1116`) -- improvement: inherit the `Exception` class where it needs to be (:issue:`997`) -- fix: make sure headers are always encoded as latin1 RFC 2616 (:issue:`1102`) -- improvement: reduce arbiter noise (:issue:`1078`) -- fix: don't close the unix socket when the worker exit (:issue:`1088`) -- improvement: Make last logged worker count an explicit instance var (:issue:`1078`) -- improvement: prefix config file with its type (:issue:`836`) -- improvement: pidfile handing (:issue:`1042`) -- fix: catch OSError as well as ValueError on race condition (:issue:`1052`) -- improve support of ipv6 by backporting urlparse.urlsplit from Python 2.7 to - Python 2.6. -- fix: raise InvalidRequestLine when the line contains malicious data - (:issue:`1023`) -- fix: fix argument to disable sendfile -- fix: add gthread to the list of supported workers (:issue:`1011`) -- improvement: retry socket binding up to five times upon EADDRNOTAVAIL - (:issue:`1004`) -- **breaking change**: only honor headers that can be encoded in ascii to comply to - the RFC 7230 (See :issue:`1151`). - -Logging -+++++++ - -- add new parameters to access log (:issue:`1132`) -- fix: make sure that files handles are correctly reopened on HUP - (:issue:`627`) -- include request URL in error message (:issue:`1071`) -- get username in access logs (:issue:`1069`) -- fix statsd logging support on Python 3 (:issue:`1010`) - -Testing -+++++++ - -- use last version of mock. -- many fixes in Travis CI support -- miscellaneous improvements in tests - -Thread worker -+++++++++++++ - -- fix: Fix self.nr usage in ThreadedWorker so that auto restart works as - expected (:issue:`1031`) - -Gevent worker -+++++++++++++ - -- fix quit signal handling (:issue:`1128`) -- add support for Python 3 (:issue:`1066`) -- fix: make graceful shutdown thread-safe (:issue:`1032`) - -Tornado worker -++++++++++++++ - -- fix ssl options (:issue:`1146`, :issue:`1135`) -- don't check timeout when stopping gracefully (:issue:`1106`) - -AIOHttp worker -++++++++++++++ - -- add SSL support (:issue:`1105`) - -Documentation -+++++++++++++ - -- fix link to proc name setting (:issue:`1144`) -- fix worker class documentation (:issue:`1141`, :issue:`1104`) -- clarify graceful timeout documentation (:issue:`1137`) -- don't duplicate NGINX config files examples (:issue:`1050`, :issue:`1048`) -- add `web.py` framework example (:issue:`1117`) -- update Debian/Ubuntu installations instructions (:issue:`1112`) -- clarify `pythonpath` setting description (:issue:`1080`) -- tweak some example for python3 -- clarify `sendfile` documentation -- miscellaneous typos in source code comments (thanks!) -- clarify why REMOTE_ADD may not be the user's IP address (:issue:`1037`) - - -Misc -++++ - -- fix: reloader should survive SyntaxError (:issue:`994`) -- fix: expose the reloader class to the worker. - - - -19.3.0 / 2015/03/06 -=================== - -Core -++++ - -- fix: :issue:`978` make sure a listener is inheritable -- add `check_config` class method to workers -- fix: :issue:`983` fix select timeout in sync worker with multiple - connections -- allows workers to access to the reloader. close :issue:`984` -- raise TypeError instead of AssertionError - -Logging -+++++++ - -- make Logger.loglevel a class attribute - -Documentation -+++++++++++++ - -- fix: :issue:`988` fix syntax errors in examples/gunicorn_rc - - -19.2.1 / 2015/02/4 -================== - -Logging -+++++++ - -- expose loglevel in the Logger class - -AsyncIO worker (gaiohttp) -+++++++++++++++++++++++++ - -- fix :issue:`977` fix initial crash - -Documentation -+++++++++++++ - -- document security mailing-list in the contributing page. - -19.2 / 2015/01/30 -================= - -Core -++++ - -- optimize the sync workers when listening on a single interface -- add `--sendfile` settings to enable/disable sendfile. fix :issue:`856` . -- add the selectors module to the code base. :issue:`886` -- add `--max-requests-jitter` setting to set the maximum jitter to add to the - max-requests setting. -- fix :issue:`899` propagate proxy_protocol_info to keep-alive requests -- fix :issue:`863` worker timeout: dynamic timeout has been removed -- fix: Avoid world writable file - -Logging -+++++++ - -- fix :issue:`941` set logconfig default to paster more trivially -- add statsd-prefix config setting: set the prefix to use when emitting statsd - metrics -- :issue:`832` log to console by default - -Thread Worker -+++++++++++++ - -- fix :issue:`908` make sure the worker can continue to accept requests - -Eventlet Worker -+++++++++++++++ - -- fix :issue:`867` Fix eventlet shutdown to actively shut down the workers. - -Documentation -+++++++++++++ - -Many improvements and fixes have been done, see the detailed changelog for -more information. diff --git a/docs/source/2016-news.rst b/docs/source/2016-news.rst deleted file mode 100644 index b7a4e66b8..000000000 --- a/docs/source/2016-news.rst +++ /dev/null @@ -1,91 +0,0 @@ -================ -Changelog - 2016 -================ - -.. note:: - - Please see :doc:`news` for the latest changes - -19.6.0 / 2016/05/21 -=================== - -Core & Logging -++++++++++++++ - -- improvement of the binary upgrade behaviour using USR2: remove file locking (:issue:`1270`) -- add the ``--capture-output`` setting to capture stdout/stderr tot the log - file (:issue:`1271`) -- Allow disabling ``sendfile()`` via the ``SENDFILE`` environment variable - (:issue:`1252`) -- fix reload under pycharm (:issue:`1129`) - -Workers -+++++++ - -- fix: make sure to remove the signal from the worker pipe (:issue:`1269`) -- fix: **gthread** worker, handle removed socket in the select loop - (:issue:`1258`) - -19.5.0 / 2016/05/10 -=================== - -Core -++++ - -- fix: Ensure response to HEAD request won't have message body -- fix: lock domain socket and remove on last arbiter exit (:issue:`1220`) -- improvement: use EnvironmentError instead of socket.error (:issue:`939`) -- add: new ``FORWARDED_ALLOW_IPS`` environment variable (:issue:`1205`) -- fix: infinite recursion when destroying sockets (:issue:`1219`) -- fix: close sockets on shutdown (:issue:`922`) -- fix: clean up sys.exc_info calls to drop circular refs (:issue:`1228`) -- fix: do post_worker_init after load_wsgi (:issue:`1248`) - -Workers -+++++++ - -- fix access logging in gaiohttp worker (:issue:`1193`) -- eventlet: handle QUIT in a new coroutine (:issue:`1217`) -- gevent: remove obsolete exception clauses in run (:issue:`1218`) -- tornado: fix extra "Server" response header (:issue:`1246`) -- fix: unblock the wait loop under python 3.5 in sync worker (:issue:`1256`) - -Logging -+++++++ - -- fix: log message for listener reloading (:issue:`1181`) -- Let logging module handle traceback printing (:issue:`1201`) -- improvement: Allow configuring logger_class with statsd_host (:issue:`1188`) -- fix: traceback formatting (:issue:`1235`) -- fix: print error logs on stderr and access logs on stdout (:issue:`1184`) - - -Documentation -+++++++++++++ - -- Simplify installation instructions in gunicorn.org (:issue:`1072`) -- Fix URL and default worker type in example_config (:issue:`1209`) -- update django doc url to 1.8 lts (:issue:`1213`) -- fix: miscellaneous wording corrections (:issue:`1216`) -- Add PSF License Agreement of selectors.py to NOTICE (:issue: `1226`) -- document LOGGING overriding (:issue:`1051`) -- put a note that error logs are only errors from Gunicorn (:issue:`1124`) -- add a note about the requirements of the threads workers under python 2.x (:issue:`1200`) -- add access_log_format to config example (:issue:`1251`) - -Tests -+++++ - -- Use more pytest.raises() in test_http.py - - -19.4.5 / 2016/01/05 -=================== - -- fix: NameError fileno in gunicorn.http.wsgi (:issue:`1178`) - -19.4.4 / 2016/01/04 -=================== - -- fix: check if a fileobject can be used with sendfile(2) (:issue:`1174`) -- doc: be more descriptive in errorlog option (:issue:`1173`) diff --git a/docs/source/2017-news.rst b/docs/source/2017-news.rst deleted file mode 100644 index 0fb201e61..000000000 --- a/docs/source/2017-news.rst +++ /dev/null @@ -1,46 +0,0 @@ -================ -Changelog - 2017 -================ - -.. note:: - - Please see :doc:`news` for the latest changes - -19.7.1 / 2017/03/21 -=================== - -- fix: continue if SO_REUSEPORT seems to be available but fails (:issue:`1480`) -- fix: support non-decimal values for the umask command line option (:issue:`1325`) - -19.7.0 / 2017/03/01 -=================== - -- The previously deprecated ``gunicorn_django`` command has been removed. - Use the :ref:`gunicorn-cmd` command-line interface instead. -- The previously deprecated ``django_settings`` setting has been removed. - Use the :ref:`raw-env` setting instead. -- The default value of :ref:`ssl-version` has been changed from - ``ssl.PROTOCOL_TLSv1`` to ``ssl.PROTOCOL_SSLv23``. -- fix: initialize the group access list when initgroups is set (:issue:`1297`) -- add environment variables to gunicorn access log format (:issue:`1291`) -- add --paste-global-conf option (:issue:`1304`) -- fix: print access logs to STDOUT (:issue:`1184`) -- remove upper limit on max header size config (:issue:`1313`) -- fix: print original exception on AppImportError (:issue:`1334`) -- use SO_REUSEPORT if available (:issue:`1344`) -- `fix leak `_ of duplicate file descriptor for bound sockets. -- add --reload-engine option, support inotify and other backends (:issue:`1368`, :issue:`1459`) -- fix: reject request with invalid HTTP versions -- add ``child_exit`` callback (:issue:`1394`) -- add support for eventlets _AlreadyHandled object (:issue:`1406`) -- format boot tracebacks properly with reloader (:issue:`1408`) -- refactor socket activation and fd inheritance for better support of SystemD (:issue:`1310`) -- fix: o fds are given by default in gunicorn (:issue:`1423`) -- add ability to pass settings to GUNICORN_CMD_ARGS environment variable which helps in container world (:issue:`1385`) -- fix: catch access denied to pid file (:issue:`1091`) -- many additions and improvements to the documentation - -Breaking Change -+++++++++++++++ - -- **Python 2.6.0** is the last supported version diff --git a/docs/source/2018-news.rst b/docs/source/2018-news.rst deleted file mode 100644 index 3b412cf5d..000000000 --- a/docs/source/2018-news.rst +++ /dev/null @@ -1,68 +0,0 @@ -================ -Changelog - 2018 -================ - -.. note:: - - Please see :doc:`news` for the latest changes - -19.9.0 / 2018/07/03 -=================== - -- fix: address a regression that prevented syslog support from working - (:issue:`1668`, :pr:`1773`) -- fix: correctly set `REMOTE_ADDR` on versions of Python 3 affected by - `Python Issue 30205 `_ - (:issue:`1755`, :pr:`1796`) -- fix: show zero response length correctly in access log (:pr:`1787`) -- fix: prevent raising :exc:`AttributeError` when ``--reload`` is not passed - in case of a :exc:`SyntaxError` raised from the WSGI application. - (:issue:`1805`, :pr:`1806`) -- The internal module ``gunicorn.workers.async`` was renamed to ``gunicorn.workers.base_async`` - since ``async`` is now a reserved word in Python 3.7. - (:pr:`1527`) - -19.8.1 / 2018/04/30 -=================== - -- fix: secure scheme headers when bound to a unix socket - (:issue:`1766`, :pr:`1767`) - -19.8.0 / 2018/04/28 -=================== - -- Eventlet 0.21.0 support (:issue:`1584`) -- Tornado 5 support (:issue:`1728`, :pr:`1752`) -- support watching additional files with ``--reload-extra-file`` - (:pr:`1527`) -- support configuring logging with a dictionary with ``--logging-config-dict`` - (:issue:`1087`, :pr:`1110`, :pr:`1602`) -- add support for the ``--config`` flag in the ``GUNICORN_CMD_ARGS`` environment - variable (:issue:`1576`, :pr:`1581`) -- disable ``SO_REUSEPORT`` by default and add the ``--reuse-port`` setting - (:issue:`1553`, :issue:`1603`, :pr:`1669`) -- fix: installing `inotify` on MacOS no longer breaks the reloader - (:issue:`1540`, :pr:`1541`) -- fix: do not throw ``TypeError`` when ``SO_REUSEPORT`` is not available - (:issue:`1501`, :pr:`1491`) -- fix: properly decode HTTP paths containing certain non-ASCII characters - (:issue:`1577`, :pr:`1578`) -- fix: remove whitespace when logging header values under gevent (:pr:`1607`) -- fix: close unlinked temporary files (:issue:`1327`, :pr:`1428`) -- fix: parse ``--umask=0`` correctly (:issue:`1622`, :pr:`1632`) -- fix: allow loading applications using relative file paths - (:issue:`1349`, :pr:`1481`) -- fix: force blocking mode on the gevent sockets (:issue:`880`, :pr:`1616`) -- fix: preserve leading `/` in request path (:issue:`1512`, :pr:`1511`) -- fix: forbid contradictory secure scheme headers -- fix: handle malformed basic authentication headers in access log - (:issue:`1683`, :pr:`1684`) -- fix: defer handling of ``USR1`` signal to a new greenlet under gevent - (:issue:`1645`, :pr:`1651`) -- fix: the threaded worker would sometimes close the wrong keep-alive - connection under Python 2 (:issue:`1698`, :pr:`1699`) -- fix: re-open log files on ``USR1`` signal using ``handler._open`` to - support subclasses of ``FileHandler`` (:issue:`1739`, :pr:`1742`) -- deprecation: the ``gaiohttp`` worker is deprecated, see the - :ref:`worker-class` documentation for more information - (:issue:`1338`, :pr:`1418`, :pr:`1569`) \ No newline at end of file diff --git a/docs/source/2019-news.rst b/docs/source/2019-news.rst deleted file mode 100644 index 28b69216b..000000000 --- a/docs/source/2019-news.rst +++ /dev/null @@ -1,121 +0,0 @@ -================ -Changelog - 2019 -================ - -.. note:: - - Please see :doc:`news` for the latest changes - -20.0.4 / 2019/11/26 -=================== - -- fix binding a socket using the file descriptor -- remove support for the `bdist_rpm` build - -20.0.3 / 2019/11/24 -=================== - -- fixed load of a config file without a Python extension -- fixed `socketfromfd.fromfd` when defaults are not set - -.. note:: we now warn when we load a config file without Python Extension - -20.0.2 / 2019/11/23 -=================== - -- fix changelog - -20.0.1 / 2019/11/23 -=================== - -- fixed the way the config module is loaded. `__file__` is now available -- fixed `wsgi.input_terminated`. It is always true. -- use the highest protocol version of openssl by default -- only support Python >= 3.5 -- added `__repr__` method to `Config` instance -- fixed support of AIX platform and musl libc in `socketfromfd.fromfd` function -- fixed support of applications loaded from a factory function -- fixed chunked encoding support to prevent any `request smuggling `_ -- Capture os.sendfile before patching in gevent and eventlet workers. - fix `RecursionError`. -- removed locking in reloader when adding new files -- load the WSGI application before the loader to pick up all files - -.. note:: this release add official support for applications loaded from a factory function - as documented in Flask and other places. - - -19.10.0 / 2019/11/23 -==================== - -- unblock select loop during reload of a sync worker -- security fix: http desync attack -- handle `wsgi.input_terminated` -- added support for str and bytes in unix socket addresses -- fixed `max_requests` setting -- headers values are now encoded as LATN1, not ASCII -- fixed `InotifyReloadeder`: handle `module.__file__` is None -- fixed compatibility with tornado 6 -- fixed root logging -- Prevent removalof unix sockets from `reuse_port` -- Clear tornado ioloop before os.fork -- Miscellaneous fixes and improvement for linting using Pylint - -20.0 / 2019/10/30 -================= - -- Fixed `fdopen` `RuntimeWarning` in Python 3.8 -- Added check and exception for str type on value in Response process_headers method. -- Ensure WSGI header value is string before conducting regex search on it. -- Added pypy3 to list of tested environments -- Grouped `StopIteration` and `KeyboardInterrupt` exceptions with same body together in Arbiter.run() -- Added `setproctitle` module to `extras_require` in setup.py -- Avoid unnecessary chown of temporary files -- Logging: Handle auth type case insensitively -- Removed `util.import_module` -- Removed fallback for `types.SimpleNamespace` in tests utils -- Use `SourceFileLoader` instead instead of `execfile_` -- Use `importlib` instead of `__import__` and eval` -- Fixed eventlet patching -- Added optional `datadog `_ tags for statsd metrics -- Header values now are encoded using latin-1, not ascii. -- Rewritten `parse_address` util added test -- Removed redundant super() arguments -- Simplify `futures` import in gthread module -- Fixed worker_connections` setting to also affects the Gthread worker type -- Fixed setting max_requests -- Bump minimum Eventlet and Gevent versions to 0.24 and 1.4 -- Use Python default SSL cipher list by default -- handle `wsgi.input_terminated` extension -- Simplify Paste Deployment documentation -- Fix root logging: root and logger are same level. -- Fixed typo in ssl_version documentation -- Documented systemd deployment unit examples -- Added systemd sd_notify support -- Fixed typo in gthread.py -- Added `tornado `_ 5 and 6 support -- Declare our setuptools dependency -- Added support to `--bind` to open file descriptors -- Document how to serve WSGI app modules from Gunicorn -- Provide guidance on X-Forwarded-For access log in documentation -- Add support for named constants in the `--ssl-version` flag -- Clarify log format usage of header & environment in documentation -- Fixed systemd documentation to properly setup gunicorn unix socket -- Prevent removal unix socket for reuse_port -- Fix `ResourceWarning` when reading a Python config module -- Remove unnecessary call to dict keys method -- Support str and bytes for UNIX socket addresses -- fixed `InotifyReloadeder`: handle `module.__file__` is None -- `/dev/shm` as a convenient alternative to making your own tmpfs mount in fchmod FAQ -- fix examples to work on python3 -- Fix typo in `--max-requests` documentation -- Clear tornado ioloop before os.fork -- Miscellaneous fixes and improvement for linting using Pylint - -Breaking Change -+++++++++++++++ - -- Removed gaiohttp worker -- Drop support for Python 2.x -- Drop support for EOL Python 3.2 and 3.3 -- Drop support for Paste Deploy server blocks diff --git a/docs/source/2020-news.rst b/docs/source/2020-news.rst deleted file mode 100644 index 1d91ef7e5..000000000 --- a/docs/source/2020-news.rst +++ /dev/null @@ -1,7 +0,0 @@ -================ -Changelog - 2020 -================ - -.. note:: - - Please see :doc:`news` for the latest changes diff --git a/docs/source/2021-news.rst b/docs/source/2021-news.rst deleted file mode 100644 index 3057600de..000000000 --- a/docs/source/2021-news.rst +++ /dev/null @@ -1,54 +0,0 @@ -================ -Changelog - 2021 -================ - -.. note:: - - Please see :doc:`news` for the latest changes - -20.1.0 - 2021-02-12 -=================== - -- document WEB_CONCURRENCY is set by, at least, Heroku -- capture peername from accept: Avoid calls to getpeername by capturing the peer name returned by - accept -- log a warning when a worker was terminated due to a signal -- fix tornado usage with latest versions of Django -- add support for python -m gunicorn -- fix systemd socket activation example -- allows to set wsgi application in config file using `wsgi_app` -- document `--timeout = 0` -- always close a connection when the number of requests exceeds the max requests -- Disable keepalive during graceful shutdown -- kill tasks in the gthread workers during upgrade -- fix latency in gevent worker when accepting new requests -- fix file watcher: handle errors when new worker reboot and ensure the list of files is kept -- document the default name and path of the configuration file -- document how variable impact configuration -- document the `$PORT` environment variable -- added milliseconds option to request_time in access_log -- added PIP requirements to be used for example -- remove version from the Server header -- fix sendfile: use `socket.sendfile` instead of `os.sendfile` -- reloader: use absolute path to prevent empty to prevent0 `InotifyError` when a file - is added to the working directory -- Add --print-config option to print the resolved settings at startup. -- remove the `--log-dict-config` CLI flag because it never had a working format - (the `logconfig_dict` setting in configuration files continues to work) - - -** Breaking changes ** - -- minimum version is Python 3.5 -- remove version from the Server header - -** Documentation ** - - - -** Others ** - -- miscellaneous changes in the code base to be a better citizen with Python 3 -- remove dead code -- fix documentation generation - diff --git a/docs/source/2023-news.rst b/docs/source/2023-news.rst deleted file mode 100644 index b685d80d2..000000000 --- a/docs/source/2023-news.rst +++ /dev/null @@ -1,39 +0,0 @@ -================ -Changelog - 2023 -================ - -21.2.0 - 2023-07-19 -=================== - -- fix thread worker: revert change considering connection as idle . - -*** NOTE *** - -This is fixing the bad file description error. - -21.1.0 - 2023-07-18 -=================== - -- fix thread worker: fix socket removal from the queue - -21.0.1 - 2023-07-17 -=================== - -- fix documentation build - -21.0.0 - 2023-07-17 -=================== - -- support python 3.11 -- fix gevent and eventlet workers -- fix threads support (gththread): improve performance and unblock requests -- SSL: now use SSLContext object -- HTTP parser: miscellaneous fixes -- remove unnecessary setuid calls -- fix testing -- improve logging -- miscellaneous fixes to core engine - -*** RELEASE NOTE *** - -We made this release major to start our new release cycle. More info will be provided on our discussion forum. diff --git a/docs/source/2024-news.rst b/docs/source/2024-news.rst deleted file mode 100644 index 376699b4d..000000000 --- a/docs/source/2024-news.rst +++ /dev/null @@ -1,61 +0,0 @@ -================ -Changelog - 2024 -================ - -23.0.0 - 2024-08-10 -=================== - -- minor docs fixes (:pr:`3217`, :pr:`3089`, :pr:`3167`) -- worker_class parameter accepts a class (:pr:`3079`) -- fix deadlock if request terminated during chunked parsing (:pr:`2688`) -- permit receiving Transfer-Encodings: compress, deflate, gzip (:pr:`3261`) -- permit Transfer-Encoding headers specifying multiple encodings. note: no parameters, still (:pr:`3261`) -- sdist generation now explicitly excludes sphinx build folder (:pr:`3257`) -- decode bytes-typed status (as can be passed by gevent) as utf-8 instead of raising `TypeError` (:pr:`2336`) -- raise correct Exception when encounting invalid chunked requests (:pr:`3258`) -- the SCRIPT_NAME and PATH_INFO headers, when received from allowed forwarders, are no longer restricted for containing an underscore (:pr:`3192`) -- include IPv6 loopback address ``[::1]`` in default for :ref:`forwarded-allow-ips` and :ref:`proxy-allow-ips` (:pr:`3192`) - -** NOTE ** - -- The SCRIPT_NAME change mitigates a regression that appeared first in the 22.0.0 release -- Review your :ref:`forwarded-allow-ips` setting if you are still not seeing the SCRIPT_NAME transmitted -- Review your :ref:`forwarder-headers` setting if you are missing headers after upgrading from a version prior to 22.0.0 - -** Breaking changes ** - -- refuse requests where the uri field is empty (:pr:`3255`) -- refuse requests with invalid CR/LR/NUL in heade field values (:pr:`3253`) -- remove temporary ``--tolerate-dangerous-framing`` switch from 22.0 (:pr:`3260`) -- If any of the breaking changes affect you, be aware that now refused requests can post a security problem, especially so in setups involving request pipe-lining and/or proxies. - -22.0.0 - 2024-04-17 -=================== - -- use `utime` to notify workers liveness -- migrate setup to pyproject.toml -- fix numerous security vulnerabilities in HTTP parser (closing some request smuggling vectors) -- parsing additional requests is no longer attempted past unsupported request framing -- on HTTP versions < 1.1 support for chunked transfer is refused (only used in exploits) -- requests conflicting configured or passed SCRIPT_NAME now produce a verbose error -- Trailer fields are no longer inspected for headers indicating secure scheme -- support Python 3.12 - -** Breaking changes ** - -- minimum version is Python 3.7 -- the limitations on valid characters in the HTTP method have been bounded to Internet Standards -- requests specifying unsupported transfer coding (order) are refused by default (rare) -- HTTP methods are no longer casefolded by default (IANA method registry contains none affected) -- HTTP methods containing the number sign (#) are no longer accepted by default (rare) -- HTTP versions < 1.0 or >= 2.0 are no longer accepted by default (rare, only HTTP/1.1 is supported) -- HTTP versions consisting of multiple digits or containing a prefix/suffix are no longer accepted -- HTTP header field names Gunicorn cannot safely map to variables are silently dropped, as in other software -- HTTP headers with empty field name are refused by default (no legitimate use cases, used in exploits) -- requests with both Transfer-Encoding and Content-Length are refused by default (such a message might indicate an attempt to perform request smuggling) -- empty transfer codings are no longer permitted (reportedly seen with really old & broken proxies) - - -** SECURITY ** - -- fix CVE-2024-1135 diff --git a/docs/source/_static/gunicorn.png b/docs/source/_static/gunicorn.png deleted file mode 100644 index a3a78e0e8cc7d63e1cca0a03833185840320aa03..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14398 zcmWk#1w5R696#N0I)~F8lhd5;?qQgz>6-4EIx*cbQ`6HnOfysCw9~_M^FFWpa6CTu z-2Z>iufFlbX=^IsVN+p)Kp;F7WvDI)gp>mOZj6Zz{DgZJ7Xwe|Z`72apy&S|MctKY zz!5ArWfM=}6$}4=BgwJl`T++qyi_z4FqW~22(jr0cyoaN(}Pr?vig2YM?wC9=63DR z*Zx!Lu=nYWEq|-`NXb!Ug&DXs-oiX#$avxOb{tt!;Dht&dP# zlY%Yhh->UWqtl%_JgMxOb`Oma(%9y?I%FMoRVmuSTt6ua81M?zKX_QEAV>1q7j?M) zc?jIF(DgO*gFC{Hm#6+%^D3L9wyVN~k4JLS#ZRS%sZseYrB#NYXMI?jK{H=YD7p`w1NTPtgoP5St6#M^U{fQmcJT;b;^s#`C*i(Grr`fA&`iGAxp`nE8%-e$Hwl2-w zjqFQ?owkQN+`Bhx_3cgQ;&Zs~kuXXz<6>>o*;0Ef4Y2tle&{J|iKNaCr=|VYW5MW` zkeZ&ICGnCA1=&#OPJU7dG4CZbFRD$HdHe~g!KhZbfEKhK@HKQ2prxnzI1h#DZ*4SCf-x8@$nndEb6EBY+L-X z`PkuWi-kuGB_$=TU;RkPxODnrmh*Fe17t=#Pc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Am*tsJdjOEog1fMBzol)ggxDiSK9+`|E>NB%<( znR2MLWLSjH%*=E;8vL}buBbq_u(0@kfKO;uhH3lN@85R}ySs~h4jO#wm6es~Shn(X zWO_hfM9%IvMv*Cx)$gb?D^JH}FX#9W5Wp#!Tx5ao(R7@`XSQcgto*#<`Tye28P(~> zh3P)HT&bux-qGJvo<3P!<07rHnQ8yelr=^ z_wnxXE=Kyn`YZPTw|Tun)y0=MAAi|sH%2xGhgYZTerao4P%hV1wKM;ouB%!;;~)=( zI=R@c2#P>a>kg@+t(Adk0jyK-OQ`_ - -GitHub issues are used for 3 different purposes: - - * `Bug tracker `_ : To check for latest bugs. Tip: See existing issues before opening a new one! - * `Forum `_ : Stackoverflow-style questions about Gunicorn usage. - * `Other Issues `_ : Discussion of Gunicorn development, new features - and project management. - -IRC -=== - -The Gunicorn channel is on the `Libera Chat `_ IRC -network. You can chat with others on `#gunicorn channel -`_ - -Issue Tracking -============== - -Bug reports, enhancement requests and tasks generally go in the `Github -issue tracker `_ - -Security Issues -=============== - -The security mailing list is a place to report security issues. Only -developers are subscribed to it. To post a message to the list use the address -to `security@gunicorn.org `_ diff --git a/docs/source/conf.py b/docs/source/conf.py deleted file mode 100644 index f000c2dba..000000000 --- a/docs/source/conf.py +++ /dev/null @@ -1,72 +0,0 @@ -# -# Gunicorn documentation build configuration file -# - -import os -import sys -import time - -DOCS_DIR = os.path.abspath(os.path.dirname(__file__)) - -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' - -# for gunicorn_ext.py -sys.path.append(os.path.join(DOCS_DIR, os.pardir)) -sys.path.insert(0, os.path.join(DOCS_DIR, os.pardir, os.pardir)) - -extensions = ['gunicorn_ext'] -templates_path = ['_templates'] -source_suffix = '.rst' -master_doc = 'index' - -# General information about the project. -project = 'Gunicorn' -copyright = '2009-%s, Benoit Chesneau' % time.strftime('%Y') -# gunicorn version -import gunicorn -release = version = gunicorn.__version__ - -exclude_patterns = [] -pygments_style = 'sphinx' - - -# -- Options for HTML output --------------------------------------------------- - -if not on_rtd: # only import and set the theme if we're building docs locally - try: - import sphinx_rtd_theme - except ImportError: - html_theme = 'default' - else: - html_theme = 'sphinx_rtd_theme' - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] -else: - html_theme = 'default' - -html_static_path = ['_static'] -htmlhelp_basename = 'Gunicorndoc' - - -# -- Options for LaTeX output -------------------------------------------------- - -latex_elements = { - -} - -latex_documents = [ - ('index', 'Gunicorn.tex', 'Gunicorn Documentation', - 'Benoit Chesneau', 'manual'), -] - - -# -- Options for manual page output -------------------------------------------- -man_pages = [ - ('index', 'gunicorn', 'Gunicorn Documentation', - ['Benoit Chesneau'], 1) -] - -texinfo_documents = [ - ('index', 'Gunicorn', 'Gunicorn Documentation', - 'Benoit Chesneau', 'Gunicorn', 'One line description of project.', - 'Miscellaneous'), -] diff --git a/docs/source/configure.rst b/docs/source/configure.rst deleted file mode 100644 index dc9ba62da..000000000 --- a/docs/source/configure.rst +++ /dev/null @@ -1,118 +0,0 @@ -.. _configuration: - -====================== -Configuration Overview -====================== - -Gunicorn reads configuration information from five places. - -Gunicorn first reads environment variables for some configuration -:ref:`settings `. - -Gunicorn then reads configuration from a framework specific configuration -file. Currently this only affects Paster applications. - -The third source of configuration information is an optional configuration file -``gunicorn.conf.py`` searched in the current working directory or specified -using a command line argument. Anything specified in this configuration file -will override any framework specific settings. - -The fourth place of configuration information are command line arguments -stored in an environment variable named ``GUNICORN_CMD_ARGS``. - -Lastly, the command line arguments used to invoke Gunicorn are the final place -considered for configuration settings. If an option is specified on the command -line, this is the value that will be used. - -When a configuration file is specified in the command line arguments and in the -``GUNICORN_CMD_ARGS`` environment variable, only the configuration -file specified on the command line is used. - -Once again, in order of least to most authoritative: - 1. Environment Variables - 2. Framework Settings - 3. Configuration File - 4. ``GUNICORN_CMD_ARGS`` - 5. Command Line - - -.. note:: - - To print your resolved configuration when using the command line or the - configuration file you can run the following command:: - - $ gunicorn --print-config APP_MODULE - - To check your resolved configuration when using the command line or the - configuration file you can run the following command:: - - $ gunicorn --check-config APP_MODULE - - It also allows you to know if your application can be launched. - - -Command Line -============ - -If an option is specified on the command line, it overrides all other values -that may have been specified in the app specific settings, or in the optional -configuration file. Not all Gunicorn settings are available to be set from the -command line. To see the full list of command line settings you can do the -usual:: - - $ gunicorn -h - -There is also a ``--version`` flag available to the command line scripts that -isn't mentioned in the list of :ref:`settings `. - -.. _configuration_file: - -Configuration File -================== - -The configuration file should be a valid Python source file with a **python -extension** (e.g. `gunicorn.conf.py`). It only needs to be readable from the -file system. More specifically, it does not have to be on the module path -(sys.path, PYTHONPATH). Any Python is valid. Just consider that this will be -run every time you start Gunicorn (including when you signal Gunicorn to reload). - -To set a parameter, just assign to it. There's no special syntax. The values -you provide will be used for the configuration values. - -For instance:: - - import multiprocessing - - bind = "127.0.0.1:8000" - workers = multiprocessing.cpu_count() * 2 + 1 - -All the settings are mentioned in the :ref:`settings ` list. - - -Framework Settings -================== - -Currently, only Paster applications have access to framework specific -settings. If you have ideas for providing settings to WSGI applications or -pulling information from Django's settings.py feel free to open an issue_ to -let us know. - -.. _issue: https://github.com/benoitc/gunicorn/issues - -Paster Applications -------------------- - -In your INI file, you can specify to use Gunicorn as the server like such: - -.. code-block:: ini - - [server:main] - use = egg:gunicorn#main - host = 192.168.0.1 - port = 80 - workers = 2 - proc_name = brim - -Any parameters that Gunicorn knows about will automatically be inserted into -the base configuration. Remember that these will be overridden by the config -file and/or the command line. diff --git a/docs/source/custom.rst b/docs/source/custom.rst deleted file mode 100644 index 90f742094..000000000 --- a/docs/source/custom.rst +++ /dev/null @@ -1,72 +0,0 @@ -.. _custom: - -================== -Custom Application -================== - -.. versionadded:: 19.0 - -Sometimes, you want to integrate Gunicorn with your WSGI application. In this -case, you can inherit from :class:`gunicorn.app.base.BaseApplication`. - -Here is a small example where we create a very small WSGI app and load it with -a custom Application: - -.. literalinclude:: ../../examples/standalone_app.py - :start-after: # See the NOTICE for more information - :lines: 2- - -Using server hooks ------------------- - -If you wish to include server hooks in your custom application, you can specify a function in the config options. Here is an example with the `pre_fork` hook: - -.. code-block:: python - - def pre_fork(server, worker): - print(f"pre-fork server {server} worker {worker}", file=sys.stderr) - - # ... - if __name__ == '__main__': - options = { - 'bind': '%s:%s' % ('127.0.0.1', '8080'), - 'workers': number_of_workers(), - 'pre_fork': pre_fork, - } - - -Direct Usage of Existing WSGI Apps ----------------------------------- - -If necessary, you can run Gunicorn straight from Python, allowing you to -specify a WSGI-compatible application at runtime. This can be handy for -rolling deploys or in the case of using PEX files to deploy your application, -as the app and Gunicorn can be bundled in the same PEX file. Gunicorn has -this functionality built-in as a first class citizen known as -:class:`gunicorn.app.wsgiapp`. This can be used to run WSGI-compatible app -instances such as those produced by Flask or Django. Assuming your WSGI API -package is *exampleapi*, and your application instance is *app*, this is all -you need to get going:: - - gunicorn.app.wsgiapp exampleapi:app - -This command will work with any Gunicorn CLI parameters or a config file - just -pass them along as if you're directly giving them to Gunicorn: - -.. code-block:: bash - - # Custom parameters - $ python gunicorn.app.wsgiapp exampleapi:app --bind=0.0.0.0:8081 --workers=4 - # Using a config file - $ python gunicorn.app.wsgiapp exampleapi:app -c config.py - -Note for those using PEX: use ``-c gunicorn`` as your entry at build -time, and your compiled app should work with the entry point passed to it at -run time. - -.. code-block:: bash - - # Generic pex build command via bash from root of exampleapi project - $ pex . -v -c gunicorn -o compiledapp.pex - # Running it - ./compiledapp.pex exampleapi:app -c gunicorn_config.py diff --git a/docs/source/deploy.rst b/docs/source/deploy.rst deleted file mode 100644 index 5f8689793..000000000 --- a/docs/source/deploy.rst +++ /dev/null @@ -1,380 +0,0 @@ -================== -Deploying Gunicorn -================== - -We strongly recommend using Gunicorn behind a proxy server. - -Nginx Configuration -=================== - -Although there are many HTTP proxies available, we strongly advise that you -use Nginx_. If you choose another proxy server you need to make sure that it -buffers slow clients when you use default Gunicorn workers. Without this -buffering Gunicorn will be easily susceptible to denial-of-service attacks. -You can use Hey_ to check if your proxy is behaving properly. - -An `example configuration`_ file for fast clients with Nginx_: - -.. literalinclude:: ../../examples/nginx.conf - :language: nginx - :caption: **nginx.conf** - -If you want to be able to handle streaming request/responses or other fancy -features like Comet, Long polling, or Web sockets, you need to turn off the -proxy buffering. **When you do this** you must run with one of the async worker -classes. - -To turn off buffering, you only need to add ``proxy_buffering off;`` to your -``location`` block:: - - ... - location @proxy_to_app { - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Host $http_host; - proxy_redirect off; - proxy_buffering off; - - proxy_pass http://app_server; - } - ... - -If you want to ignore aborted requests like health check of Load Balancer, some -of which close the connection without waiting for a response, you need to turn -on `ignoring client abort`_. - -To ignore aborted requests, you only need to add -``proxy_ignore_client_abort on;`` to your ``location`` block:: - - ... - proxy_ignore_client_abort on; - ... - -.. note:: - The default value of ``proxy_ignore_client_abort`` is ``off``. Error code - 499 may appear in Nginx log and ``Ignoring EPIPE`` may appear in Gunicorn - log if loglevel is set to ``debug``. - -It is recommended to pass protocol information to Gunicorn. Many web -frameworks use this information to generate URLs. Without this -information, the application may mistakenly generate 'http' URLs in -'https' responses, leading to mixed content warnings or broken -applications. To configure Nginx to pass an appropriate header, add -a ``proxy_set_header`` directive to your ``location`` block:: - - ... - proxy_set_header X-Forwarded-Proto $scheme; - ... - -If you are running Nginx on a different host than Gunicorn you need to tell -Gunicorn to trust the ``X-Forwarded-*`` headers sent by Nginx. By default, -Gunicorn will only trust these headers if the connection comes from localhost. -This is to prevent a malicious client from forging these headers:: - - $ gunicorn -w 3 --forwarded-allow-ips="10.170.3.217,10.170.3.220" test:app - -When the Gunicorn host is completely firewalled from the external network such -that all connections come from a trusted proxy (e.g. Heroku) this value can -be set to '*'. Using this value is **potentially dangerous** if connections to -Gunicorn may come from untrusted proxies or directly from clients since the -application may be tricked into serving SSL-only content over an insecure -connection. - -Gunicorn 19 introduced a breaking change concerning how ``REMOTE_ADDR`` is -handled. Previous to Gunicorn 19 this was set to the value of -``X-Forwarded-For`` if received from a trusted proxy. However, this was not in -compliance with :rfc:`3875` which is why the ``REMOTE_ADDR`` is now the IP -address of **the proxy** and **not the actual user**. - -To have access logs indicate **the actual user** IP when proxied, set -:ref:`access-log-format` with a format which includes ``X-Forwarded-For``. For -example, this format uses ``X-Forwarded-For`` in place of ``REMOTE_ADDR``:: - - %({x-forwarded-for}i)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" - -It is also worth noting that the ``REMOTE_ADDR`` will be completely empty if -you bind Gunicorn to a UNIX socket and not a TCP ``host:port`` tuple. - -Using Virtualenv -================ - -To serve an app from a Virtualenv_ it is generally easiest to just install -Gunicorn directly into the Virtualenv. This will create a set of Gunicorn -scripts for that Virtualenv which can be used to run applications normally. - -If you have Virtualenv installed, you should be able to do something like -this:: - - $ mkdir ~/venvs/ - $ virtualenv ~/venvs/webapp - $ source ~/venvs/webapp/bin/activate - $ pip install gunicorn - $ deactivate - -Then you just need to use one of the three Gunicorn scripts that was installed -into ``~/venvs/webapp/bin``. - -Note: You can force the installation of Gunicorn in your Virtualenv by -passing ``-I`` or ``--ignore-installed`` option to pip:: - - $ source ~/venvs/webapp/bin/activate - $ pip install -I gunicorn - -Monitoring -========== - -.. note:: - Make sure that when using either of these service monitors you do not - enable the Gunicorn's daemon mode. These monitors expect that the process - they launch will be the process they need to monitor. Daemonizing will - fork-exec which creates an unmonitored process and generally just - confuses the monitor services. - -Gaffer ------- - -Using Gafferd and gaffer -++++++++++++++++++++++++ - -Gaffer_ can be used to monitor Gunicorn. A simple configuration is:: - - [process:gunicorn] - cmd = gunicorn -w 3 test:app - cwd = /path/to/project - -Then you can easily manage Gunicorn using Gaffer_. - - -Using a Procfile -++++++++++++++++ - -Create a ``Procfile`` in your project:: - - gunicorn = gunicorn -w 3 test:app - -You can launch any other applications that should be launched at the same time. - -Then you can start your Gunicorn application using Gaffer_:: - - gaffer start - -If gafferd is launched you can also load your Procfile in it directly:: - - gaffer load - -All your applications will be then supervised by gafferd. - -Runit ------ - -A popular method for deploying Gunicorn is to have it monitored by runit_. -Here is an `example service`_ definition:: - - #!/bin/sh - - GUNICORN=/usr/local/bin/gunicorn - ROOT=/path/to/project - PID=/var/run/gunicorn.pid - - APP=main:application - - if [ -f $PID ]; then rm $PID; fi - - cd $ROOT - exec $GUNICORN -c $ROOT/gunicorn.conf.py --pid=$PID $APP - -Save this as ``/etc/sv/[app_name]/run``, and make it executable -(``chmod u+x /etc/sv/[app_name]/run``). -Then run ``ln -s /etc/sv/[app_name] /etc/service/[app_name]``. -If runit is installed, Gunicorn should start running automatically as soon -as you create the symlink. - -If it doesn't start automatically, run the script directly to troubleshoot. - -Supervisor ----------- - -Another useful tool to monitor and control Gunicorn is Supervisor_. A -`simple configuration`_ is:: - - [program:gunicorn] - command=/path/to/gunicorn main:application -c /path/to/gunicorn.conf.py - directory=/path/to/project - user=nobody - autostart=true - autorestart=true - redirect_stderr=true - -Upstart -------- - -Using Gunicorn with upstart is simple. In this example we will run the app -"myapp" from a virtualenv. All errors will go to -``/var/log/upstart/myapp.log``. - -**/etc/init/myapp.conf**:: - - description "myapp" - - start on (filesystem) - stop on runlevel [016] - - respawn - setuid nobody - setgid nogroup - chdir /path/to/app/directory - - exec /path/to/virtualenv/bin/gunicorn myapp:app - -Systemd -------- - -A tool that is starting to be common on linux systems is Systemd_. It is a -system services manager that allows for strict process management, resources -and permissions control. - -Below are configuration files and instructions for using systemd to create -a unix socket for incoming Gunicorn requests. Systemd will listen on this -socket and start gunicorn automatically in response to traffic. Later in -this section are instructions for configuring Nginx to forward web traffic -to the newly created unix socket: - -**/etc/systemd/system/gunicorn.service**:: - - [Unit] - Description=gunicorn daemon - Requires=gunicorn.socket - After=network.target - - [Service] - # gunicorn can let systemd know when it is ready - Type=notify - NotifyAccess=main - # the specific user that our service will run as - User=someuser - Group=someuser - # this user can be transiently created by systemd - # DynamicUser=true - RuntimeDirectory=gunicorn - WorkingDirectory=/home/someuser/applicationroot - ExecStart=/usr/bin/gunicorn applicationname.wsgi - ExecReload=/bin/kill -s HUP $MAINPID - KillMode=mixed - TimeoutStopSec=5 - PrivateTmp=true - # if your app does not need administrative capabilities, let systemd know - # ProtectSystem=strict - - [Install] - WantedBy=multi-user.target - -**/etc/systemd/system/gunicorn.socket**:: - - [Unit] - Description=gunicorn socket - - [Socket] - ListenStream=/run/gunicorn.sock - # Our service won't need permissions for the socket, since it - # inherits the file descriptor by socket activation. - # Only the nginx daemon will need access to the socket: - SocketUser=www-data - SocketGroup=www-data - # Once the user/group is correct, restrict the permissions: - SocketMode=0660 - - [Install] - WantedBy=sockets.target - - -Next enable and start the socket (it will autostart at boot too):: - - systemctl enable --now gunicorn.socket - - -Now let's see if the nginx daemon will be able to connect to the socket. -Running ``sudo -u www-data curl --unix-socket /run/gunicorn.sock http``, -our Gunicorn service will be automatically started and you should see some -HTML from your server in the terminal. - -.. note:: - - systemd employs cgroups to track the processes of a service, so it doesn't - need pid files. In the rare case that you need to find out the service main - pid, you can use ``systemctl show --value -p MainPID gunicorn.service``, but - if you only want to send a signal an even better option is - ``systemctl kill -s HUP gunicorn.service``. - -.. note:: - - ``www-data`` is the default nginx user in debian, other distributions use - different users (for example: ``http`` or ``nginx``). Check your distro to - know what to put for the socket user, and for the sudo command. - -You must now configure your web proxy to send traffic to the new Gunicorn -socket. Edit your ``nginx.conf`` to include the following: - -**/etc/nginx/nginx.conf**:: - - user www-data; - ... - http { - server { - listen 8000; - server_name 127.0.0.1; - location / { - proxy_pass http://unix:/run/gunicorn.sock; - } - } - } - ... - -.. note:: - - The listen and server_name used here are configured for a local machine. - In a production server you will most likely listen on port 80, - and use your URL as the server_name. - -Now make sure you enable the nginx service so it automatically starts at boot:: - - systemctl enable nginx.service - -Either reboot, or start Nginx with the following command:: - - systemctl start nginx - -Now you should be able to test Nginx with Gunicorn by visiting -http://127.0.0.1:8000/ in any web browser. Systemd is now set up. - - -Logging -======= - -Logging can be configured by using various flags detailed in the -`configuration documentation`_ or by creating a `logging configuration file`_. -Send the ``USR1`` signal to rotate logs if you are using the logrotate -utility:: - - kill -USR1 $(cat /var/run/gunicorn.pid) - -.. note:: - Overriding the ``LOGGING`` dictionary requires to set - ``disable_existing_loggers: False`` to not interfere with the Gunicorn - logging. - -.. warning:: - Gunicorn error log is here to log errors from Gunicorn, not from another - application. - -.. _Nginx: https://nginx.org/ -.. _Hey: https://github.com/rakyll/hey -.. _`example configuration`: https://github.com/benoitc/gunicorn/blob/master/examples/nginx.conf -.. _runit: http://smarden.org/runit/ -.. _`example service`: https://github.com/benoitc/gunicorn/blob/master/examples/gunicorn_rc -.. _Supervisor: http://supervisord.org/ -.. _`simple configuration`: https://github.com/benoitc/gunicorn/blob/master/examples/supervisor.conf -.. _`configuration documentation`: http://docs.gunicorn.org/en/latest/settings.html#logging -.. _`logging configuration file`: https://github.com/benoitc/gunicorn/blob/master/examples/logging.conf -.. _Virtualenv: https://pypi.python.org/pypi/virtualenv -.. _Systemd: https://www.freedesktop.org/wiki/Software/systemd/ -.. _Gaffer: https://gaffer.readthedocs.io/ -.. _`ignoring client abort`: http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ignore_client_abort diff --git a/docs/source/design.rst b/docs/source/design.rst deleted file mode 100644 index 6796e9695..000000000 --- a/docs/source/design.rst +++ /dev/null @@ -1,150 +0,0 @@ - -.. _design: - -====== -Design -====== - -A brief description of the architecture of Gunicorn. - -Server Model -============ - -Gunicorn is based on the pre-fork worker model. This means that there is a -central master process that manages a set of worker processes. The master -never knows anything about individual clients. All requests and responses are -handled completely by worker processes. - -Master ------- - -The master process is a simple loop that listens for various process signals -and reacts accordingly. It manages the list of running workers by listening -for signals like TTIN, TTOU, and CHLD. TTIN and TTOU tell the master to -increase or decrease the number of running workers. CHLD indicates that a child -process has terminated, in this case the master process automatically restarts -the failed worker. - -Sync Workers ------------- - -The most basic and the default worker type is a synchronous worker class that -handles a single request at a time. This model is the simplest to reason about -as any errors will affect at most a single request. Though as we describe below -only processing a single request at a time requires some assumptions about how -applications are programmed. - -``sync`` worker does not support persistent connections - each connection is -closed after response has been sent (even if you manually add ``Keep-Alive`` -or ``Connection: keep-alive`` header in your application). - -Async Workers -------------- - -The asynchronous workers available are based on Greenlets_ (via Eventlet_ and -Gevent_). Greenlets are an implementation of cooperative multi-threading for -Python. In general, an application should be able to make use of these worker -classes with no changes. - -For full greenlet support applications might need to be adapted. -When using, e.g., Gevent_ and Psycopg_ it makes sense to ensure psycogreen_ is -installed and `setup `_. - -Other applications might not be compatible at all as they, e.g., rely on -the original unpatched behavior. - -Gthread Workers ---------------- - -The worker `gthread` is a threaded worker. It accepts connections in the -main loop. Accepted connections are added to the thread pool as a -connection job. On keepalive connections are put back in the loop -waiting for an event. If no event happens after the keepalive timeout, -the connection is closed. - -Tornado Workers ---------------- - -There's also a Tornado worker class. It can be used to write applications using -the Tornado framework. Although the Tornado workers are capable of serving a -WSGI application, this is not a recommended configuration. - - -.. _asyncio-workers: - -AsyncIO Workers ---------------- - -Third-party workers can be used to use Gunicorn with asyncio frameworks. - -Choosing a Worker Type -====================== - -The default synchronous workers assume that your application is resource-bound -in terms of CPU and network bandwidth. Generally this means that your -application shouldn't do anything that takes an undefined amount of time. An -example of something that takes an undefined amount of time is a request to the -internet. At some point the external network will fail in such a way that -clients will pile up on your servers. So, in this sense, any web application -which makes outgoing requests to APIs will benefit from an asynchronous worker. - -This resource bound assumption is why we require a buffering proxy in front of -a default configuration Gunicorn. If you exposed synchronous workers to the -internet, a DOS attack would be trivial by creating a load that trickles data to -the servers. For the curious, Hey_ is an example of this type of load. - - -Some examples of behavior requiring asynchronous workers: - - * Applications making long blocking calls (Ie, external web services) - * Serving requests directly to the internet - * Streaming requests and responses - * Long polling - * Web sockets - * Comet - -How Many Workers? -================= - -DO NOT scale the number of workers to the number of clients you expect to have. -Gunicorn should only need 4-12 worker processes to handle hundreds or thousands -of requests per second. - -Gunicorn relies on the operating system to provide all of the load balancing -when handling requests. Generally we recommend ``(2 x $num_cores) + 1`` as the -number of workers to start off with. While not overly scientific, the formula -is based on the assumption that for a given core, one worker will be reading -or writing from the socket while the other worker is processing a request. - -Obviously, your particular hardware and application are going to affect the -optimal number of workers. Our recommendation is to start with the above guess -and tune using TTIN and TTOU signals while the application is under load. - -Always remember, there is such a thing as too many workers. After a point your -worker processes will start thrashing system resources decreasing the -throughput of the entire system. - -How Many Threads? -=================== - -Since Gunicorn 19, a threads option can be used to process requests in multiple -threads. Using threads assumes use of the gthread worker. One benefit from threads -is that requests can take longer than the worker timeout while notifying the -master process that it is not frozen and should not be killed. Depending on the -system, using multiple threads, multiple worker processes, or some mixture, may -yield the best results. For example, CPython may not perform as well as Jython -when using threads, as threading is implemented differently by each. Using -threads instead of processes is a good way to reduce the memory footprint of -Gunicorn, while still allowing for application upgrades using the reload -signal, as the application code will be shared among workers but loaded only in -the worker processes (unlike when using the preload setting, which loads the -code in the master process). - -.. _Greenlets: https://github.com/python-greenlet/greenlet -.. _Eventlet: http://eventlet.net/ -.. _Gevent: http://www.gevent.org/ -.. _Hey: https://github.com/rakyll/hey -.. _aiohttp: https://docs.aiohttp.org/en/stable/deployment.html#nginx-gunicorn -.. _`example`: https://github.com/benoitc/gunicorn/blob/master/examples/frameworks/flaskapp_aiohttp_wsgi.py -.. _Psycopg: http://initd.org/psycopg/ -.. _psycogreen: https://github.com/psycopg/psycogreen/ diff --git a/docs/source/faq.rst b/docs/source/faq.rst deleted file mode 100644 index 8c52a4865..000000000 --- a/docs/source/faq.rst +++ /dev/null @@ -1,244 +0,0 @@ -.. _faq: - -=== -FAQ -=== - -WSGI Bits -========= - -How do I set SCRIPT_NAME? -------------------------- - -By default ``SCRIPT_NAME`` is an empty string. The value could be set by -setting ``SCRIPT_NAME`` in the environment or as an HTTP header. Note that -this headers contains and underscore, so it is only accepted from trusted -forwarders listed in the :ref:`forwarded-allow-ips` setting. - -.. note:: - - If your application should appear in a subfolder, your ``SCRIPT_NAME`` - would typically start with single slash but contain no trailing slash. - -Server Stuff -============ - -How do I reload my application in Gunicorn? -------------------------------------------- - -You can gracefully reload by sending HUP signal to gunicorn:: - - $ kill -HUP masterpid - -How might I test a proxy configuration? ---------------------------------------- - -The Hey_ program is a great way to test that your proxy is correctly -buffering responses for the synchronous workers:: - - $ hey -n 10000 -c 100 http://127.0.0.1:5000/ - -This runs a benchmark of 10000 requests with 100 running concurrently. - -How can I name processes? -------------------------- - -If you install the Python package setproctitle_ Gunicorn will set the process -names to something a bit more meaningful. This will affect the output you see -in tools like ``ps`` and ``top``. This helps for distinguishing the master -process as well as between masters when running more than one app on a single -machine. See the proc_name_ setting for more information. - -Why is there no HTTP Keep-Alive? --------------------------------- - -The default Sync workers are designed to run behind Nginx which only uses -HTTP/1.0 with its upstream servers. If you want to deploy Gunicorn to -handle unbuffered requests (ie, serving requests directly from the internet) -you should use one of the async workers. - -.. _Hey: https://github.com/rakyll/hey -.. _setproctitle: https://pypi.python.org/pypi/setproctitle -.. _proc_name: settings.html#proc-name - - -Worker Processes -================ - -How do I know which type of worker to use? ------------------------------------------- - -Read the :ref:`design` page for help on the various worker types. - -What types of workers are there? --------------------------------- - -Check out the configuration docs for worker_class_. - -How can I figure out the best number of worker processes? ---------------------------------------------------------- - -Here is our recommendation for tuning the `number of workers`_. - -How can I change the number of workers dynamically? ---------------------------------------------------- - -TTIN and TTOU signals can be sent to the master to increase or decrease -the number of workers. - -To increase the worker count by one:: - - $ kill -TTIN $masterpid - -To decrease the worker count by one:: - - $ kill -TTOU $masterpid - -Does Gunicorn suffer from the thundering herd problem? ------------------------------------------------------- - -The thundering herd problem occurs when many sleeping request handlers, which -may be either threads or processes, wake up at the same time to handle a new -request. Since only one handler will receive the request, the others will have -been awakened for no reason, wasting CPU cycles. At this time, Gunicorn does -not implement any IPC solution for coordinating between worker processes. You -may experience high load due to this problem when using many workers or -threads. However `a work has been started -`_ to remove this issue. - -.. _worker_class: settings.html#worker-class -.. _`number of workers`: design.html#how-many-workers - -Why I don't see any logs in the console? ----------------------------------------- - -In version 19.0, Gunicorn doesn't log by default in the console. -To watch the logs in the console you need to use the option ``--log-file=-``. -In version 19.2, Gunicorn logs to the console by default again. - -Kernel Parameters -================= - -When dealing with large numbers of concurrent connections there are a handful -of kernel parameters that you might need to adjust. Generally these should only -affect sites with a very large concurrent load. These parameters are not -specific to Gunicorn, they would apply to any sort of network server you may be -running. - -These commands are for Linux. Your particular OS may have slightly different -parameters. - -How can I increase the maximum number of file descriptors? ----------------------------------------------------------- - -One of the first settings that usually needs to be bumped is the maximum number -of open file descriptors for a given process. For the confused out there, -remember that Unices treat sockets as files. - -.. warning:: ``sudo ulimit`` may not work - -Considering non-privileged users are not able to relax the limit, you should -firstly switch to root user, increase the limit, then run gunicorn. Using ``sudo -ulimit`` would not take effect. - -Try systemd's service unit file, or an initscript which runs as root. - -How can I increase the maximum socket backlog? ----------------------------------------------- - -Listening sockets have an associated queue of incoming connections that are -waiting to be accepted. If you happen to have a stampede of clients that fill -up this queue new connections will eventually start getting dropped. - -:: - - $ sudo sysctl -w net.core.somaxconn="2048" - -How can I disable the use of ``sendfile()`` -------------------------------------------- - -Disabling the use ``sendfile()`` can be done by using the ``--no-sendfile`` -setting or by setting the environment variable ``SENDFILE`` to 0. - - - -Troubleshooting -=============== - -How do I fix Django reporting an ``ImproperlyConfigured`` error? ----------------------------------------------------------------- - -With asynchronous workers, creating URLs with the ``reverse`` function of -``django.core.urlresolvers`` may fail. Use ``reverse_lazy`` instead. - -.. _blocking-os-fchmod: - -How do I avoid Gunicorn excessively blocking in ``os.fchmod``? --------------------------------------------------------------- - -The current heartbeat system involves calling ``os.fchmod`` on temporary file -handlers and may block a worker for arbitrary time if the directory is on a -disk-backed filesystem. For example, by default ``/tmp`` is not mounted as -``tmpfs`` in Ubuntu; in AWS an EBS root instance volume may sometimes hang for -half a minute and during this time Gunicorn workers may completely block in -``os.fchmod``. ``os.fchmod`` may introduce extra delays if the disk gets full. -Also Gunicorn may refuse to start if it can't create the files when the disk is -full. - -Currently to avoid these problems you can use a ``tmpfs`` mount (for a new -directory or for ``/tmp``) and pass its path to ``--worker-tmp-dir``. First, -check whether your ``/tmp`` is disk-backed or RAM-backed:: - - $ df /tmp - Filesystem 1K-blocks Used Available Use% Mounted on - /dev/xvda1 ... ... ... ... / - -No luck. If you are using Fedora or Ubuntu, you should already have a ``tmpfs`` -mount at ``/dev/shm``:: - - $ df /dev/shm - Filesystem 1K-blocks Used Available Use% Mounted on - tmpfs ... ... ... ... /dev/shm - -In this case you can set ``--worker-tmp-dir /dev/shm``, otherwise you can -create a new ``tmpfs`` mount:: - - sudo cp /etc/fstab /etc/fstab.orig - sudo mkdir /mem - echo 'tmpfs /mem tmpfs defaults,size=64m,mode=1777,noatime,comment=for-gunicorn 0 0' | sudo tee -a /etc/fstab - sudo mount /mem - -Check the result:: - - $ df /mem - Filesystem 1K-blocks Used Available Use% Mounted on - tmpfs 65536 0 65536 0% /mem - -Now you can set ``--worker-tmp-dir /mem``. - -Why are Workers Silently Killed? --------------------------------------------------------------- - -A sometimes subtle problem to debug is when a worker process is killed and there -is little logging information about what happened. - -If you use a reverse proxy like NGINX you might see 502 returned to a client. - -In the gunicorn logs you might simply see ``[35] [INFO] Booting worker with pid: 35`` - -It's completely normal for workers to be stop and start, for example due to -max-requests setting. Ordinarily gunicorn will capture any signals and log something. - -This particular failure case is usually due to a SIGKILL being received, as it's -not possible to catch this signal silence is usually a common side effect! A common -cause of SIGKILL is when OOM killer terminates a process due to low memory condition. - -This is increasingly common in container deployments where memory limits are enforced -by cgroups, you'll usually see evidence of this from dmesg:: - - dmesg | grep gunicorn - Memory cgroup out of memory: Kill process 24534 (gunicorn) score 1506 or sacrifice child - Killed process 24534 (gunicorn) total-vm:1016648kB, anon-rss:550160kB, file-rss:25824kB, shmem-rss:0kB - -In these instances adjusting the memory limit is usually your best bet, it's also possible -to configure OOM not to send SIGKILL by default. diff --git a/docs/source/index.rst b/docs/source/index.rst deleted file mode 100644 index 6c3d51f64..000000000 --- a/docs/source/index.rst +++ /dev/null @@ -1,46 +0,0 @@ -====================== -Gunicorn - WSGI server -====================== - -.. image:: _static/gunicorn.png - -:Website: http://gunicorn.org -:Source code: https://github.com/benoitc/gunicorn -:Issue tracker: https://github.com/benoitc/gunicorn/issues -:IRC: ``#gunicorn`` on Libera Chat -:Usage questions: https://github.com/benoitc/gunicorn/issues - -Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX. It's a pre-fork -worker model ported from Ruby's Unicorn project. The Gunicorn server is broadly -compatible with various web frameworks, simply implemented, light on server -resources, and fairly speedy. - -Features --------- - -* Natively supports WSGI, Django, and Paster -* Automatic worker process management -* Simple Python configuration -* Multiple worker configurations -* Various server hooks for extensibility -* Compatible with Python 3.x >= 3.10 - - -Contents --------- - -.. toctree:: - :maxdepth: 2 - - install - run - configure - settings - instrumentation - deploy - signals - custom - design - faq - community - news diff --git a/docs/source/install.rst b/docs/source/install.rst deleted file mode 100644 index eb3e9aba3..000000000 --- a/docs/source/install.rst +++ /dev/null @@ -1,172 +0,0 @@ -============ -Installation -============ - -.. highlight:: bash - -:Requirements: **Python 3.x >= 3.10** - -To install the latest released version of Gunicorn:: - - $ pip install gunicorn - -From Source -=========== - -You can install Gunicorn from source just as you would install any other -Python package:: - - $ pip install git+https://github.com/benoitc/gunicorn.git - -This will allow you to keep up to date with development on GitHub:: - - $ pip install -U git+https://github.com/benoitc/gunicorn.git - - -Async Workers -============= - -You may also want to install Eventlet_ or Gevent_ if you expect that your -application code may need to pause for extended periods of time during request -processing. Check out the `design docs`_ for more information on when you'll -want to consider one of the alternate worker types. - -:: - - $ pip install greenlet # Required for both - $ pip install eventlet # For eventlet workers - $ pip install gunicorn[eventlet] # Or, using extra - $ pip install gevent # For gevent workers - $ pip install gunicorn[gevent] # Or, using extra - -.. note:: - Both require ``greenlet``, which should get installed automatically. - If its installation fails, you probably need to install - the Python headers. These headers are available in most package - managers. On Ubuntu the package name for ``apt-get`` is - ``python-dev``. - - Gevent_ also requires that ``libevent`` 1.4.x or 2.0.4 is installed. - This could be a more recent version than what is available in your - package manager. If Gevent_ fails to build even with libevent_ - installed, this is the most likely reason. - - -Extra Packages -============== -Some Gunicorn options require additional packages. You can use the ``[extra]`` -syntax to install these at the same time as Gunicorn. - -Most extra packages are needed for alternate worker types. See the -`design docs`_ for more information on when you'll want to consider an -alternate worker type. - -* ``gunicorn[eventlet]`` - Eventlet-based greenlets workers -* ``gunicorn[gevent]`` - Gevent-based greenlets workers -* ``gunicorn[gthread]`` - Threaded workers -* ``gunicorn[tornado]`` - Tornado-based workers, not recommended - -If you are running more than one instance of Gunicorn, the :ref:`proc-name` -setting will help distinguish between them in tools like ``ps`` and ``top``. - -* ``gunicorn[setproctitle]`` - Enables setting the process name - -Multiple extras can be combined, like -``pip install gunicorn[gevent,setproctitle]``. - -Debian GNU/Linux -================ - -If you are using Debian GNU/Linux it is recommended that you use -system packages to install Gunicorn except maybe when you want to use -different versions of Gunicorn with virtualenv. This has a number of -advantages: - -* Zero-effort installation: Automatically starts multiple Gunicorn instances - based on configurations defined in ``/etc/gunicorn.d``. - -* Sensible default locations for logs (``/var/log/gunicorn``). Logs - can be automatically rotated and compressed using ``logrotate``. - -* Improved security: Can easily run each Gunicorn instance with a dedicated - UNIX user/group. - -* Sensible upgrade path: Upgrades to newer versions result in less downtime, - handle conflicting changes in configuration options, and can be quickly - rolled back in case of incompatibility. The package can also be purged - entirely from the system in seconds. - -stable ("buster") ------------------- - -The version of Gunicorn in the Debian_ "stable" distribution is 19.9.0 -(December 2020). You can install it using:: - - $ sudo apt-get install gunicorn3 - -You can also use the most recent version 20.0.4 (December 2020) by using -`Debian Backports`_. First, copy the following line to your -``/etc/apt/sources.list``:: - - deb http://ftp.debian.org/debian buster-backports main - -Then, update your local package lists:: - - $ sudo apt-get update - -You can then install the latest version using:: - - $ sudo apt-get -t buster-backports install gunicorn - -oldstable ("stretch") ---------------------- - -While Debian releases newer than Stretch will give you gunicorn with Python 3 -support no matter if you install the gunicorn or gunicorn3 package for Stretch -you specifically have to install gunicorn3 to get Python 3 support. - -The version of Gunicorn in the Debian_ "oldstable" distribution is 19.6.0 -(December 2020). You can install it using:: - - $ sudo apt-get install gunicorn3 - -You can also use the most recent version 19.7.1 (December 2020) by using -`Debian Backports`_. First, copy the following line to your -``/etc/apt/sources.list``:: - - deb http://ftp.debian.org/debian stretch-backports main - -Then, update your local package lists:: - - $ sudo apt-get update - -You can then install the latest version using:: - - $ sudo apt-get -t stretch-backports install gunicorn3 - -Testing ("bullseye") / Unstable ("sid") ---------------------------------------- - -"bullseye" and "sid" contain the latest released version of Gunicorn 20.0.4 -(December 2020). You can install it in the usual way:: - - $ sudo apt-get install gunicorn - - -Ubuntu -====== - -Ubuntu_ 20.04 LTS (Focal Fossa) or later contains the Gunicorn package by -default 20.0.4 (December 2020) so that you can install it in the usual way:: - - $ sudo apt-get update - $ sudo apt-get install gunicorn - - -.. _`design docs`: design.html -.. _Eventlet: http://eventlet.net -.. _Gevent: http://www.gevent.org/ -.. _libevent: http://libevent.org/ -.. _Debian: https://www.debian.org/ -.. _`Debian Backports`: https://backports.debian.org/ -.. _Ubuntu: https://www.ubuntu.com/ diff --git a/docs/source/instrumentation.rst b/docs/source/instrumentation.rst deleted file mode 100644 index 60cde4164..000000000 --- a/docs/source/instrumentation.rst +++ /dev/null @@ -1,36 +0,0 @@ -.. _instrumentation: - -=============== -Instrumentation -=============== - -.. versionadded:: 19.1 - -Gunicorn provides an optional instrumentation of the arbiter and -workers using the statsD_ protocol over UDP. Thanks to the -``gunicorn.instrument.statsd`` module, Gunicorn becomes a statsD client. -The use of UDP cleanly isolates Gunicorn from the receiving end of the statsD -metrics so that instrumentation does not cause Gunicorn to be held up by a slow -statsD consumer. - -To use statsD, just tell Gunicorn where the statsD server is: - -.. code-block:: bash - - $ gunicorn --statsd-host=localhost:8125 --statsd-prefix=service.app ... - -The ``Statsd`` logger overrides ``gunicorn.glogging.Logger`` to track -all requests. The following metrics are generated: - -* ``gunicorn.requests``: request rate per second -* ``gunicorn.request.duration``: histogram of request duration (in millisecond) -* ``gunicorn.workers``: number of workers managed by the arbiter (gauge) -* ``gunicorn.log.critical``: rate of critical log messages -* ``gunicorn.log.error``: rate of error log messages -* ``gunicorn.log.warning``: rate of warning log messages -* ``gunicorn.log.exception``: rate of exceptional log messages - -See the statsd-host_ setting for more information. - -.. _statsd-host: settings.html#statsd-host -.. _statsD: https://github.com/etsy/statsd diff --git a/docs/source/news.rst b/docs/source/news.rst deleted file mode 100644 index 2a61fafe3..000000000 --- a/docs/source/news.rst +++ /dev/null @@ -1,83 +0,0 @@ -========= -Changelog -========= - -23.0.0 - 2024-08-10 -=================== - -- minor docs fixes (:pr:`3217`, :pr:`3089`, :pr:`3167`) -- worker_class parameter accepts a class (:pr:`3079`) -- fix deadlock if request terminated during chunked parsing (:pr:`2688`) -- permit receiving Transfer-Encodings: compress, deflate, gzip (:pr:`3261`) -- permit Transfer-Encoding headers specifying multiple encodings. note: no parameters, still (:pr:`3261`) -- sdist generation now explicitly excludes sphinx build folder (:pr:`3257`) -- decode bytes-typed status (as can be passed by gevent) as utf-8 instead of raising `TypeError` (:pr:`2336`) -- raise correct Exception when encounting invalid chunked requests (:pr:`3258`) -- the SCRIPT_NAME and PATH_INFO headers, when received from allowed forwarders, are no longer restricted for containing an underscore (:pr:`3192`) -- include IPv6 loopback address ``[::1]`` in default for :ref:`forwarded-allow-ips` and :ref:`proxy-allow-ips` (:pr:`3192`) - -** NOTE ** - -- The SCRIPT_NAME change mitigates a regression that appeared first in the 22.0.0 release -- Review your :ref:`forwarded-allow-ips` setting if you are still not seeing the SCRIPT_NAME transmitted -- Review your :ref:`forwarder-headers` setting if you are missing headers after upgrading from a version prior to 22.0.0 - -** Breaking changes ** - -- refuse requests where the uri field is empty (:pr:`3255`) -- refuse requests with invalid CR/LR/NUL in heade field values (:pr:`3253`) -- remove temporary ``--tolerate-dangerous-framing`` switch from 22.0 (:pr:`3260`) -- If any of the breaking changes affect you, be aware that now refused requests can post a security problem, especially so in setups involving request pipe-lining and/or proxies. - -22.0.0 - 2024-04-17 -=================== - -- use `utime` to notify workers liveness -- migrate setup to pyproject.toml -- fix numerous security vulnerabilities in HTTP parser (closing some request smuggling vectors) -- parsing additional requests is no longer attempted past unsupported request framing -- on HTTP versions < 1.1 support for chunked transfer is refused (only used in exploits) -- requests conflicting configured or passed SCRIPT_NAME now produce a verbose error -- Trailer fields are no longer inspected for headers indicating secure scheme -- support Python 3.12 - -** Breaking changes ** - -- minimum version is Python 3.7 -- the limitations on valid characters in the HTTP method have been bounded to Internet Standards -- requests specifying unsupported transfer coding (order) are refused by default (rare) -- HTTP methods are no longer casefolded by default (IANA method registry contains none affected) -- HTTP methods containing the number sign (#) are no longer accepted by default (rare) -- HTTP versions < 1.0 or >= 2.0 are no longer accepted by default (rare, only HTTP/1.1 is supported) -- HTTP versions consisting of multiple digits or containing a prefix/suffix are no longer accepted -- HTTP header field names Gunicorn cannot safely map to variables are silently dropped, as in other software -- HTTP headers with empty field name are refused by default (no legitimate use cases, used in exploits) -- requests with both Transfer-Encoding and Content-Length are refused by default (such a message might indicate an attempt to perform request smuggling) -- empty transfer codings are no longer permitted (reportedly seen with really old & broken proxies) - - -** SECURITY ** - -- fix CVE-2024-1135 - -History -======= - -.. toctree:: - :titlesonly: - - 2024-news - 2023-news - 2021-news - 2020-news - 2019-news - 2018-news - 2017-news - 2016-news - 2015-news - 2014-news - 2013-news - 2012-news - 2011-news - 2010-news - diff --git a/docs/source/run.rst b/docs/source/run.rst deleted file mode 100644 index 108956b83..000000000 --- a/docs/source/run.rst +++ /dev/null @@ -1,184 +0,0 @@ -================ -Running Gunicorn -================ - -.. highlight:: bash - -You can run Gunicorn by using commands or integrate with popular frameworks -like Django, Pyramid, or TurboGears. For deploying Gunicorn in production see -:doc:`deploy`. - -Commands -======== - -After installing Gunicorn you will have access to the command line script -``gunicorn``. - -.. _gunicorn-cmd: - -gunicorn --------- - -Basic usage:: - - $ gunicorn [OPTIONS] [WSGI_APP] - -Where ``WSGI_APP`` is of the pattern ``$(MODULE_NAME):$(VARIABLE_NAME)``. The -module name can be a full dotted path. The variable name refers to a WSGI -callable that should be found in the specified module. - -.. versionchanged:: 20.1.0 - ``WSGI_APP`` is optional if it is defined in a :ref:`config` file. - -Example with the test app: - -.. code-block:: python - - def app(environ, start_response): - """Simplest possible application object""" - data = b'Hello, World!\n' - status = '200 OK' - response_headers = [ - ('Content-type', 'text/plain'), - ('Content-Length', str(len(data))) - ] - start_response(status, response_headers) - return iter([data]) - -You can now run the app with the following command: - -.. code-block:: text - - $ gunicorn --workers=2 test:app - -The variable name can also be a function call. In that case the name -will be imported from the module, then called to get the application -object. This is commonly referred to as the "application factory" -pattern. - -.. code-block:: python - - def create_app(): - app = FrameworkApp() - ... - return app - -.. code-block:: text - - $ gunicorn --workers=2 'test:create_app()' - -Positional and keyword arguments can also be passed, but it is -recommended to load configuration from environment variables rather than -the command line. - -Commonly Used Arguments -^^^^^^^^^^^^^^^^^^^^^^^ - -* ``-c CONFIG, --config=CONFIG`` - Specify a config file in the form - ``$(PATH)``, ``file:$(PATH)``, or ``python:$(MODULE_NAME)``. -* ``-b BIND, --bind=BIND`` - Specify a server socket to bind. Server sockets - can be any of ``$(HOST)``, ``$(HOST):$(PORT)``, ``fd://$(FD)``, or - ``unix:$(PATH)``. An IP is a valid ``$(HOST)``. -* ``-w WORKERS, --workers=WORKERS`` - The number of worker processes. This - number should generally be between 2-4 workers per core in the server. - Check the :ref:`faq` for ideas on tuning this parameter. -* ``-k WORKERCLASS, --worker-class=WORKERCLASS`` - The type of worker process - to run. You'll definitely want to read the production page for the - implications of this parameter. You can set this to ``$(NAME)`` - where ``$(NAME)`` is one of ``sync``, ``eventlet``, ``gevent``, - ``tornado``, ``gthread``. - ``sync`` is the default. See the :ref:`worker-class` documentation for more - information. -* ``-n APP_NAME, --name=APP_NAME`` - If setproctitle_ is installed you can - adjust the name of Gunicorn process as they appear in the process system - table (which affects tools like ``ps`` and ``top``). - -Settings can be specified by using environment variable -:ref:`GUNICORN_CMD_ARGS `. - -See :ref:`configuration` and :ref:`settings` for detailed usage. - -.. _setproctitle: https://pypi.python.org/pypi/setproctitle - -Integration -=========== - -Gunicorn also provides integration for Django and Paste Deploy applications. - -Django ------- - -Gunicorn will look for a WSGI callable named ``application`` if not specified. -So for a typical Django project, invoking Gunicorn would look like:: - - $ gunicorn myproject.wsgi - - -.. note:: - - This requires that your project be on the Python path; the simplest way to - ensure that is to run this command from the same directory as your - ``manage.py`` file. - -You can use the -`--env `_ option -to set the path to load the settings. In case you need it you can also -add your application path to ``PYTHONPATH`` using the -`--pythonpath `_ -option:: - - $ gunicorn --env DJANGO_SETTINGS_MODULE=myproject.settings myproject.wsgi - -Paste Deployment ----------------- - -Frameworks such as Pyramid and Turbogears are typically configured using Paste -Deployment configuration files. If you would like to use these files with -Gunicorn, there are two approaches. - -As a server runner, Gunicorn can serve your application using the commands from -your framework, such as ``pserve`` or ``gearbox``. To use Gunicorn with these -commands, specify it as a server in your configuration file: - -.. code-block:: ini - - [server:main] - use = egg:gunicorn#main - host = 127.0.0.1 - port = 8080 - workers = 3 - -This approach is the quickest way to get started with Gunicorn, but there are -some limitations. Gunicorn will have no control over how the application is -loaded, so settings such as reload_ will have no effect and Gunicorn will be -unable to hot upgrade a running application. Using the daemon_ option may -confuse your command line tool. Instead, use the built-in support for these -features provided by that tool. For example, run ``pserve --reload`` instead of -specifying ``reload = True`` in the server configuration block. For advanced -configuration of Gunicorn, such as `Server Hooks`_ specifying a Gunicorn -configuration file using the ``config`` key is supported. - -To use the full power of Gunicorn's reloading and hot code upgrades, use the -`paste option`_ to run your application instead. When used this way, Gunicorn -will use the application defined by the PasteDeploy configuration file, but -Gunicorn will not use any server configuration defined in the file. Instead, -`configure gunicorn`_. - -For example:: - - $ gunicorn --paste development.ini -b :8080 --chdir /path/to/project - -Or use a different application:: - - $ gunicorn --paste development.ini#admin -b :8080 --chdir /path/to/project - -With both approaches, Gunicorn will use any loggers section found in Paste -Deployment configuration file, unless instructed otherwise by specifying -additional `logging settings`_. - -.. _reload: http://docs.gunicorn.org/en/latest/settings.html#reload -.. _daemon: http://docs.gunicorn.org/en/latest/settings.html#daemon -.. _Server Hooks: http://docs.gunicorn.org/en/latest/settings.html#server-hooks -.. _paste option: http://docs.gunicorn.org/en/latest/settings.html#paste -.. _configure gunicorn: http://docs.gunicorn.org/en/latest/configure.html -.. _logging settings: http://docs.gunicorn.org/en/latest/settings.html#logging diff --git a/docs/source/settings.rst b/docs/source/settings.rst deleted file mode 100644 index 046770616..000000000 --- a/docs/source/settings.rst +++ /dev/null @@ -1,1795 +0,0 @@ -.. Please update gunicorn/config.py instead. - -.. _settings: - -Settings -======== - -This is an exhaustive list of settings for Gunicorn. Some settings are only -able to be set from a configuration file. The setting name is what should be -used in the configuration file. The command line arguments are listed as well -for reference on setting at the command line. - -.. note:: - - Settings can be specified by using environment variable - ``GUNICORN_CMD_ARGS``. All available command line arguments can be used. - For example, to specify the bind address and number of workers:: - - $ GUNICORN_CMD_ARGS="--bind=127.0.0.1 --workers=3" gunicorn app:app - - .. versionadded:: 19.7 - -Config File ------------ - -.. _config: - -``config`` -~~~~~~~~~~ - -**Command line:** ``-c CONFIG`` or ``--config CONFIG`` - -**Default:** ``'./gunicorn.conf.py'`` - -:ref:`The Gunicorn config file`. - -A string of the form ``PATH``, ``file:PATH``, or ``python:MODULE_NAME``. - -Only has an effect when specified on the command line or as part of an -application specific configuration. - -By default, a file named ``gunicorn.conf.py`` will be read from the same -directory where gunicorn is being run. - -.. versionchanged:: 19.4 - Loading the config from a Python module requires the ``python:`` - prefix. - -.. _wsgi-app: - -``wsgi_app`` -~~~~~~~~~~~~ - -**Default:** ``None`` - -A WSGI application path in pattern ``$(MODULE_NAME):$(VARIABLE_NAME)``. - -.. versionadded:: 20.1.0 - -Debugging ---------- - -.. _reload: - -``reload`` -~~~~~~~~~~ - -**Command line:** ``--reload`` - -**Default:** ``False`` - -Restart workers when code changes. - -This setting is intended for development. It will cause workers to be -restarted whenever application code changes. - -The reloader is incompatible with application preloading. When using a -paste configuration be sure that the server block does not import any -application code or the reload will not work as designed. - -The default behavior is to attempt inotify with a fallback to file -system polling. Generally, inotify should be preferred if available -because it consumes less system resources. - -.. note:: - In order to use the inotify reloader, you must have the ``inotify`` - package installed. - -.. _reload-engine: - -``reload_engine`` -~~~~~~~~~~~~~~~~~ - -**Command line:** ``--reload-engine STRING`` - -**Default:** ``'auto'`` - -The implementation that should be used to power :ref:`reload`. - -Valid engines are: - -* ``'auto'`` -* ``'poll'`` -* ``'inotify'`` (requires inotify) - -.. versionadded:: 19.7 - -.. _reload-extra-files: - -``reload_extra_files`` -~~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--reload-extra-file FILES`` - -**Default:** ``[]`` - -Extends :ref:`reload` option to also watch and reload on additional files -(e.g., templates, configurations, specifications, etc.). - -.. versionadded:: 19.8 - -.. _spew: - -``spew`` -~~~~~~~~ - -**Command line:** ``--spew`` - -**Default:** ``False`` - -Install a trace function that spews every line executed by the server. - -This is the nuclear option. - -.. _check-config: - -``check_config`` -~~~~~~~~~~~~~~~~ - -**Command line:** ``--check-config`` - -**Default:** ``False`` - -Check the configuration and exit. The exit status is 0 if the -configuration is correct, and 1 if the configuration is incorrect. - -.. _print-config: - -``print_config`` -~~~~~~~~~~~~~~~~ - -**Command line:** ``--print-config`` - -**Default:** ``False`` - -Print the configuration settings as fully resolved. Implies :ref:`check-config`. - -Logging -------- - -.. _accesslog: - -``accesslog`` -~~~~~~~~~~~~~ - -**Command line:** ``--access-logfile FILE`` - -**Default:** ``None`` - -The Access log file to write to. - -``'-'`` means log to stdout. - -.. _disable-redirect-access-to-syslog: - -``disable_redirect_access_to_syslog`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--disable-redirect-access-to-syslog`` - -**Default:** ``False`` - -Disable redirect access logs to syslog. - -.. versionadded:: 19.8 - -.. _access-log-format: - -``access_log_format`` -~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--access-logformat STRING`` - -**Default:** ``'%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"'`` - -The access log format. - -=========== =========== -Identifier Description -=========== =========== -h remote address -l ``'-'`` -u user name (if HTTP Basic auth used) -t date of the request -r status line (e.g. ``GET / HTTP/1.1``) -m request method -U URL path without query string -q query string -H protocol -s status -B response length -b response length or ``'-'`` (CLF format) -f referrer (note: header is ``referer``) -a user agent -T request time in seconds -M request time in milliseconds -D request time in microseconds -L request time in decimal seconds -p process ID -{header}i request header -{header}o response header -{variable}e environment variable -=========== =========== - -Use lowercase for header and environment variable names, and put -``{...}x`` names inside ``%(...)s``. For example:: - - %({x-forwarded-for}i)s - -.. _errorlog: - -``errorlog`` -~~~~~~~~~~~~ - -**Command line:** ``--error-logfile FILE`` or ``--log-file FILE`` - -**Default:** ``'-'`` - -The Error log file to write to. - -Using ``'-'`` for FILE makes gunicorn log to stderr. - -.. versionchanged:: 19.2 - Log to stderr by default. - -.. _loglevel: - -``loglevel`` -~~~~~~~~~~~~ - -**Command line:** ``--log-level LEVEL`` - -**Default:** ``'info'`` - -The granularity of Error log outputs. - -Valid level names are: - -* ``'debug'`` -* ``'info'`` -* ``'warning'`` -* ``'error'`` -* ``'critical'`` - -.. _capture-output: - -``capture_output`` -~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--capture-output`` - -**Default:** ``False`` - -Redirect stdout/stderr to specified file in :ref:`errorlog`. - -.. versionadded:: 19.6 - -.. _logger-class: - -``logger_class`` -~~~~~~~~~~~~~~~~ - -**Command line:** ``--logger-class STRING`` - -**Default:** ``'gunicorn.glogging.Logger'`` - -The logger you want to use to log events in Gunicorn. - -The default class (``gunicorn.glogging.Logger``) handles most -normal usages in logging. It provides error and access logging. - -You can provide your own logger by giving Gunicorn a Python path to a -class that quacks like ``gunicorn.glogging.Logger``. - -.. _logconfig: - -``logconfig`` -~~~~~~~~~~~~~ - -**Command line:** ``--log-config FILE`` - -**Default:** ``None`` - -The log config file to use. -Gunicorn uses the standard Python logging module's Configuration -file format. - -.. _logconfig-dict: - -``logconfig_dict`` -~~~~~~~~~~~~~~~~~~ - -**Default:** ``{}`` - -The log config dictionary to use, using the standard Python -logging module's dictionary configuration format. This option -takes precedence over the :ref:`logconfig` and :ref:`logconfig-json` options, -which uses the older file configuration format and JSON -respectively. - -Format: https://docs.python.org/3/library/logging.config.html#logging.config.dictConfig - -For more context you can look at the default configuration dictionary for logging, -which can be found at ``gunicorn.glogging.CONFIG_DEFAULTS``. - -.. versionadded:: 19.8 - -.. _logconfig-json: - -``logconfig_json`` -~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--log-config-json FILE`` - -**Default:** ``None`` - -The log config to read config from a JSON file - -Format: https://docs.python.org/3/library/logging.config.html#logging.config.jsonConfig - -.. versionadded:: 20.0 - -.. _syslog-addr: - -``syslog_addr`` -~~~~~~~~~~~~~~~ - -**Command line:** ``--log-syslog-to SYSLOG_ADDR`` - -**Default:** ``'unix:///var/run/syslog'`` - -Address to send syslog messages. - -Address is a string of the form: - -* ``unix://PATH#TYPE`` : for unix domain socket. ``TYPE`` can be ``stream`` - for the stream driver or ``dgram`` for the dgram driver. - ``stream`` is the default. -* ``udp://HOST:PORT`` : for UDP sockets -* ``tcp://HOST:PORT`` : for TCP sockets - -.. _syslog: - -``syslog`` -~~~~~~~~~~ - -**Command line:** ``--log-syslog`` - -**Default:** ``False`` - -Send *Gunicorn* logs to syslog. - -.. versionchanged:: 19.8 - You can now disable sending access logs by using the - :ref:`disable-redirect-access-to-syslog` setting. - -.. _syslog-prefix: - -``syslog_prefix`` -~~~~~~~~~~~~~~~~~ - -**Command line:** ``--log-syslog-prefix SYSLOG_PREFIX`` - -**Default:** ``None`` - -Makes Gunicorn use the parameter as program-name in the syslog entries. - -All entries will be prefixed by ``gunicorn.``. By default the -program name is the name of the process. - -.. _syslog-facility: - -``syslog_facility`` -~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--log-syslog-facility SYSLOG_FACILITY`` - -**Default:** ``'user'`` - -Syslog facility name - -.. _enable-stdio-inheritance: - -``enable_stdio_inheritance`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``-R`` or ``--enable-stdio-inheritance`` - -**Default:** ``False`` - -Enable stdio inheritance. - -Enable inheritance for stdio file descriptors in daemon mode. - -Note: To disable the Python stdout buffering, you can to set the user -environment variable ``PYTHONUNBUFFERED`` . - -.. _statsd-host: - -``statsd_host`` -~~~~~~~~~~~~~~~ - -**Command line:** ``--statsd-host STATSD_ADDR`` - -**Default:** ``None`` - -The address of the StatsD server to log to. - -Address is a string of the form: - -* ``unix://PATH`` : for a unix domain socket. -* ``HOST:PORT`` : for a network address - -.. versionadded:: 19.1 - -.. _dogstatsd-tags: - -``dogstatsd_tags`` -~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--dogstatsd-tags DOGSTATSD_TAGS`` - -**Default:** ``''`` - -A comma-delimited list of datadog statsd (dogstatsd) tags to append to -statsd metrics. - -.. versionadded:: 20 - -.. _statsd-prefix: - -``statsd_prefix`` -~~~~~~~~~~~~~~~~~ - -**Command line:** ``--statsd-prefix STATSD_PREFIX`` - -**Default:** ``''`` - -Prefix to use when emitting statsd metrics (a trailing ``.`` is added, -if not provided). - -.. versionadded:: 19.2 - -Process Naming --------------- - -.. _proc-name: - -``proc_name`` -~~~~~~~~~~~~~ - -**Command line:** ``-n STRING`` or ``--name STRING`` - -**Default:** ``None`` - -A base to use with setproctitle for process naming. - -This affects things like ``ps`` and ``top``. If you're going to be -running more than one instance of Gunicorn you'll probably want to set a -name to tell them apart. This requires that you install the setproctitle -module. - -If not set, the *default_proc_name* setting will be used. - -.. _default-proc-name: - -``default_proc_name`` -~~~~~~~~~~~~~~~~~~~~~ - -**Default:** ``'gunicorn'`` - -Internal setting that is adjusted for each type of application. - -SSL ---- - -.. _keyfile: - -``keyfile`` -~~~~~~~~~~~ - -**Command line:** ``--keyfile FILE`` - -**Default:** ``None`` - -SSL key file - -.. _certfile: - -``certfile`` -~~~~~~~~~~~~ - -**Command line:** ``--certfile FILE`` - -**Default:** ``None`` - -SSL certificate file - -.. _ssl-version: - -``ssl_version`` -~~~~~~~~~~~~~~~ - -**Command line:** ``--ssl-version`` - -**Default:** ``<_SSLMethod.PROTOCOL_TLS: 2>`` - -SSL version to use (see stdlib ssl module's). - -.. deprecated:: 21.0 - The option is deprecated and it is currently ignored. Use :ref:`ssl-context` instead. - -============= ============ ---ssl-version Description -============= ============ -SSLv3 SSLv3 is not-secure and is strongly discouraged. -SSLv23 Alias for TLS. Deprecated in Python 3.6, use TLS. -TLS Negotiate highest possible version between client/server. - Can yield SSL. (Python 3.6+) -TLSv1 TLS 1.0 -TLSv1_1 TLS 1.1 (Python 3.4+) -TLSv1_2 TLS 1.2 (Python 3.4+) -TLS_SERVER Auto-negotiate the highest protocol version like TLS, - but only support server-side SSLSocket connections. - (Python 3.6+) -============= ============ - -.. versionchanged:: 19.7 - The default value has been changed from ``ssl.PROTOCOL_TLSv1`` to - ``ssl.PROTOCOL_SSLv23``. -.. versionchanged:: 20.0 - This setting now accepts string names based on ``ssl.PROTOCOL_`` - constants. -.. versionchanged:: 20.0.1 - The default value has been changed from ``ssl.PROTOCOL_SSLv23`` to - ``ssl.PROTOCOL_TLS`` when Python >= 3.6 . - -.. _cert-reqs: - -``cert_reqs`` -~~~~~~~~~~~~~ - -**Command line:** ``--cert-reqs`` - -**Default:** ```` - -Whether client certificate is required (see stdlib ssl module's) - -=========== =========================== ---cert-reqs Description -=========== =========================== -`0` no client verification -`1` ssl.CERT_OPTIONAL -`2` ssl.CERT_REQUIRED -=========== =========================== - -.. _ca-certs: - -``ca_certs`` -~~~~~~~~~~~~ - -**Command line:** ``--ca-certs FILE`` - -**Default:** ``None`` - -CA certificates file - -.. _suppress-ragged-eofs: - -``suppress_ragged_eofs`` -~~~~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--suppress-ragged-eofs`` - -**Default:** ``True`` - -Suppress ragged EOFs (see stdlib ssl module's) - -.. _do-handshake-on-connect: - -``do_handshake_on_connect`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--do-handshake-on-connect`` - -**Default:** ``False`` - -Whether to perform SSL handshake on socket connect (see stdlib ssl module's) - -.. _ciphers: - -``ciphers`` -~~~~~~~~~~~ - -**Command line:** ``--ciphers`` - -**Default:** ``None`` - -SSL Cipher suite to use, in the format of an OpenSSL cipher list. - -By default we use the default cipher list from Python's ``ssl`` module, -which contains ciphers considered strong at the time of each Python -release. - -As a recommended alternative, the Open Web App Security Project (OWASP) -offers `a vetted set of strong cipher strings rated A+ to C- -`_. -OWASP provides details on user-agent compatibility at each security level. - -See the `OpenSSL Cipher List Format Documentation -`_ -for details on the format of an OpenSSL cipher list. - -Security --------- - -.. _limit-request-line: - -``limit_request_line`` -~~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--limit-request-line INT`` - -**Default:** ``4094`` - -The maximum size of HTTP request line in bytes. - -This parameter is used to limit the allowed size of a client's -HTTP request-line. Since the request-line consists of the HTTP -method, URI, and protocol version, this directive places a -restriction on the length of a request-URI allowed for a request -on the server. A server needs this value to be large enough to -hold any of its resource names, including any information that -might be passed in the query part of a GET request. Value is a number -from 0 (unlimited) to 8190. - -This parameter can be used to prevent any DDOS attack. - -.. _limit-request-fields: - -``limit_request_fields`` -~~~~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--limit-request-fields INT`` - -**Default:** ``100`` - -Limit the number of HTTP headers fields in a request. - -This parameter is used to limit the number of headers in a request to -prevent DDOS attack. Used with the *limit_request_field_size* it allows -more safety. By default this value is 100 and can't be larger than -32768. - -.. _limit-request-field-size: - -``limit_request_field_size`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--limit-request-field_size INT`` - -**Default:** ``8190`` - -Limit the allowed size of an HTTP request header field. - -Value is a positive number or 0. Setting it to 0 will allow unlimited -header field sizes. - -.. warning:: - Setting this parameter to a very high or unlimited value can open - up for DDOS attacks. - -Server Hooks ------------- - -.. _on-starting: - -``on_starting`` -~~~~~~~~~~~~~~~ - -**Default:** - -.. code-block:: python - - def on_starting(server): - pass - -Called just before the master process is initialized. - -The callable needs to accept a single instance variable for the Arbiter. - -.. _on-reload: - -``on_reload`` -~~~~~~~~~~~~~ - -**Default:** - -.. code-block:: python - - def on_reload(server): - pass - -Called to recycle workers during a reload via SIGHUP. - -The callable needs to accept a single instance variable for the Arbiter. - -.. _when-ready: - -``when_ready`` -~~~~~~~~~~~~~~ - -**Default:** - -.. code-block:: python - - def when_ready(server): - pass - -Called just after the server is started. - -The callable needs to accept a single instance variable for the Arbiter. - -.. _pre-fork: - -``pre_fork`` -~~~~~~~~~~~~ - -**Default:** - -.. code-block:: python - - def pre_fork(server, worker): - pass - -Called just before a worker is forked. - -The callable needs to accept two instance variables for the Arbiter and -new Worker. - -.. _post-fork: - -``post_fork`` -~~~~~~~~~~~~~ - -**Default:** - -.. code-block:: python - - def post_fork(server, worker): - pass - -Called just after a worker has been forked. - -The callable needs to accept two instance variables for the Arbiter and -new Worker. - -.. _post-worker-init: - -``post_worker_init`` -~~~~~~~~~~~~~~~~~~~~ - -**Default:** - -.. code-block:: python - - def post_worker_init(worker): - pass - -Called just after a worker has initialized the application. - -The callable needs to accept one instance variable for the initialized -Worker. - -.. _worker-int: - -``worker_int`` -~~~~~~~~~~~~~~ - -**Default:** - -.. code-block:: python - - def worker_int(worker): - pass - -Called just after a worker exited on SIGINT or SIGQUIT. - -The callable needs to accept one instance variable for the initialized -Worker. - -.. _worker-abort: - -``worker_abort`` -~~~~~~~~~~~~~~~~ - -**Default:** - -.. code-block:: python - - def worker_abort(worker): - pass - -Called when a worker received the SIGABRT signal. - -This call generally happens on timeout. - -The callable needs to accept one instance variable for the initialized -Worker. - -.. _pre-exec: - -``pre_exec`` -~~~~~~~~~~~~ - -**Default:** - -.. code-block:: python - - def pre_exec(server): - pass - -Called just before a new master process is forked. - -The callable needs to accept a single instance variable for the Arbiter. - -.. _pre-request: - -``pre_request`` -~~~~~~~~~~~~~~~ - -**Default:** - -.. code-block:: python - - def pre_request(worker, req): - worker.log.debug("%s %s", req.method, req.path) - -Called just before a worker processes the request. - -The callable needs to accept two instance variables for the Worker and -the Request. - -.. _post-request: - -``post_request`` -~~~~~~~~~~~~~~~~ - -**Default:** - -.. code-block:: python - - def post_request(worker, req, environ, resp): - pass - -Called after a worker processes the request. - -The callable needs to accept two instance variables for the Worker and -the Request. - -.. _child-exit: - -``child_exit`` -~~~~~~~~~~~~~~ - -**Default:** - -.. code-block:: python - - def child_exit(server, worker): - pass - -Called just after a worker has been exited, in the master process. - -The callable needs to accept two instance variables for the Arbiter and -the just-exited Worker. - -.. versionadded:: 19.7 - -.. _worker-exit: - -``worker_exit`` -~~~~~~~~~~~~~~~ - -**Default:** - -.. code-block:: python - - def worker_exit(server, worker): - pass - -Called just after a worker has been exited, in the worker process. - -The callable needs to accept two instance variables for the Arbiter and -the just-exited Worker. - -.. _nworkers-changed: - -``nworkers_changed`` -~~~~~~~~~~~~~~~~~~~~ - -**Default:** - -.. code-block:: python - - def nworkers_changed(server, new_value, old_value): - pass - -Called just after *num_workers* has been changed. - -The callable needs to accept an instance variable of the Arbiter and -two integers of number of workers after and before change. - -If the number of workers is set for the first time, *old_value* would -be ``None``. - -.. _on-exit: - -``on_exit`` -~~~~~~~~~~~ - -**Default:** - -.. code-block:: python - - def on_exit(server): - pass - -Called just before exiting Gunicorn. - -The callable needs to accept a single instance variable for the Arbiter. - -.. _ssl-context: - -``ssl_context`` -~~~~~~~~~~~~~~~ - -**Default:** - -.. code-block:: python - - def ssl_context(config, default_ssl_context_factory): - return default_ssl_context_factory() - -Called when SSLContext is needed. - -Allows customizing SSL context. - -The callable needs to accept an instance variable for the Config and -a factory function that returns default SSLContext which is initialized -with certificates, private key, cert_reqs, and ciphers according to -config and can be further customized by the callable. -The callable needs to return SSLContext object. - -Following example shows a configuration file that sets the minimum TLS version to 1.3: - -.. code-block:: python - - def ssl_context(conf, default_ssl_context_factory): - import ssl - context = default_ssl_context_factory() - context.minimum_version = ssl.TLSVersion.TLSv1_3 - return context - -.. versionadded:: 21.0 - -Server Mechanics ----------------- - -.. _preload-app: - -``preload_app`` -~~~~~~~~~~~~~~~ - -**Command line:** ``--preload`` - -**Default:** ``False`` - -Load application code before the worker processes are forked. - -By preloading an application you can save some RAM resources as well as -speed up server boot times. Although, if you defer application loading -to each worker process, you can reload your application code easily by -restarting workers. - -.. _sendfile: - -``sendfile`` -~~~~~~~~~~~~ - -**Command line:** ``--no-sendfile`` - -**Default:** ``None`` - -Disables the use of ``sendfile()``. - -If not set, the value of the ``SENDFILE`` environment variable is used -to enable or disable its usage. - -.. versionadded:: 19.2 -.. versionchanged:: 19.4 - Swapped ``--sendfile`` with ``--no-sendfile`` to actually allow - disabling. -.. versionchanged:: 19.6 - added support for the ``SENDFILE`` environment variable - -.. _reuse-port: - -``reuse_port`` -~~~~~~~~~~~~~~ - -**Command line:** ``--reuse-port`` - -**Default:** ``False`` - -Set the ``SO_REUSEPORT`` flag on the listening socket. - -.. versionadded:: 19.8 - -.. _chdir: - -``chdir`` -~~~~~~~~~ - -**Command line:** ``--chdir`` - -**Default:** ``'.'`` - -Change directory to specified directory before loading apps. - -.. _daemon: - -``daemon`` -~~~~~~~~~~ - -**Command line:** ``-D`` or ``--daemon`` - -**Default:** ``False`` - -Daemonize the Gunicorn process. - -Detaches the server from the controlling terminal and enters the -background. - -.. _raw-env: - -``raw_env`` -~~~~~~~~~~~ - -**Command line:** ``-e ENV`` or ``--env ENV`` - -**Default:** ``[]`` - -Set environment variables in the execution environment. - -Should be a list of strings in the ``key=value`` format. - -For example on the command line: - -.. code-block:: console - - $ gunicorn -b 127.0.0.1:8000 --env FOO=1 test:app - -Or in the configuration file: - -.. code-block:: python - - raw_env = ["FOO=1"] - -.. _pidfile: - -``pidfile`` -~~~~~~~~~~~ - -**Command line:** ``-p FILE`` or ``--pid FILE`` - -**Default:** ``None`` - -A filename to use for the PID file. - -If not set, no PID file will be written. - -.. _worker-tmp-dir: - -``worker_tmp_dir`` -~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--worker-tmp-dir DIR`` - -**Default:** ``None`` - -A directory to use for the worker heartbeat temporary file. - -If not set, the default temporary directory will be used. - -.. note:: - The current heartbeat system involves calling ``os.fchmod`` on - temporary file handlers and may block a worker for arbitrary time - if the directory is on a disk-backed filesystem. - - See :ref:`blocking-os-fchmod` for more detailed information - and a solution for avoiding this problem. - -.. _user: - -``user`` -~~~~~~~~ - -**Command line:** ``-u USER`` or ``--user USER`` - -**Default:** ``os.geteuid()`` - -Switch worker processes to run as this user. - -A valid user id (as an integer) or the name of a user that can be -retrieved with a call to ``pwd.getpwnam(value)`` or ``None`` to not -change the worker process user. - -.. _group: - -``group`` -~~~~~~~~~ - -**Command line:** ``-g GROUP`` or ``--group GROUP`` - -**Default:** ``os.getegid()`` - -Switch worker process to run as this group. - -A valid group id (as an integer) or the name of a user that can be -retrieved with a call to ``grp.getgrnam(value)`` or ``None`` to not -change the worker processes group. - -.. _umask: - -``umask`` -~~~~~~~~~ - -**Command line:** ``-m INT`` or ``--umask INT`` - -**Default:** ``0`` - -A bit mask for the file mode on files written by Gunicorn. - -Note that this affects unix socket permissions. - -A valid value for the ``os.umask(mode)`` call or a string compatible -with ``int(value, 0)`` (``0`` means Python guesses the base, so values -like ``0``, ``0xFF``, ``0022`` are valid for decimal, hex, and octal -representations) - -.. _initgroups: - -``initgroups`` -~~~~~~~~~~~~~~ - -**Command line:** ``--initgroups`` - -**Default:** ``False`` - -If true, set the worker process's group access list with all of the -groups of which the specified username is a member, plus the specified -group id. - -.. versionadded:: 19.7 - -.. _tmp-upload-dir: - -``tmp_upload_dir`` -~~~~~~~~~~~~~~~~~~ - -**Default:** ``None`` - -Directory to store temporary request data as they are read. - -This may disappear in the near future. - -This path should be writable by the process permissions set for Gunicorn -workers. If not specified, Gunicorn will choose a system generated -temporary directory. - -.. _secure-scheme-headers: - -``secure_scheme_headers`` -~~~~~~~~~~~~~~~~~~~~~~~~~ - -**Default:** ``{'X-FORWARDED-PROTOCOL': 'ssl', 'X-FORWARDED-PROTO': 'https', 'X-FORWARDED-SSL': 'on'}`` - -A dictionary containing headers and values that the front-end proxy -uses to indicate HTTPS requests. If the source IP is permitted by -:ref:`forwarded-allow-ips` (below), *and* at least one request header matches -a key-value pair listed in this dictionary, then Gunicorn will set -``wsgi.url_scheme`` to ``https``, so your application can tell that the -request is secure. - -If the other headers listed in this dictionary are not present in the request, they will be ignored, -but if the other headers are present and do not match the provided values, then -the request will fail to parse. See the note below for more detailed examples of this behaviour. - -The dictionary should map upper-case header names to exact string -values. The value comparisons are case-sensitive, unlike the header -names, so make sure they're exactly what your front-end proxy sends -when handling HTTPS requests. - -It is important that your front-end proxy configuration ensures that -the headers defined here can not be passed directly from the client. - -.. _forwarded-allow-ips: - -``forwarded_allow_ips`` -~~~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--forwarded-allow-ips STRING`` - -**Default:** ``'127.0.0.1,::1'`` - -Front-end's IPs from which allowed to handle set secure headers. -(comma separated). - -Set to ``*`` to disable checking of front-end IPs. This is useful for setups -where you don't know in advance the IP address of front-end, but -instead have ensured via other means that only your -authorized front-ends can access Gunicorn. - -By default, the value of the ``FORWARDED_ALLOW_IPS`` environment -variable. If it is not defined, the default is ``"127.0.0.1,::1"``. - -.. note:: - - This option does not affect UNIX socket connections. Connections not associated with - an IP address are treated as allowed, unconditionally. - -.. note:: - - The interplay between the request headers, the value of ``forwarded_allow_ips``, and the value of - ``secure_scheme_headers`` is complex. Various scenarios are documented below to further elaborate. - In each case, we have a request from the remote address 134.213.44.18, and the default value of - ``secure_scheme_headers``: - - .. code:: - - secure_scheme_headers = { - 'X-FORWARDED-PROTOCOL': 'ssl', - 'X-FORWARDED-PROTO': 'https', - 'X-FORWARDED-SSL': 'on' - } - - - .. list-table:: - :header-rows: 1 - :align: center - :widths: auto - - * - ``forwarded-allow-ips`` - - Secure Request Headers - - Result - - Explanation - * - .. code:: - - ["127.0.0.1"] - - .. code:: - - X-Forwarded-Proto: https - - .. code:: - - wsgi.url_scheme = "http" - - IP address was not allowed - * - .. code:: - - "*" - - - - .. code:: - - wsgi.url_scheme = "http" - - IP address allowed, but no secure headers provided - * - .. code:: - - "*" - - .. code:: - - X-Forwarded-Proto: https - - .. code:: - - wsgi.url_scheme = "https" - - IP address allowed, one request header matched - * - .. code:: - - ["134.213.44.18"] - - .. code:: - - X-Forwarded-Ssl: on - X-Forwarded-Proto: http - - ``InvalidSchemeHeaders()`` raised - - IP address allowed, but the two secure headers disagreed on if HTTPS was used - -.. _pythonpath: - -``pythonpath`` -~~~~~~~~~~~~~~ - -**Command line:** ``--pythonpath STRING`` - -**Default:** ``None`` - -A comma-separated list of directories to add to the Python path. - -e.g. -``'/home/djangoprojects/myproject,/home/python/mylibrary'``. - -.. _paste: - -``paste`` -~~~~~~~~~ - -**Command line:** ``--paste STRING`` or ``--paster STRING`` - -**Default:** ``None`` - -Load a PasteDeploy config file. The argument may contain a ``#`` -symbol followed by the name of an app section from the config file, -e.g. ``production.ini#admin``. - -At this time, using alternate server blocks is not supported. Use the -command line arguments to control server configuration instead. - -.. _proxy-protocol: - -``proxy_protocol`` -~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--proxy-protocol`` - -**Default:** ``False`` - -Enable detect PROXY protocol (PROXY mode). - -Allow using HTTP and Proxy together. It may be useful for work with -stunnel as HTTPS frontend and Gunicorn as HTTP server. - -PROXY protocol: http://haproxy.1wt.eu/download/1.5/doc/proxy-protocol.txt - -Example for stunnel config:: - - [https] - protocol = proxy - accept = 443 - connect = 80 - cert = /etc/ssl/certs/stunnel.pem - key = /etc/ssl/certs/stunnel.key - -.. _proxy-allow-ips: - -``proxy_allow_ips`` -~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--proxy-allow-from`` - -**Default:** ``'127.0.0.1,::1'`` - -Front-end's IPs from which allowed accept proxy requests (comma separated). - -Set to ``*`` to disable checking of front-end IPs. This is useful for setups -where you don't know in advance the IP address of front-end, but -instead have ensured via other means that only your -authorized front-ends can access Gunicorn. - -.. note:: - - This option does not affect UNIX socket connections. Connections not associated with - an IP address are treated as allowed, unconditionally. - -.. _raw-paste-global-conf: - -``raw_paste_global_conf`` -~~~~~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--paste-global CONF`` - -**Default:** ``[]`` - -Set a PasteDeploy global config variable in ``key=value`` form. - -The option can be specified multiple times. - -The variables are passed to the PasteDeploy entrypoint. Example:: - - $ gunicorn -b 127.0.0.1:8000 --paste development.ini --paste-global FOO=1 --paste-global BAR=2 - -.. versionadded:: 19.7 - -.. _permit-obsolete-folding: - -``permit_obsolete_folding`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--permit-obsolete-folding`` - -**Default:** ``False`` - -Permit requests employing obsolete HTTP line folding mechanism - -The folding mechanism was deprecated by rfc7230 Section 3.2.4 and will not be - employed in HTTP request headers from standards-compliant HTTP clients. - -This option is provided to diagnose backwards-incompatible changes. -Use with care and only if necessary. Temporary; the precise effect of this option may -change in a future version, or it may be removed altogether. - -.. versionadded:: 23.0.0 - -.. _strip-header-spaces: - -``strip_header_spaces`` -~~~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--strip-header-spaces`` - -**Default:** ``False`` - -Strip spaces present between the header name and the the ``:``. - -This is known to induce vulnerabilities and is not compliant with the HTTP/1.1 standard. -See https://portswigger.net/research/http-desync-attacks-request-smuggling-reborn. - -Use with care and only if necessary. Deprecated; scheduled for removal in 25.0.0 - -.. versionadded:: 20.0.1 - -.. _permit-unconventional-http-method: - -``permit_unconventional_http_method`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--permit-unconventional-http-method`` - -**Default:** ``False`` - -Permit HTTP methods not matching conventions, such as IANA registration guidelines - -This permits request methods of length less than 3 or more than 20, -methods with lowercase characters or methods containing the # character. -HTTP methods are case sensitive by definition, and merely uppercase by convention. - -If unset, Gunicorn will apply nonstandard restrictions and cause 400 response status -in cases where otherwise 501 status is expected. While this option does modify that -behaviour, it should not be depended upon to guarantee standards-compliant behaviour. -Rather, it is provided temporarily, to assist in diagnosing backwards-incompatible -changes around the incomplete application of those restrictions. - -Use with care and only if necessary. Temporary; scheduled for removal in 24.0.0 - -.. versionadded:: 22.0.0 - -.. _permit-unconventional-http-version: - -``permit_unconventional_http_version`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--permit-unconventional-http-version`` - -**Default:** ``False`` - -Permit HTTP version not matching conventions of 2023 - -This disables the refusal of likely malformed request lines. -It is unusual to specify HTTP 1 versions other than 1.0 and 1.1. - -This option is provided to diagnose backwards-incompatible changes. -Use with care and only if necessary. Temporary; the precise effect of this option may -change in a future version, or it may be removed altogether. - -.. versionadded:: 22.0.0 - -.. _casefold-http-method: - -``casefold_http_method`` -~~~~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--casefold-http-method`` - -**Default:** ``False`` - -Transform received HTTP methods to uppercase - -HTTP methods are case sensitive by definition, and merely uppercase by convention. - -This option is provided because previous versions of gunicorn defaulted to this behaviour. - -Use with care and only if necessary. Deprecated; scheduled for removal in 24.0.0 - -.. versionadded:: 22.0.0 - -.. _forwarder-headers: - -``forwarder_headers`` -~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--forwarder-headers`` - -**Default:** ``'SCRIPT_NAME,PATH_INFO'`` - -A list containing upper-case header field names that the front-end proxy -(see :ref:`forwarded-allow-ips`) sets, to be used in WSGI environment. - -This option has no effect for headers not present in the request. - -This option can be used to transfer ``SCRIPT_NAME``, ``PATH_INFO`` -and ``REMOTE_USER``. - -It is important that your front-end proxy configuration ensures that -the headers defined here can not be passed directly from the client. - -.. _header-map: - -``header_map`` -~~~~~~~~~~~~~~ - -**Command line:** ``--header-map`` - -**Default:** ``'drop'`` - -Configure how header field names are mapped into environ - -Headers containing underscores are permitted by RFC9110, -but gunicorn joining headers of different names into -the same environment variable will dangerously confuse applications as to which is which. - -The safe default ``drop`` is to silently drop headers that cannot be unambiguously mapped. -The value ``refuse`` will return an error if a request contains *any* such header. -The value ``dangerous`` matches the previous, not advisable, behaviour of mapping different -header field names into the same environ name. - -If the source is permitted as explained in :ref:`forwarded-allow-ips`, *and* the header name is -present in :ref:`forwarder-headers`, the header is mapped into environment regardless of -the state of this setting. - -Use with care and only if necessary and after considering if your problem could -instead be solved by specifically renaming or rewriting only the intended headers -on a proxy in front of Gunicorn. - -.. versionadded:: 22.0.0 - -Server Socket -------------- - -.. _bind: - -``bind`` -~~~~~~~~ - -**Command line:** ``-b ADDRESS`` or ``--bind ADDRESS`` - -**Default:** ``['127.0.0.1:8000']`` - -The socket to bind. - -A string of the form: ``HOST``, ``HOST:PORT``, ``unix:PATH``, -``fd://FD``. An IP is a valid ``HOST``. - -.. versionchanged:: 20.0 - Support for ``fd://FD`` got added. - -Multiple addresses can be bound. ex.:: - - $ gunicorn -b 127.0.0.1:8000 -b [::1]:8000 test:app - -will bind the `test:app` application on localhost both on ipv6 -and ipv4 interfaces. - -If the ``PORT`` environment variable is defined, the default -is ``['0.0.0.0:$PORT']``. If it is not defined, the default -is ``['127.0.0.1:8000']``. - -.. _backlog: - -``backlog`` -~~~~~~~~~~~ - -**Command line:** ``--backlog INT`` - -**Default:** ``2048`` - -The maximum number of pending connections. - -This refers to the number of clients that can be waiting to be served. -Exceeding this number results in the client getting an error when -attempting to connect. It should only affect servers under significant -load. - -Must be a positive integer. Generally set in the 64-2048 range. - -Worker Processes ----------------- - -.. _workers: - -``workers`` -~~~~~~~~~~~ - -**Command line:** ``-w INT`` or ``--workers INT`` - -**Default:** ``1`` - -The number of worker processes for handling requests. - -A positive integer generally in the ``2-4 x $(NUM_CORES)`` range. -You'll want to vary this a bit to find the best for your particular -application's work load. - -By default, the value of the ``WEB_CONCURRENCY`` environment variable, -which is set by some Platform-as-a-Service providers such as Heroku. If -it is not defined, the default is ``1``. - -.. _worker-class: - -``worker_class`` -~~~~~~~~~~~~~~~~ - -**Command line:** ``-k STRING`` or ``--worker-class STRING`` - -**Default:** ``'sync'`` - -The type of workers to use. - -The default class (``sync``) should handle most "normal" types of -workloads. You'll want to read :doc:`design` for information on when -you might want to choose one of the other worker classes. Required -libraries may be installed using setuptools' ``extras_require`` feature. - -A string referring to one of the following bundled classes: - -* ``sync`` -* ``eventlet`` - Requires eventlet >= 0.24.1 (or install it via - ``pip install gunicorn[eventlet]``) -* ``gevent`` - Requires gevent >= 1.4 (or install it via - ``pip install gunicorn[gevent]``) -* ``tornado`` - Requires tornado >= 0.2 (or install it via - ``pip install gunicorn[tornado]``) -* ``gthread`` - Python 2 requires the futures package to be installed - (or install it via ``pip install gunicorn[gthread]``) - -Optionally, you can provide your own worker by giving Gunicorn a -Python path to a subclass of ``gunicorn.workers.base.Worker``. -This alternative syntax will load the gevent class: -``gunicorn.workers.ggevent.GeventWorker``. - -.. _threads: - -``threads`` -~~~~~~~~~~~ - -**Command line:** ``--threads INT`` - -**Default:** ``1`` - -The number of worker threads for handling requests. - -Run each worker with the specified number of threads. - -A positive integer generally in the ``2-4 x $(NUM_CORES)`` range. -You'll want to vary this a bit to find the best for your particular -application's work load. - -If it is not defined, the default is ``1``. - -This setting only affects the Gthread worker type. - -.. note:: - If you try to use the ``sync`` worker type and set the ``threads`` - setting to more than 1, the ``gthread`` worker type will be used - instead. - -.. _worker-connections: - -``worker_connections`` -~~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--worker-connections INT`` - -**Default:** ``1000`` - -The maximum number of simultaneous clients. - -This setting only affects the ``gthread``, ``eventlet`` and ``gevent`` worker types. - -.. _max-requests: - -``max_requests`` -~~~~~~~~~~~~~~~~ - -**Command line:** ``--max-requests INT`` - -**Default:** ``0`` - -The maximum number of requests a worker will process before restarting. - -Any value greater than zero will limit the number of requests a worker -will process before automatically restarting. This is a simple method -to help limit the damage of memory leaks. - -If this is set to zero (the default) then the automatic worker -restarts are disabled. - -.. _max-requests-jitter: - -``max_requests_jitter`` -~~~~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--max-requests-jitter INT`` - -**Default:** ``0`` - -The maximum jitter to add to the *max_requests* setting. - -The jitter causes the restart per worker to be randomized by -``randint(0, max_requests_jitter)``. This is intended to stagger worker -restarts to avoid all workers restarting at the same time. - -.. versionadded:: 19.2 - -.. _timeout: - -``timeout`` -~~~~~~~~~~~ - -**Command line:** ``-t INT`` or ``--timeout INT`` - -**Default:** ``30`` - -Workers silent for more than this many seconds are killed and restarted. - -Value is a positive number or 0. Setting it to 0 has the effect of -infinite timeouts by disabling timeouts for all workers entirely. - -Generally, the default of thirty seconds should suffice. Only set this -noticeably higher if you're sure of the repercussions for sync workers. -For the non sync workers it just means that the worker process is still -communicating and is not tied to the length of time required to handle a -single request. - -.. _graceful-timeout: - -``graceful_timeout`` -~~~~~~~~~~~~~~~~~~~~ - -**Command line:** ``--graceful-timeout INT`` - -**Default:** ``30`` - -Timeout for graceful workers restart in seconds. - -After receiving a restart signal, workers have this much time to finish -serving requests. Workers still alive after the timeout (starting from -the receipt of the restart signal) are force killed. - -.. _keepalive: - -``keepalive`` -~~~~~~~~~~~~~ - -**Command line:** ``--keep-alive INT`` - -**Default:** ``2`` - -The number of seconds to wait for requests on a Keep-Alive connection. - -Generally set in the 1-5 seconds range for servers with direct connection -to the client (e.g. when you don't have separate load balancer). When -Gunicorn is deployed behind a load balancer, it often makes sense to -set this to a higher value. - -.. note:: - ``sync`` worker does not support persistent connections and will - ignore this option. - diff --git a/docs/source/signals.rst b/docs/source/signals.rst deleted file mode 100644 index c22ea0362..000000000 --- a/docs/source/signals.rst +++ /dev/null @@ -1,119 +0,0 @@ -.. _signals: - -=============== -Signal Handling -=============== - -A brief description of the signals handled by Gunicorn. We also document the -signals used internally by Gunicorn to communicate with the workers. - -Master process -============== - -- ``QUIT``, ``INT``: Quick shutdown -- ``TERM``: Graceful shutdown. Waits for workers to finish their - current requests up to the :ref:`graceful-timeout`. -- ``HUP``: Reload the configuration, start the new worker processes with a new - configuration and gracefully shutdown older workers. If the application is - not preloaded (using the :ref:`preload-app` option), Gunicorn will also load - the new version of it. -- ``TTIN``: Increment the number of processes by one -- ``TTOU``: Decrement the number of processes by one -- ``USR1``: Reopen the log files -- ``USR2``: Upgrade Gunicorn on the fly. A separate ``TERM`` signal should - be used to kill the old master process. This signal can also be used to use - the new versions of pre-loaded applications. See :ref:`binary-upgrade` for - more information. -- ``WINCH``: Gracefully shutdown the worker processes when Gunicorn is - daemonized. - -Worker process -============== - -Sending signals directly to the worker processes should not normally be -needed. If the master process is running, any exited worker will be -automatically respawned. - -- ``QUIT``, ``INT``: Quick shutdown -- ``TERM``: Graceful shutdown -- ``USR1``: Reopen the log files - -Reload the configuration -======================== - -The ``HUP`` signal can be used to reload the Gunicorn configuration on the -fly. - -:: - - 2013-06-29 06:26:55 [20682] [INFO] Handling signal: hup - 2013-06-29 06:26:55 [20682] [INFO] Hang up: Master - 2013-06-29 06:26:55 [20703] [INFO] Booting worker with pid: 20703 - 2013-06-29 06:26:55 [20702] [INFO] Booting worker with pid: 20702 - 2013-06-29 06:26:55 [20688] [INFO] Worker exiting (pid: 20688) - 2013-06-29 06:26:55 [20687] [INFO] Worker exiting (pid: 20687) - 2013-06-29 06:26:55 [20689] [INFO] Worker exiting (pid: 20689) - 2013-06-29 06:26:55 [20704] [INFO] Booting worker with pid: 20704 - - -Sending a ``HUP`` signal will reload the configuration, start the new -worker processes with a new configuration and gracefully shutdown older -workers. If the application is not preloaded (using the :ref:`preload-app` -option), Gunicorn will also load the new version of it. - -.. _binary-upgrade: - -Upgrading to a new binary on the fly -==================================== - -.. versionchanged:: 19.6.0 - PID file naming format has been changed from ``.pid.oldbin`` to - ``.pid.2``. - -If you need to replace the Gunicorn binary with a new one (when -upgrading to a new version or adding/removing server modules), you can -do it without any service downtime - no incoming requests will be -lost. Preloaded applications will also be reloaded. - -First, replace the old binary with a new one, then send a ``USR2`` signal to -the current master process. It executes a new binary whose PID file is -postfixed with ``.2`` (e.g. ``/var/run/gunicorn.pid.2``), -which in turn starts a new master process and new worker processes:: - - PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND - 20844 benoitc 20 0 54808 11m 3352 S 0.0 0.1 0:00.36 gunicorn: master [test:app] - 20849 benoitc 20 0 54808 9.9m 1500 S 0.0 0.1 0:00.02 gunicorn: worker [test:app] - 20850 benoitc 20 0 54808 9.9m 1500 S 0.0 0.1 0:00.01 gunicorn: worker [test:app] - 20851 benoitc 20 0 54808 9.9m 1500 S 0.0 0.1 0:00.01 gunicorn: worker [test:app] - 20854 benoitc 20 0 55748 12m 3348 S 0.0 0.2 0:00.35 gunicorn: master [test:app] - 20859 benoitc 20 0 55748 11m 1500 S 0.0 0.1 0:00.01 gunicorn: worker [test:app] - 20860 benoitc 20 0 55748 11m 1500 S 0.0 0.1 0:00.00 gunicorn: worker [test:app] - 20861 benoitc 20 0 55748 11m 1500 S 0.0 0.1 0:00.01 gunicorn: worker [test:app] - -At this point, two instances of Gunicorn are running, handling the -incoming requests together. To phase the old instance out, you have to -send a ``WINCH`` signal to the old master process, and its worker -processes will start to gracefully shut down. - -At this point you can still revert to the old process since it hasn't closed -its listen sockets yet, by following these steps: - -- Send a ``HUP`` signal to the old master process - it will start the worker - processes without reloading a configuration file -- Send a ``TERM`` signal to the new master process to gracefully shut down its - worker processes -- Send a ``QUIT`` signal to the new master process to force it quit - -If for some reason the new worker processes do not quit, send a ``KILL`` signal -to them after the new master process quits, and everything will back to exactly -as before the upgrade attempt. - -If the update is successful and you want to keep the new master process, send a -``TERM`` signal to the old master process to leave only the new server -running:: - - PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND - 20854 benoitc 20 0 55748 12m 3348 S 0.0 0.2 0:00.45 gunicorn: master [test:app] - 20859 benoitc 20 0 55748 11m 1500 S 0.0 0.1 0:00.02 gunicorn: worker [test:app] - 20860 benoitc 20 0 55748 11m 1500 S 0.0 0.1 0:00.02 gunicorn: worker [test:app] - 20861 benoitc 20 0 55748 11m 1500 S 0.0 0.1 0:00.01 gunicorn: worker [test:app] diff --git a/gunicorn/__init__.py b/gunicorn/__init__.py index cdcd1352e..347557ce8 100644 --- a/gunicorn/__init__.py +++ b/gunicorn/__init__.py @@ -2,7 +2,7 @@ # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. -version_info = (23, 0, 0) +version_info = (24, 0, 0) __version__ = ".".join([str(v) for v in version_info]) SERVER = "gunicorn" SERVER_SOFTWARE = "%s/%s" % (SERVER, __version__) From 19a2efec638eb19aeb1a686a06eff168a406d230 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Mon, 6 Oct 2025 17:41:59 +0200 Subject: [PATCH 036/356] Migrate docs build to MkDocs --- .github/workflows/docs.yml | 72 ++ .gitignore | 2 + Makefile | 8 +- benchmarks/baseline.json | 8 + benchmarks/quick_bench.sh | 40 + benchmarks/run_benchmark.py | 238 +++++ benchmarks/simple_app.py | 18 + docs/README.rst | 29 + docs/content/2010-news.md | 190 ++++ docs/content/2011-news.md | 66 ++ docs/content/2012-news.md | 117 ++ docs/content/2013-news.md | 83 ++ docs/content/2014-news.md | 202 ++++ docs/content/2015-news.md | 187 ++++ docs/content/2016-news.md | 79 ++ docs/content/2017-news.md | 42 + docs/content/2018-news.md | 64 ++ docs/content/2019-news.md | 112 ++ docs/content/2020-news.md | 7 + docs/content/2021-news.md | 51 + docs/content/2023-news.md | 36 + docs/content/2024-news.md | 58 + docs/content/assets/gunicorn.svg | 119 +++ docs/content/community.md | 40 + docs/content/configure.md | 78 ++ docs/content/custom.md | 62 ++ docs/content/deploy.md | 322 ++++++ docs/content/design.md | 83 ++ docs/content/faq.md | 160 +++ docs/content/index.md | 68 ++ docs/content/install.md | 142 +++ docs/content/instrumentation.md | 32 + docs/content/news.md | 75 ++ docs/content/reference/settings.md | 1605 ++++++++++++++++++++++++++++ docs/content/run.md | 154 +++ docs/content/signals.md | 97 ++ docs/content/styles/overrides.css | 192 ++++ docs/macros.py | 11 + docs/modernization-plan.md | 35 + mkdocs.yml | 94 ++ requirements_dev.txt | 7 +- scripts/build_settings_doc.py | 254 +++++ uv.lock | 643 +++++++++++ 43 files changed, 5979 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/docs.yml create mode 100644 benchmarks/baseline.json create mode 100755 benchmarks/quick_bench.sh create mode 100755 benchmarks/run_benchmark.py create mode 100644 benchmarks/simple_app.py create mode 100644 docs/README.rst create mode 100644 docs/content/2010-news.md create mode 100644 docs/content/2011-news.md create mode 100644 docs/content/2012-news.md create mode 100644 docs/content/2013-news.md create mode 100644 docs/content/2014-news.md create mode 100644 docs/content/2015-news.md create mode 100644 docs/content/2016-news.md create mode 100644 docs/content/2017-news.md create mode 100644 docs/content/2018-news.md create mode 100644 docs/content/2019-news.md create mode 100644 docs/content/2020-news.md create mode 100644 docs/content/2021-news.md create mode 100644 docs/content/2023-news.md create mode 100644 docs/content/2024-news.md create mode 100644 docs/content/assets/gunicorn.svg create mode 100644 docs/content/community.md create mode 100644 docs/content/configure.md create mode 100644 docs/content/custom.md create mode 100644 docs/content/deploy.md create mode 100644 docs/content/design.md create mode 100644 docs/content/faq.md create mode 100644 docs/content/index.md create mode 100644 docs/content/install.md create mode 100644 docs/content/instrumentation.md create mode 100644 docs/content/news.md create mode 100644 docs/content/reference/settings.md create mode 100644 docs/content/run.md create mode 100644 docs/content/signals.md create mode 100644 docs/content/styles/overrides.css create mode 100644 docs/macros.py create mode 100644 docs/modernization-plan.md create mode 100644 mkdocs.yml create mode 100644 scripts/build_settings_doc.py create mode 100644 uv.lock diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000..65098c18a --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,72 @@ +name: Docs + +on: + push: + branches: [ main ] + paths: + - 'docs/**' + - 'mkdocs.yml' + - 'requirements_dev.txt' + - '.github/workflows/docs.yml' + pull_request: + paths: + - 'docs/**' + - 'mkdocs.yml' + - 'requirements_dev.txt' + - '.github/workflows/docs.yml' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements_dev.txt + + - name: Build documentation + run: mkdocs build + + - name: Upload site artifact + uses: actions/upload-artifact@v4 + with: + name: gunicorn-site + path: site + retention-days: 7 + + deploy: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements_dev.txt + + - name: Build documentation + run: mkdocs build + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: site + publish_branch: gh-pages + commit_message: "docs: deploy {sha}" diff --git a/.gitignore b/.gitignore index 581094b7f..74eecc706 100755 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ examples/frameworks/pylonstest/pylonstest.egg-info/ MANIFEST nohup.out setuptools-* +site/ +docs/site/ diff --git a/Makefile b/Makefile index 3641cd5ab..2c7d8bc25 100644 --- a/Makefile +++ b/Makefile @@ -9,9 +9,15 @@ test: coverage: venv/bin/python setup.py test --cov +docs: + mkdocs build + +docs-serve: + mkdocs serve + clean: @rm -rf .Python MANIFEST build dist venv* *.egg-info *.egg @find . -type f -name "*.py[co]" -delete @find . -type d -name "__pycache__" -delete -.PHONY: build clean coverage test +.PHONY: build clean coverage docs docs-serve test diff --git a/benchmarks/baseline.json b/benchmarks/baseline.json new file mode 100644 index 000000000..aeea15ddb --- /dev/null +++ b/benchmarks/baseline.json @@ -0,0 +1,8 @@ +{ + "gthread": { + "simple": {}, + "simple_high_concurrency": {}, + "slow_io": {}, + "large_response": {} + } +} \ No newline at end of file diff --git a/benchmarks/quick_bench.sh b/benchmarks/quick_bench.sh new file mode 100755 index 000000000..fb93f0568 --- /dev/null +++ b/benchmarks/quick_bench.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Quick benchmark for gthread worker + +set -e + +cd "$(dirname "$0")" + +echo "Starting gunicorn with gthread worker..." +../.venv/bin/python -m gunicorn \ + --worker-class gthread \ + --workers 2 \ + --threads 4 \ + --worker-connections 1000 \ + --bind 127.0.0.1:8765 \ + --access-logfile /dev/null \ + --error-logfile /dev/null \ + --log-level warning \ + simple_app:application & + +GUNICORN_PID=$! +sleep 3 + +echo "" +echo "=== Benchmark: Simple requests (10000 requests, 100 concurrent) ===" +ab -n 10000 -c 100 -k http://127.0.0.1:8765/ 2>&1 | grep -E "(Requests per second|Time per request|Failed requests)" + +echo "" +echo "=== Benchmark: High concurrency (5000 requests, 500 concurrent) ===" +ab -n 5000 -c 500 -k http://127.0.0.1:8765/ 2>&1 | grep -E "(Requests per second|Time per request|Failed requests)" + +echo "" +echo "=== Benchmark: Large response (1000 requests, 50 concurrent) ===" +ab -n 1000 -c 50 -k http://127.0.0.1:8765/large 2>&1 | grep -E "(Requests per second|Time per request|Failed requests)" + +echo "" +echo "Stopping gunicorn..." +kill $GUNICORN_PID 2>/dev/null || true +wait $GUNICORN_PID 2>/dev/null || true + +echo "Done!" diff --git a/benchmarks/run_benchmark.py b/benchmarks/run_benchmark.py new file mode 100755 index 000000000..a5b662a13 --- /dev/null +++ b/benchmarks/run_benchmark.py @@ -0,0 +1,238 @@ +#!/usr/bin/env python3 +""" +Benchmark script for gunicorn gthread worker. + +This script runs various benchmarks against gunicorn and reports performance metrics. +Requires: gunicorn, requests (for warmup), and wrk or ab for load testing. +""" + +import argparse +import json +import os +import signal +import subprocess +import sys +import time +from pathlib import Path + + +BENCHMARK_DIR = Path(__file__).parent +APP_MODULE = "simple_app:application" + + +def check_dependencies(): + """Check if required tools are available.""" + # Check for wrk (preferred) or ab + for tool in ['wrk', 'ab']: + try: + subprocess.run([tool, '--version'], capture_output=True, check=False) + return tool + except FileNotFoundError: + continue + print("Error: Neither 'wrk' nor 'ab' found. Install one of them.") + print(" macOS: brew install wrk") + print(" Linux: apt-get install wrk (or apache2-utils for ab)") + sys.exit(1) + + +def start_gunicorn(worker_class, workers, threads, connections, bind, extra_args=None): + """Start gunicorn server and return the process.""" + cmd = [ + sys.executable, '-m', 'gunicorn', + '--worker-class', worker_class, + '--workers', str(workers), + '--threads', str(threads), + '--worker-connections', str(connections), + '--bind', bind, + '--access-logfile', '-', + '--error-logfile', '-', + '--log-level', 'warning', + APP_MODULE, + ] + if extra_args: + cmd.extend(extra_args) + + env = os.environ.copy() + env['PYTHONPATH'] = str(BENCHMARK_DIR.parent) + + proc = subprocess.Popen( + cmd, + cwd=BENCHMARK_DIR, + env=env, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + + # Wait for server to be ready + time.sleep(2) + return proc + + +def stop_gunicorn(proc): + """Stop the gunicorn server.""" + proc.send_signal(signal.SIGTERM) + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + proc.wait() + + +def run_wrk_benchmark(url, duration, threads, connections): + """Run wrk benchmark and return results.""" + cmd = [ + 'wrk', + '-t', str(threads), + '-c', str(connections), + '-d', f'{duration}s', + '--latency', + url, + ] + result = subprocess.run(cmd, capture_output=True, text=True, check=False) + return parse_wrk_output(result.stdout) + + +def run_ab_benchmark(url, requests, concurrency): + """Run Apache Bench benchmark and return results.""" + cmd = [ + 'ab', + '-n', str(requests), + '-c', str(concurrency), + '-k', # keepalive + url, + ] + result = subprocess.run(cmd, capture_output=True, text=True, check=False) + return parse_ab_output(result.stdout) + + +def parse_wrk_output(output): + """Parse wrk output to extract metrics.""" + metrics = {} + for line in output.split('\n'): + if 'Requests/sec' in line: + metrics['requests_per_sec'] = float(line.split(':')[1].strip()) + elif 'Transfer/sec' in line: + metrics['transfer_per_sec'] = line.split(':')[1].strip() + elif 'Latency' in line and 'Distribution' not in line: + parts = line.split() + if len(parts) >= 2: + metrics['latency_avg'] = parts[1] + elif '50%' in line: + metrics['latency_p50'] = line.split()[1] + elif '99%' in line: + metrics['latency_p99'] = line.split()[1] + return metrics + + +def parse_ab_output(output): + """Parse ab output to extract metrics.""" + metrics = {} + for line in output.split('\n'): + if 'Requests per second' in line: + metrics['requests_per_sec'] = float(line.split(':')[1].split()[0]) + elif 'Time per request' in line and 'mean' in line: + metrics['latency_avg'] = line.split(':')[1].strip() + elif 'Transfer rate' in line: + metrics['transfer_per_sec'] = line.split(':')[1].strip() + return metrics + + +def run_benchmark_suite(tool, bind_addr): + """Run a suite of benchmarks.""" + results = {} + + # Test configurations + configs = [ + {'name': 'simple', 'path': '/', 'connections': 100}, + {'name': 'simple_high_concurrency', 'path': '/', 'connections': 500}, + {'name': 'slow_io', 'path': '/slow', 'connections': 50}, + {'name': 'large_response', 'path': '/large', 'connections': 100}, + ] + + for config in configs: + url = f'http://{bind_addr}{config["path"]}' + print(f" Running {config['name']}...") + + if tool == 'wrk': + metrics = run_wrk_benchmark( + url, + duration=10, + threads=4, + connections=config['connections'], + ) + else: + metrics = run_ab_benchmark( + url, + requests=10000, + concurrency=config['connections'], + ) + + results[config['name']] = metrics + print(f" Requests/sec: {metrics.get('requests_per_sec', 'N/A')}") + + return results + + +def main(): + parser = argparse.ArgumentParser(description='Benchmark gunicorn gthread worker') + parser.add_argument('--workers', type=int, default=2, help='Number of workers') + parser.add_argument('--threads', type=int, default=4, help='Threads per worker') + parser.add_argument('--connections', type=int, default=1000, help='Worker connections') + parser.add_argument('--bind', default='127.0.0.1:8000', help='Bind address') + parser.add_argument('--compare', action='store_true', help='Compare sync vs gthread') + parser.add_argument('--output', help='Output JSON file for results') + args = parser.parse_args() + + tool = check_dependencies() + print(f"Using benchmark tool: {tool}") + + all_results = {} + + if args.compare: + # Compare sync and gthread workers + for worker_class in ['sync', 'gthread']: + print(f"\nBenchmarking {worker_class} worker...") + proc = start_gunicorn( + worker_class=worker_class, + workers=args.workers, + threads=args.threads, + connections=args.connections, + bind=args.bind, + ) + try: + all_results[worker_class] = run_benchmark_suite(tool, args.bind) + finally: + stop_gunicorn(proc) + else: + # Just benchmark gthread + print("\nBenchmarking gthread worker...") + proc = start_gunicorn( + worker_class='gthread', + workers=args.workers, + threads=args.threads, + connections=args.connections, + bind=args.bind, + ) + try: + all_results['gthread'] = run_benchmark_suite(tool, args.bind) + finally: + stop_gunicorn(proc) + + # Print summary + print("\n" + "=" * 60) + print("BENCHMARK SUMMARY") + print("=" * 60) + for worker, results in all_results.items(): + print(f"\n{worker.upper()} Worker:") + for test, metrics in results.items(): + rps = metrics.get('requests_per_sec', 'N/A') + print(f" {test}: {rps} req/s") + + if args.output: + with open(args.output, 'w') as f: + json.dump(all_results, f, indent=2) + print(f"\nResults saved to {args.output}") + + +if __name__ == '__main__': + main() diff --git a/benchmarks/simple_app.py b/benchmarks/simple_app.py new file mode 100644 index 000000000..982f589d1 --- /dev/null +++ b/benchmarks/simple_app.py @@ -0,0 +1,18 @@ +# Simple WSGI app for benchmarking + +def application(environ, start_response): + """Basic hello world response.""" + path = environ.get('PATH_INFO', '/') + + if path == '/large': + body = b'X' * 65536 # 64KB + else: + body = b'Hello, World!' + + status = '200 OK' + headers = [ + ('Content-Type', 'text/plain'), + ('Content-Length', str(len(body))), + ] + start_response(status, headers) + return [body] diff --git a/docs/README.rst b/docs/README.rst new file mode 100644 index 000000000..6ce90ba95 --- /dev/null +++ b/docs/README.rst @@ -0,0 +1,29 @@ +Generate Documentation +====================== + +Requirements +------------ + +Install the documentation dependencies with:: + + pip install -r requirements_dev.txt + +This provides MkDocs with the Material theme and supporting plugins. + + +Build static HTML +----------------- +:: + + mkdocs build + +The rendered site is emitted into the ``site/`` directory. + + +Preview locally +--------------- +:: + + mkdocs serve + +This serves the documentation at http://127.0.0.1:8000/ with live reload. diff --git a/docs/content/2010-news.md b/docs/content/2010-news.md new file mode 100644 index 000000000..19e2816c1 --- /dev/null +++ b/docs/content/2010-news.md @@ -0,0 +1,190 @@ + +# Changelog - 2010 + +## 0.12.0 / 2010-12-22 + +- Add support for logging configuration using a ini file. + It uses the standard Python logging's module Configuration + file format and allows anyone to use his custom file handler +- Add IPV6 support +- Add multidomain application example +- Improve gunicorn_django command when importing settings module + using DJANGO_SETTINGS_MODULE environment variable +- Send appropriate error status on http parsing +- Fix pidfile, set permissions so other user can read + it and use it. +- Fix temporary file leaking +- Fix setpgrp issue, can now be launched via ubuntu upstart +- Set the number of workers to zero on WINCH + +## 0.11.2 / 2010-10-30 + +* Add SERVER_SOFTWARE to the os.environ +* Add support for django settings environment variable +* Add support for logging configuration in Paster ini-files +* Improve arbiter notification in asynchronous workers +* Display the right error when a worker can't be used +* Fix Django support +* Fix HUP with Paster applications +* Fix readline in wsgi.input + +## 0.11.1 / 2010-09-02 + +* Implement max-requests feature to prevent memory leaks. +* Added 'worker_exit' server hook. +* Reseed the random number generator after fork(). +* Improve Eventlet worker. +* Fix Django command `run_gunicorn`. +* Fix the default proc name internal setting. +* Workaround to prevent Gevent worker to segfault on MacOSX. + +## 0.11.0 / 2010-08-12 + +* Improve dramatically performances of Gevent and Eventlet workers +* Optimize HTTP parsing +* Drop Server and Date headers in start_response when provided. +* Fix latency issue in async workers + +## 0.10.1 / 2010-08-06 + +* Improve gevent's workers. Add "egg:gunicorn#gevent_wsgi" worker using + `gevent.wsgi `_ and + "egg:gunicorn#gevent_pywsgi" worker using `gevent.pywsgi + `_ . + **"egg:gunicorn#gevent"** using our own HTTP parser is still here and + is **recommended** for normal uses. Use the "gevent.wsgi" parser if you + need really fast connections and don't need streaming, keepalive or ssl. +* Add pre/post request hooks +* Exit more quietly +* Fix gevent dns issue + +## 0.10.0 / 2010-07-08 + +* New HTTP parser. +* New HUP behaviour. Re-reads the configuration and then reloads all + worker processes without changing the master process id. Helpful for + code reloading and monitoring applications like supervisord and runit. +* Added a preload configuration parameter. By default, application code + is now loaded after a worker forks. This couple with the new HUP + handling can be used for dev servers to do hot code reloading. Using + the preload flag can help a bit in small memory VM's. +* Allow people to pass command line arguments to WSGI applications. See: + `examples/alt_spec.py + `_ +* Added an example gevent reloader configuration: + `examples/example_gevent_reloader.py + `_. +* New gevent worker "egg:gunicorn#gevent2", working with gevent.wsgi. +* Internal refactoring and various bug fixes. +* New documentation website. + +## 0.9.1 / 2010-05-26 + +* Support https via X-Forwarded-Protocol or X-Forwarded-Ssl headers +* Fix configuration +* Remove -d options which was used instead of -D for daemon. +* Fix umask in unix socket + +## 0.9.0 / 2010-05-24 + +* Added *when_ready* hook. Called just after the server is started +* Added *preload* setting. Load application code before the worker processes + are forked. +* Refactored Config +* Fix pidfile +* Fix QUIT/HUP in async workers +* Fix reexec +* Documentation improvements + +## 0.8.1 / 2010-04-29 + +* Fix builtins import in config +* Fix installation with pip +* Fix Tornado WSGI support +* Delay application loading until after processing all configuration + +## 0.8.0 / 2010-04-22 + +* Refactored Worker management for better async support. Now use the -k option + to set the type of request processing to use +* Added support for Tornado_ + +## 0.7.2 / 2010-04-15 + +* Added --spew option to help debugging (installs a system trace hook) +* Some fixes in async arbiters +* Fix a bug in start_response on error + +## 0.7.1 / 2010-04-01 + +* Fix bug when responses have no body. + +## 0.7.0 / 2010-03-26 + +* Added support for Eventlet_ and Gevent_ based workers. +* Added Websockets_ support +* Fix Chunked Encoding +* Fix SIGWINCH on OpenBSD_ +* Fix `PEP 333`_ compliance for the write callable. + +## 0.6.5 / 2010-03-11 + +* Fix pidfile handling +* Fix Exception Error + +## 0.6.4 / 2010-03-08 + +* Use cStringIO for performance when possible. +* Fix worker freeze when a remote connection closes unexpectedly. + +## 0.6.3 / 2010-03-07 + +* Make HTTP parsing faster. +* Various bug fixes + +## 0.6.2 / 2010-03-01 + +* Added support for chunked response. +* Added proc_name option to the config file. +* Improved the HTTP parser. It now uses buffers instead of strings to store + temporary data. +* Improved performance when sending responses. +* Workers are now murdered by age (the oldest is killed first). + +## 0.6.1 / 2010-02-24 + +* Added gunicorn config file support for Django admin command +* Fix gunicorn config file. -c was broken. +* Removed TTIN/TTOU from workers which blocked other signals. + +## 0.6.0 / 2010-02-22 + +* Added setproctitle support +* Change privilege switch behavior. We now work like NGINX, master keeps the + permissions, new uid/gid permissions are only set for workers. + +## 0.5.1 / 2010-02-22 + +* Fix umask +* Added Debian packaging + +## 0.5.0 / 2010-02-20 + +* Added `configuration file `_ handler. +* Added support for pre/post fork hooks +* Added support for before_exec hook +* Added support for unix sockets +* Added launch of workers processes under different user/group +* Added umask option +* Added SCRIPT_NAME support +* Better support of some exotic settings for Django projects +* Better support of Paste-compatible applications +* Some refactoring to make the code easier to hack +* Allow multiple keys in request and response headers + +.. _Tornado: http://www.tornadoweb.org/ +.. _`PEP 333`: https://www.python.org/dev/peps/pep-0333/ +.. _Eventlet: http://eventlet.net/ +.. _Gevent: http://www.gevent.org/ +.. _OpenBSD: https://www.openbsd.org/ +.. _Websockets: https://html.spec.whatwg.org/multipage/web-sockets.html diff --git a/docs/content/2011-news.md b/docs/content/2011-news.md new file mode 100644 index 000000000..87de3ef83 --- /dev/null +++ b/docs/content/2011-news.md @@ -0,0 +1,66 @@ + +# Changelog - 2011 + +## 0.13.4 / 2011-09-23 + +- fix util.closerange function used to prevent leaking fds on python 2.5 + (typo.md) + +## 0.13.3 / 2011-09-19 +- refactor gevent worker +- prevent leaking fds on reexec +- fix inverted request_time computation + +## 0.13.2 / 2011-09-17 + +- Add support for Tornado 2.0 in tornado worker +- Improve access logs: allows customisation of the log format & add + request time +- Logger module is now pluggable +- Improve graceful shutdown in Python versions >= 2.6 +- Fix post_request root arity for compatibility +- Fix sendfile support +- Fix Django reloading + +## 0.13.1 / 2011-08-22 + +- Fix unix socket. log argument was missing. + +## 0.13.0 / 2011-08-22 + +- Improve logging: allows file-reopening and add access log file + compatible with the `apache combined log format `_ +- Add the possibility to set custom SSL headers. X-Forwarded-Protocol + and X-Forwarded-SSL are still the default +- New `on_reload` hook to customize how gunicorn spawn new workers on + SIGHUP +- Handle projects with relative path in django_gunicorn command +- Preserve path parameters in PATH_INFO +- post_request hook now accepts the environ as argument. +- When stopping the arbiter, close the listener asap. +- Fix Django command `run_gunicorn` in settings reloading +- Fix Tornado_ worker exiting +- Fix the use of sendfile in wsgi.file_wrapper + + +## 0.12.2 / 2011-05-18 + +- Add wsgi.file_wrapper optimised for FreeBSD, Linux & MacOSX (use + sendfile if available) +- Fix django run_gunicorn command. Make sure we reload the application + code. +- Fix django localisation +- Compatible with gevent 0.14dev + +## 0.12.1 / 2011-03-23 + +- Add "on_starting" hook. This hook can be used to set anything before + the arbiter really start +- Support bdist_rpm in setup +- Improve content-length handling (pep 3333) +- Improve Django support +- Fix daemonizing (#142) +- Fix ipv6 handling + + +.. _Tornado: http://www.tornadoweb.org/ diff --git a/docs/content/2012-news.md b/docs/content/2012-news.md new file mode 100644 index 000000000..7d3380467 --- /dev/null +++ b/docs/content/2012-news.md @@ -0,0 +1,117 @@ + +# Changelog - 2012 + +## 0.17.0 / 2012-12-25 + +- allows gunicorn to bind to multiple address +- add SSL support +- add syslog support +- add nworkers_changed hook +- add response arg for post_request hook +- parse command line with argparse (replace deprecated optparse) +- fix PWD detection in arbiter +- miscellaneous PEP8 fixes + +## 0.16.1 / 2012-11-19 + +- Fix packaging + +## 0.16.0 / 2012-11-19 + +- **Added support for Python 3.2 & 3.3** +- Expose --pythonpath command to all gunicorn commands +- Honor $PORT environment variable, useful for deployment on heroku +- Removed support for Python 2.5 +- Make sure we reopen the logs on the console +- Fix django settings module detection from path +- Reverted timeout for client socket. Fix issue on blocking issues. +- Fixed gevent worker + +## 0.15.0 / 2012-10-18 + +- new documentation site on http://docs.gunicorn.org +- new website on http://gunicorn.org +- add `haproxy PROXY protocol `_ support +- add ForwardedAllowIPS option: allows to filter Front-end's IPs + allowed to handle X-Forwarded-* headers. +- add callable hooks for paster config +- add x-forwarded-proto as secure scheme default (Heroku is using this) +- allows gunicorn to load a pre-compiled application +- support file reopening & reexec for all loggers +- initialize the logging config file with defaults. +- set timeout for client socket (slow client DoS). +- NoMoreData, ChunkMissingTerminator, InvalidChunkSize are now + IOError exceptions +- fix graceful shutdown in gevent +- fix limit request line check + +## 0.14.6 / 2012-07-26 + + +- fix gevent & subproces +- fix request line length check +- fix keepalive = 0 +- fix tornado worker + +## 0.14.5 / 2012-06-24 + +- fix logging during daemonisation + +## 0.14.4 / 2012-06-24 + +- new --graceful-timeout option +- fix multiple issues with request limit +- more fixes in django settings resolutions +- fix gevent.core import +- fix keepalive=0 in eventlet worker +- fix handle_error display with the unix worker +- fix tornado.wsgi.WSGIApplication calling error + +- **breaking change**: take the control on graceful reload back. + graceful can't be overridden anymore using the on_reload function. + +## 0.14.3 / 2012-05-15 + +- improvement: performance of http.body.Body.readline() +- improvement: log HTTP errors in access log like Apache +- improvement: display traceback when the worker fails to boot +- improvement: makes gunicorn work with gevent 1.0 +- examples: websocket example now supports hybi13 +- fix: reopen log files after initialization +- fix: websockets support +- fix: django1.4 support +- fix: only load the paster application 1 time + +## 0.14.2 / 2012-03-16 + +- add validate_class validator: allows to use a class or a method to + initialize the app during in-code configuration +- add support for max_requests in tornado worker +- add support for disabling x_forwarded_for_header in tornado worker +- gevent_wsgi is now an alias of gevent_pywsgi +- Fix gevent_pywsgi worker + +## 0.14.1 / 2012-03-02 + +- fixing source archive, reducing its size + +## 0.14.0 / 2012-02-27 + +- check if Request line is too large: You can now pass the parameter + ``--limit-request-line`` or set the ``limit_request_line`` in your + configuration file to set the max size of the request line in bytes. +- limit the number of headers fields and their size. Add + ``--limit-request-field`` and ``limit-request-field-size`` settings +- add ``p`` variable to the log access format to log pidfile +- add ``{HeaderName}o`` variable to the logo access format to log the + response header HeaderName +- request header is now logged with the variable ``{HeaderName}i`` in the + access log file +- improve error logging +- support logging.configFile +- support django 1.4 in both gunicorn_django & run_gunicorn command +- improve reload in django run_gunicorn command (should just work now) +- allows people to set the ``X-Forwarded-For`` header key and disable it by + setting an empty string. +- fix support of Tornado +- many other fixes. diff --git a/docs/content/2013-news.md b/docs/content/2013-news.md new file mode 100644 index 000000000..117ca7d1c --- /dev/null +++ b/docs/content/2013-news.md @@ -0,0 +1,83 @@ + +# Changelog - 2013 + +## 18.0 / 2013-08-26 + +- new: add ``-e/--env`` command line argument to pass an environment variables to + gunicorn +- new: add ``--chdir`` command line argument to specified directory + before apps loading. - new: add wsgi.file_wrapper support in async workers +- new: add ``--paste`` command line argument to set the paster config file +- deprecated: the command ``gunicorn_django`` is now deprecated. You should now + run your application with the WSGI interface installed with your project (see + https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/gunicorn/) for + more infos. +- deprecated: the command ``gunicorn_paste`` is deprecated. You now should use + the new ``--paste`` argument to set the configuration file of your paster + application. +- fix: Removes unmatched leading quote from the beginning of the default access + log format string +- fix: null timeout +- fix: gevent worker +- fix: don't reload the paster app when using pserve +- fix: after closing for error do not keep alive the connection +- fix: responses 1xx, 204 and 304 should not force the connection to be closed + +## 17.5 / 2013-07-03 + +- new: add signals documentation +- new: add post_worker_init hook for workers +- new: try to use gunicorn.conf.py in current folder as the default + config file. +- fix graceful timeout with the Eventlet worker +- fix: don't raise an error when closing the socket if already closed +- fix: fix --settings parameter for django application and try to find + the django settings when using the ``gunicorn`` command. +- fix: give the initial global_conf to paster application +- fix: fix 'Expect: 100-continue' support on Python 3 + +### New versioning: + +With this release, the versioning of Gunicorn is changing. Gunicorn is +stable since a long time and there is no point to release a "1.0" now. +It should have been done since a long time. 0.17 really meant it was the +17th stable version. From the beginning we have only 2 kind of +releases: + +major release: releases with major changes or huge features added +services releases: fixes and minor features added So from now we will +apply the following versioning ``.``. For example ``17.5`` is a +service release. + +## 0.17.4 / 2013-04-24 + +- fix unix socket address parsing + +## 0.17.3 / 2013-04-23 + +- add systemd sockets support +- add ``python -m gunicorn.app.wsgiapp`` support +- improve logger class inheritance +- exit when the config file isn't found +- add the -R option to enable stdio inheritance in daemon mode +- don't close file descriptors > 3 in daemon mode +- improve STDOUT/STDERR logging +- fix pythonpath option +- fix pidfile creation on Python 3 +- fix gevent worker exit +- fix ipv6 detection when the platform isn't supporting it + +## 0.17.2 / 2013-01-07 + +- optimize readline +- make imports errors more visible when loading an app or a logging + class +- fix tornado worker: don't pass ssl options if there are none +- fix PEP3333: accept only bytetrings in the response body +- fix support on CYGWIN platforms + +## 0.17.1 / 2013-01-05 + +- add syslog facility name setting +- fix ``--version`` command line argument +- fix wsgi url_scheme for https diff --git a/docs/content/2014-news.md b/docs/content/2014-news.md new file mode 100644 index 000000000..ed1937c2b --- /dev/null +++ b/docs/content/2014-news.md @@ -0,0 +1,202 @@ + +# Changelog - 2014 + +!!! note + Please see [news](news.md) for the latest changes. + + +## 19.1.1 / 2014-08-16 + +### Changes + +### Core + +- fix [Issue #835](https://github.com/benoitc/gunicorn/issues/835): display correct pid of already running instance +- fix [PR #833](https://github.com/benoitc/gunicorn/pull/833): fix `PyTest` class in setup.py. + + +### Logging + +- fix [Issue #838](https://github.com/benoitc/gunicorn/issues/838): statsd logger, send statsd timing metrics in milliseconds +- fix [Issue #839](https://github.com/benoitc/gunicorn/issues/839): statsd logger, allows for empty log message while pushing + metrics and restore worker number in DEBUG logs +- fix [Issue #850](https://github.com/benoitc/gunicorn/issues/850): add timezone to logging +- fix [Issue #853](https://github.com/benoitc/gunicorn/issues/853): Respect logger_class setting unless statsd is on + +### AioHttp worker + +- fix [Issue #830](https://github.com/benoitc/gunicorn/issues/830) make sure gaiohttp worker is shipped with gunicorn. + +## 19.1 / 2014-07-26 + +### Changes + +### Core + +- fix [Issue #785](https://github.com/benoitc/gunicorn/issues/785): handle binary type address given to a client socket address +- fix graceful shutdown. make sure QUIT and TERMS signals are switched everywhere. +- [Issue #799](https://github.com/benoitc/gunicorn/issues/799): fix support loading config from module +- [Issue #805](https://github.com/benoitc/gunicorn/issues/805): fix check for file-like objects +- fix [Issue #815](https://github.com/benoitc/gunicorn/issues/815): args validation in WSGIApplication.init +- fix [Issue #787](https://github.com/benoitc/gunicorn/issues/787): check if we load a pyc file or not. + + +### Tornado worker + +- fix [Issue #771](https://github.com/benoitc/gunicorn/issues/771): support tornado 4.0 +- fix [Issue #783](https://github.com/benoitc/gunicorn/issues/783): x_headers error. The x-forwarded-headers option has been removed + in `c4873681299212d6082cd9902740eef18c2f14f1 + `_. + The discussion is available on [PR #633](https://github.com/benoitc/gunicorn/pull/633). + + +### AioHttp worker + +- fix: fetch all body in input. fix [Issue #803](https://github.com/benoitc/gunicorn/issues/803) +- fix: don't install the worker if python < 3.3 +- fix [Issue #822](https://github.com/benoitc/gunicorn/issues/822): Support UNIX sockets in gaiohttp worker + + +### Async worker + +- fix [Issue #790](https://github.com/benoitc/gunicorn/issues/790): StopIteration shouldn't be caught at this level. + + +### Logging + +- add statsd logging handler fix [Issue #748](https://github.com/benoitc/gunicorn/issues/748) + + +### Paster + +- fix [Issue #809](https://github.com/benoitc/gunicorn/issues/809): Set global logging configuration from a Paste config. + + +### Extra + +- fix RuntimeError in gunicorn.reloader ([Issue #807](https://github.com/benoitc/gunicorn/issues/807)) + + +### Documentation + +- update faq: put a note on how `watch logs in the console + `_ + since many people asked for it. + + +## 19.0 / 2014-06-12 + +Gunicorn 19.0 is a major release with new features and fixes. This +version improve a lot the usage of Gunicorn with python 3 by adding `two +new workers `_ +to it: `gthread` a fully threaded async worker using futures and `gaiohttp` a +worker using asyncio. + + +### Breaking Changes + +### Switch QUIT and TERM signals + +With this change, when gunicorn receives a QUIT all the workers are +killed immediately and exit and TERM is used for the graceful shutdown. + +Note: the old behaviour was based on the NGINX but the new one is more +correct according the following doc: + +https://www.gnu.org/software/libc/manual/html_node/Termination-Signals.html + +also it is complying with the way the signals are sent by heroku: + +https://devcenter.heroku.com/articles/python-faq#what-constraints-exist-when-developing-applications-on-heroku + +### Deprecations + +`run_gunicorn`, `gunicorn_django` and `gunicorn_paster` are now +completely deprecated and will be removed in the next release. Use the +`gunicorn` command instead. + + +### Changes + +### core + +- add aiohttp worker named `gaiohttp` using asyncio. Full async worker + on python 3. +- fix HTTP-violating excess whitespace in write_error output +- fix: try to log what happened in the worker after a timeout, add a + `worker_abort` hook on SIGABRT signal. +- fix: save listener socket name in workers so we can handle buffered + keep-alive requests after the listener has closed. +- add on_exit hook called just before exiting gunicorn. +- add support for python 3.4 +- fix: do not swallow unexpected errors when reaping +- fix: remove incompatible SSL option with python 2.6 +- add new async gthread worker and `--threads` options allows to set multiple + threads to listen on connection +- deprecate `gunicorn_django` and `gunicorn_paster` +- switch QUIT and TERM signal +- reap workers in SIGCHLD handler +- add universal wheel support +- use `email.utils.formatdate` in gunicorn.util.http_date +- deprecate the `--debug` option +- fix: log exceptions that occur after response start … +- allows loading of applications from `.pyc` files (#693) +- fix: issue #691, raw_env config file parsing +- use a dynamic timeout to wait for the optimal time. (Reduce power + usage) +- fix python3 support when notifying the arbiter +- add: honor $WEB_CONCURRENCY environment variable. Useful for heroku + setups. +- add: include tz offset in access log +- add: include access logs in the syslog handler. +- add --reload option for code reloading +- add the capability to load `gunicorn.base.Application` without the loading of + the arguments of the command line. It allows you to [embed gunicorn in your own application](custom.md). +- improve: set wsgi.multithread to True for async workers +- fix logging: make sure to redirect wsgi.errors when needed +- add: syslog logging can now be done to a unix socket +- fix logging: don't try to redirect stdout/stderr to the logfile. +- fix logging: don't propagate log +- improve logging: file option can be overridden by the gunicorn options + `--error-logfile` and `--access-logfile` if they are given. +- fix: don't override SERVER_* by the Host header +- fix: handle_error +- add more option to configure SSL +- fix: sendfile with SSL +- add: worker_int callback (to react on SIGTERM) +- fix: don't depend on entry point for internal classes, now absolute + modules path can be given. +- fix: Error messages are now encoded in latin1 +- fix: request line length check +- improvement: proxy_allow_ips: Allow proxy protocol if "*" specified +- fix: run worker's `setup` method before setting num_workers +- fix: FileWrapper inherit from `object` now +- fix: Error messages are now encoded in latin1 +- fix: don't spam the console on SIGWINCH. +- fix: logging -don't stringify T and D logging atoms (#621) +- add support for the latest django version +- deprecate `run_gunicorn` django option +- fix: sys imported twice + + +### gevent worker + +- fix: make sure to stop all listeners +- fix: monkey patching is now done in the worker +- fix: "global name 'hub' is not defined" +- fix: reinit `hub` on old versions of gevent +- support gevent 1.0 +- fix: add subprocess in monkey patching +- fix: add support for multiple listener + + +### eventlet worker + +- fix: merge duplicate EventletWorker.init_process method (fixes #657) +- fix: missing errno import for eventlet sendfile patch +- fix: add support for multiple listener + + +### tornado worker + +- add graceful stop support diff --git a/docs/content/2015-news.md b/docs/content/2015-news.md new file mode 100644 index 000000000..0cec6d1fa --- /dev/null +++ b/docs/content/2015-news.md @@ -0,0 +1,187 @@ + +# Changelog - 2015 + +!!! note + Please see [news](news.md) for the latest changes. + + +## 19.4.3 / 2015/12/30 + +- fix: don't check if a file is writable using os.stat with SELINUX ([Issue #1171](https://github.com/benoitc/gunicorn/issues/1171)) + +## 19.4.2 / 2015/12/29 + +### Core + +- improvement: handle HaltServer in manage_workers ([Issue #1095](https://github.com/benoitc/gunicorn/issues/1095)) +- fix: Do not rely on sendfile sending requested count ([Issue #1155](https://github.com/benoitc/gunicorn/issues/1155)) +- fix: claridy --no-sendfile default ([Issue #1156](https://github.com/benoitc/gunicorn/issues/1156)) +- fix: LoggingCatch sendfile failure from no file descriptor ([Issue #1160](https://github.com/benoitc/gunicorn/issues/1160)) + +### Logging + +- fix: Always send access log to syslog if syslog is on +- fix: check auth before trying to own a file ([Issue #1157](https://github.com/benoitc/gunicorn/issues/1157)) + + +### Documentation + +- fix: Fix Slowloris broken link. ([Issue #1142](https://github.com/benoitc/gunicorn/issues/1142)) +- Tweak markup in faq.rst + +### Testing + +- fix: gaiohttp test ([Issue #1164](https://github.com/benoitc/gunicorn/issues/1164)) + +## 19.4.1 / 2015/11/25 + +- fix tornado worker ([Issue #1154](https://github.com/benoitc/gunicorn/issues/1154)) + +## 19.4.0 / 2015/11/20 + +### Core + +- fix: make sure that a user is able to access to the logs after dropping a + privilege ([Issue #1116](https://github.com/benoitc/gunicorn/issues/1116)) +- improvement: inherit the `Exception` class where it needs to be ([Issue #997](https://github.com/benoitc/gunicorn/issues/997)) +- fix: make sure headers are always encoded as latin1 RFC 2616 ([Issue #1102](https://github.com/benoitc/gunicorn/issues/1102)) +- improvement: reduce arbiter noise ([Issue #1078](https://github.com/benoitc/gunicorn/issues/1078)) +- fix: don't close the unix socket when the worker exit ([Issue #1088](https://github.com/benoitc/gunicorn/issues/1088)) +- improvement: Make last logged worker count an explicit instance var ([Issue #1078](https://github.com/benoitc/gunicorn/issues/1078)) +- improvement: prefix config file with its type ([Issue #836](https://github.com/benoitc/gunicorn/issues/836)) +- improvement: pidfile handing ([Issue #1042](https://github.com/benoitc/gunicorn/issues/1042)) +- fix: catch OSError as well as ValueError on race condition ([Issue #1052](https://github.com/benoitc/gunicorn/issues/1052)) +- improve support of ipv6 by backporting urlparse.urlsplit from Python 2.7 to + Python 2.6. +- fix: raise InvalidRequestLine when the line contains malicious data + ([Issue #1023](https://github.com/benoitc/gunicorn/issues/1023)) +- fix: fix argument to disable sendfile +- fix: add gthread to the list of supported workers ([Issue #1011](https://github.com/benoitc/gunicorn/issues/1011)) +- improvement: retry socket binding up to five times upon EADDRNOTAVAIL + ([Issue #1004](https://github.com/benoitc/gunicorn/issues/1004)) +- **breaking change**: only honor headers that can be encoded in ascii to comply to + the RFC 7230 (See [Issue #1151](https://github.com/benoitc/gunicorn/issues/1151)). + +### Logging + +- add new parameters to access log ([Issue #1132](https://github.com/benoitc/gunicorn/issues/1132)) +- fix: make sure that files handles are correctly reopened on HUP + ([Issue #627](https://github.com/benoitc/gunicorn/issues/627)) +- include request URL in error message ([Issue #1071](https://github.com/benoitc/gunicorn/issues/1071)) +- get username in access logs ([Issue #1069](https://github.com/benoitc/gunicorn/issues/1069)) +- fix statsd logging support on Python 3 ([Issue #1010](https://github.com/benoitc/gunicorn/issues/1010)) + +### Testing + +- use last version of mock. +- many fixes in Travis CI support +- miscellaneous improvements in tests + +### Thread worker + +- fix: Fix self.nr usage in ThreadedWorker so that auto restart works as + expected ([Issue #1031](https://github.com/benoitc/gunicorn/issues/1031)) + +### Gevent worker + +- fix quit signal handling ([Issue #1128](https://github.com/benoitc/gunicorn/issues/1128)) +- add support for Python 3 ([Issue #1066](https://github.com/benoitc/gunicorn/issues/1066)) +- fix: make graceful shutdown thread-safe ([Issue #1032](https://github.com/benoitc/gunicorn/issues/1032)) + +### Tornado worker + +- fix ssl options ([Issue #1146](https://github.com/benoitc/gunicorn/issues/1146), [Issue #1135](https://github.com/benoitc/gunicorn/issues/1135)) +- don't check timeout when stopping gracefully ([Issue #1106](https://github.com/benoitc/gunicorn/issues/1106)) + +### AIOHttp worker + +- add SSL support ([Issue #1105](https://github.com/benoitc/gunicorn/issues/1105)) + +### Documentation + +- fix link to proc name setting ([Issue #1144](https://github.com/benoitc/gunicorn/issues/1144)) +- fix worker class documentation ([Issue #1141](https://github.com/benoitc/gunicorn/issues/1141), [Issue #1104](https://github.com/benoitc/gunicorn/issues/1104)) +- clarify graceful timeout documentation ([Issue #1137](https://github.com/benoitc/gunicorn/issues/1137)) +- don't duplicate NGINX config files examples ([Issue #1050](https://github.com/benoitc/gunicorn/issues/1050), [Issue #1048](https://github.com/benoitc/gunicorn/issues/1048)) +- add `web.py` framework example ([Issue #1117](https://github.com/benoitc/gunicorn/issues/1117)) +- update Debian/Ubuntu installations instructions ([Issue #1112](https://github.com/benoitc/gunicorn/issues/1112)) +- clarify `pythonpath` setting description ([Issue #1080](https://github.com/benoitc/gunicorn/issues/1080)) +- tweak some example for python3 +- clarify `sendfile` documentation +- miscellaneous typos in source code comments (thanks!) +- clarify why REMOTE_ADD may not be the user's IP address ([Issue #1037](https://github.com/benoitc/gunicorn/issues/1037)) + + +### Misc + +- fix: reloader should survive SyntaxError ([Issue #994](https://github.com/benoitc/gunicorn/issues/994)) +- fix: expose the reloader class to the worker. + + + +## 19.3.0 / 2015/03/06 + +### Core + +- fix: [Issue #978](https://github.com/benoitc/gunicorn/issues/978) make sure a listener is inheritable +- add `check_config` class method to workers +- fix: [Issue #983](https://github.com/benoitc/gunicorn/issues/983) fix select timeout in sync worker with multiple + connections +- allows workers to access to the reloader. close [Issue #984](https://github.com/benoitc/gunicorn/issues/984) +- raise TypeError instead of AssertionError + +### Logging + +- make Logger.loglevel a class attribute + +### Documentation + +- fix: [Issue #988](https://github.com/benoitc/gunicorn/issues/988) fix syntax errors in examples/gunicorn_rc + + +## 19.2.1 / 2015/02/4 + +### Logging + +- expose loglevel in the Logger class + +### AsyncIO worker (gaiohttp.md) + +- fix [Issue #977](https://github.com/benoitc/gunicorn/issues/977) fix initial crash + +### Documentation + +- document security mailing-list in the contributing page. + +## 19.2 / 2015/01/30 + +### Core + +- optimize the sync workers when listening on a single interface +- add `--sendfile` settings to enable/disable sendfile. fix [Issue #856](https://github.com/benoitc/gunicorn/issues/856) . +- add the selectors module to the code base. [Issue #886](https://github.com/benoitc/gunicorn/issues/886) +- add `--max-requests-jitter` setting to set the maximum jitter to add to the + max-requests setting. +- fix [Issue #899](https://github.com/benoitc/gunicorn/issues/899) propagate proxy_protocol_info to keep-alive requests +- fix [Issue #863](https://github.com/benoitc/gunicorn/issues/863) worker timeout: dynamic timeout has been removed +- fix: Avoid world writable file + +### Logging + +- fix [Issue #941](https://github.com/benoitc/gunicorn/issues/941) set logconfig default to paster more trivially +- add statsd-prefix config setting: set the prefix to use when emitting statsd + metrics +- [Issue #832](https://github.com/benoitc/gunicorn/issues/832) log to console by default + +### Thread Worker + +- fix [Issue #908](https://github.com/benoitc/gunicorn/issues/908) make sure the worker can continue to accept requests + +### Eventlet Worker + +- fix [Issue #867](https://github.com/benoitc/gunicorn/issues/867) Fix eventlet shutdown to actively shut down the workers. + +### Documentation + +Many improvements and fixes have been done, see the detailed changelog for +more information. diff --git a/docs/content/2016-news.md b/docs/content/2016-news.md new file mode 100644 index 000000000..299713faf --- /dev/null +++ b/docs/content/2016-news.md @@ -0,0 +1,79 @@ + +# Changelog - 2016 + +!!! note + Please see [news](news.md) for the latest changes + + +## 19.6.0 / 2016/05/21 + +### Core & Logging + +- improvement of the binary upgrade behaviour using USR2: remove file locking ([Issue #1270](https://github.com/benoitc/gunicorn/issues/1270)) +- add the ``--capture-output`` setting to capture stdout/stderr tot the log + file ([Issue #1271](https://github.com/benoitc/gunicorn/issues/1271)) +- Allow disabling ``sendfile()`` via the ``SENDFILE`` environment variable + ([Issue #1252](https://github.com/benoitc/gunicorn/issues/1252)) +- fix reload under pycharm ([Issue #1129](https://github.com/benoitc/gunicorn/issues/1129)) + +### Workers + +- fix: make sure to remove the signal from the worker pipe ([Issue #1269](https://github.com/benoitc/gunicorn/issues/1269)) +- fix: **gthread** worker, handle removed socket in the select loop + ([Issue #1258](https://github.com/benoitc/gunicorn/issues/1258)) + +## 19.5.0 / 2016/05/10 + +### Core + +- fix: Ensure response to HEAD request won't have message body +- fix: lock domain socket and remove on last arbiter exit ([Issue #1220](https://github.com/benoitc/gunicorn/issues/1220)) +- improvement: use EnvironmentError instead of socket.error ([Issue #939](https://github.com/benoitc/gunicorn/issues/939)) +- add: new ``FORWARDED_ALLOW_IPS`` environment variable ([Issue #1205](https://github.com/benoitc/gunicorn/issues/1205)) +- fix: infinite recursion when destroying sockets ([Issue #1219](https://github.com/benoitc/gunicorn/issues/1219)) +- fix: close sockets on shutdown ([Issue #922](https://github.com/benoitc/gunicorn/issues/922)) +- fix: clean up sys.exc_info calls to drop circular refs ([Issue #1228](https://github.com/benoitc/gunicorn/issues/1228)) +- fix: do post_worker_init after load_wsgi ([Issue #1248](https://github.com/benoitc/gunicorn/issues/1248)) + +### Workers + +- fix access logging in gaiohttp worker ([Issue #1193](https://github.com/benoitc/gunicorn/issues/1193)) +- eventlet: handle QUIT in a new coroutine ([Issue #1217](https://github.com/benoitc/gunicorn/issues/1217)) +- gevent: remove obsolete exception clauses in run ([Issue #1218](https://github.com/benoitc/gunicorn/issues/1218)) +- tornado: fix extra "Server" response header ([Issue #1246](https://github.com/benoitc/gunicorn/issues/1246)) +- fix: unblock the wait loop under python 3.5 in sync worker ([Issue #1256](https://github.com/benoitc/gunicorn/issues/1256)) + +### Logging + +- fix: log message for listener reloading ([Issue #1181](https://github.com/benoitc/gunicorn/issues/1181)) +- Let logging module handle traceback printing ([Issue #1201](https://github.com/benoitc/gunicorn/issues/1201)) +- improvement: Allow configuring logger_class with statsd_host ([Issue #1188](https://github.com/benoitc/gunicorn/issues/1188)) +- fix: traceback formatting ([Issue #1235](https://github.com/benoitc/gunicorn/issues/1235)) +- fix: print error logs on stderr and access logs on stdout ([Issue #1184](https://github.com/benoitc/gunicorn/issues/1184)) + + +### Documentation + +- Simplify installation instructions in gunicorn.org ([Issue #1072](https://github.com/benoitc/gunicorn/issues/1072)) +- Fix URL and default worker type in example_config ([Issue #1209](https://github.com/benoitc/gunicorn/issues/1209)) +- update django doc url to 1.8 lts ([Issue #1213](https://github.com/benoitc/gunicorn/issues/1213)) +- fix: miscellaneous wording corrections ([Issue #1216](https://github.com/benoitc/gunicorn/issues/1216)) +- Add PSF License Agreement of selectors.py to NOTICE (:issue: `1226`) +- document LOGGING overriding ([Issue #1051](https://github.com/benoitc/gunicorn/issues/1051)) +- put a note that error logs are only errors from Gunicorn ([Issue #1124](https://github.com/benoitc/gunicorn/issues/1124)) +- add a note about the requirements of the threads workers under python 2.x ([Issue #1200](https://github.com/benoitc/gunicorn/issues/1200)) +- add access_log_format to config example ([Issue #1251](https://github.com/benoitc/gunicorn/issues/1251)) + +### Tests + +- Use more pytest.raises() in test_http.py + + +## 19.4.5 / 2016/01/05 + +- fix: NameError fileno in gunicorn.http.wsgi ([Issue #1178](https://github.com/benoitc/gunicorn/issues/1178)) + +## 19.4.4 / 2016/01/04 + +- fix: check if a fileobject can be used with sendfile(2.md) ([Issue #1174](https://github.com/benoitc/gunicorn/issues/1174)) +- doc: be more descriptive in errorlog option ([Issue #1173](https://github.com/benoitc/gunicorn/issues/1173)) diff --git a/docs/content/2017-news.md b/docs/content/2017-news.md new file mode 100644 index 000000000..803f363f9 --- /dev/null +++ b/docs/content/2017-news.md @@ -0,0 +1,42 @@ + +# Changelog - 2017 + +!!! note + Please see [news](news.md) for the latest changes + + +## 19.7.1 / 2017/03/21 + +- fix: continue if SO_REUSEPORT seems to be available but fails ([Issue #1480](https://github.com/benoitc/gunicorn/issues/1480)) +- fix: support non-decimal values for the umask command line option ([Issue #1325](https://github.com/benoitc/gunicorn/issues/1325)) + +## 19.7.0 / 2017/03/01 + +- The previously deprecated ``gunicorn_django`` command has been removed. + Use the [gunicorn-cmd](run.md#gunicorn) command-line interface instead. +- The previously deprecated ``django_settings`` setting has been removed. + Use the [raw-env](reference/settings.md#raw_env) setting instead. +- The default value of [ssl-version](reference/settings.md#ssl_version) has been changed from + ``ssl.PROTOCOL_TLSv1`` to ``ssl.PROTOCOL_SSLv23``. +- fix: initialize the group access list when initgroups is set ([Issue #1297](https://github.com/benoitc/gunicorn/issues/1297)) +- add environment variables to gunicorn access log format ([Issue #1291](https://github.com/benoitc/gunicorn/issues/1291)) +- add --paste-global-conf option ([Issue #1304](https://github.com/benoitc/gunicorn/issues/1304)) +- fix: print access logs to STDOUT ([Issue #1184](https://github.com/benoitc/gunicorn/issues/1184)) +- remove upper limit on max header size config ([Issue #1313](https://github.com/benoitc/gunicorn/issues/1313)) +- fix: print original exception on AppImportError ([Issue #1334](https://github.com/benoitc/gunicorn/issues/1334)) +- use SO_REUSEPORT if available ([Issue #1344](https://github.com/benoitc/gunicorn/issues/1344)) +- `fix leak `_ of duplicate file descriptor for bound sockets. +- add --reload-engine option, support inotify and other backends ([Issue #1368](https://github.com/benoitc/gunicorn/issues/1368), [Issue #1459](https://github.com/benoitc/gunicorn/issues/1459)) +- fix: reject request with invalid HTTP versions +- add ``child_exit`` callback ([Issue #1394](https://github.com/benoitc/gunicorn/issues/1394)) +- add support for eventlets _AlreadyHandled object ([Issue #1406](https://github.com/benoitc/gunicorn/issues/1406)) +- format boot tracebacks properly with reloader ([Issue #1408](https://github.com/benoitc/gunicorn/issues/1408)) +- refactor socket activation and fd inheritance for better support of SystemD ([Issue #1310](https://github.com/benoitc/gunicorn/issues/1310)) +- fix: o fds are given by default in gunicorn ([Issue #1423](https://github.com/benoitc/gunicorn/issues/1423)) +- add ability to pass settings to GUNICORN_CMD_ARGS environment variable which helps in container world ([Issue #1385](https://github.com/benoitc/gunicorn/issues/1385)) +- fix: catch access denied to pid file ([Issue #1091](https://github.com/benoitc/gunicorn/issues/1091)) +- many additions and improvements to the documentation + +### Breaking Change + +- **Python 2.6.0** is the last supported version diff --git a/docs/content/2018-news.md b/docs/content/2018-news.md new file mode 100644 index 000000000..3c36e808a --- /dev/null +++ b/docs/content/2018-news.md @@ -0,0 +1,64 @@ + +# Changelog - 2018 + +!!! note + Please see [news](news.md) for the latest changes + + +## 19.9.0 / 2018/07/03 + +- fix: address a regression that prevented syslog support from working + ([Issue #1668](https://github.com/benoitc/gunicorn/issues/1668), [PR #1773](https://github.com/benoitc/gunicorn/pull/1773)) +- fix: correctly set `REMOTE_ADDR` on versions of Python 3 affected by + `Python Issue 30205 `_ + ([Issue #1755](https://github.com/benoitc/gunicorn/issues/1755), [PR #1796](https://github.com/benoitc/gunicorn/pull/1796)) +- fix: show zero response length correctly in access log ([PR #1787](https://github.com/benoitc/gunicorn/pull/1787)) +- fix: prevent raising `AttributeError` when ``--reload`` is not passed + in case of a `SyntaxError` raised from the WSGI application. + ([Issue #1805](https://github.com/benoitc/gunicorn/issues/1805), [PR #1806](https://github.com/benoitc/gunicorn/pull/1806)) +- The internal module ``gunicorn.workers.async`` was renamed to ``gunicorn.workers.base_async`` + since ``async`` is now a reserved word in Python 3.7. + ([PR #1527](https://github.com/benoitc/gunicorn/pull/1527)) + +## 19.8.1 / 2018/04/30 + +- fix: secure scheme headers when bound to a unix socket + ([Issue #1766](https://github.com/benoitc/gunicorn/issues/1766), [PR #1767](https://github.com/benoitc/gunicorn/pull/1767)) + +## 19.8.0 / 2018/04/28 + +- Eventlet 0.21.0 support ([Issue #1584](https://github.com/benoitc/gunicorn/issues/1584)) +- Tornado 5 support ([Issue #1728](https://github.com/benoitc/gunicorn/issues/1728), [PR #1752](https://github.com/benoitc/gunicorn/pull/1752)) +- support watching additional files with ``--reload-extra-file`` + ([PR #1527](https://github.com/benoitc/gunicorn/pull/1527)) +- support configuring logging with a dictionary with ``--logging-config-dict`` + ([Issue #1087](https://github.com/benoitc/gunicorn/issues/1087), [PR #1110](https://github.com/benoitc/gunicorn/pull/1110), [PR #1602](https://github.com/benoitc/gunicorn/pull/1602)) +- add support for the ``--config`` flag in the ``GUNICORN_CMD_ARGS`` environment + variable ([Issue #1576](https://github.com/benoitc/gunicorn/issues/1576), [PR #1581](https://github.com/benoitc/gunicorn/pull/1581)) +- disable ``SO_REUSEPORT`` by default and add the ``--reuse-port`` setting + ([Issue #1553](https://github.com/benoitc/gunicorn/issues/1553), [Issue #1603](https://github.com/benoitc/gunicorn/issues/1603), [PR #1669](https://github.com/benoitc/gunicorn/pull/1669)) +- fix: installing `inotify` on MacOS no longer breaks the reloader + ([Issue #1540](https://github.com/benoitc/gunicorn/issues/1540), [PR #1541](https://github.com/benoitc/gunicorn/pull/1541)) +- fix: do not throw ``TypeError`` when ``SO_REUSEPORT`` is not available + ([Issue #1501](https://github.com/benoitc/gunicorn/issues/1501), [PR #1491](https://github.com/benoitc/gunicorn/pull/1491)) +- fix: properly decode HTTP paths containing certain non-ASCII characters + ([Issue #1577](https://github.com/benoitc/gunicorn/issues/1577), [PR #1578](https://github.com/benoitc/gunicorn/pull/1578)) +- fix: remove whitespace when logging header values under gevent ([PR #1607](https://github.com/benoitc/gunicorn/pull/1607)) +- fix: close unlinked temporary files ([Issue #1327](https://github.com/benoitc/gunicorn/issues/1327), [PR #1428](https://github.com/benoitc/gunicorn/pull/1428)) +- fix: parse ``--umask=0`` correctly ([Issue #1622](https://github.com/benoitc/gunicorn/issues/1622), [PR #1632](https://github.com/benoitc/gunicorn/pull/1632)) +- fix: allow loading applications using relative file paths + ([Issue #1349](https://github.com/benoitc/gunicorn/issues/1349), [PR #1481](https://github.com/benoitc/gunicorn/pull/1481)) +- fix: force blocking mode on the gevent sockets ([Issue #880](https://github.com/benoitc/gunicorn/issues/880), [PR #1616](https://github.com/benoitc/gunicorn/pull/1616)) +- fix: preserve leading `/` in request path ([Issue #1512](https://github.com/benoitc/gunicorn/issues/1512), [PR #1511](https://github.com/benoitc/gunicorn/pull/1511)) +- fix: forbid contradictory secure scheme headers +- fix: handle malformed basic authentication headers in access log + ([Issue #1683](https://github.com/benoitc/gunicorn/issues/1683), [PR #1684](https://github.com/benoitc/gunicorn/pull/1684)) +- fix: defer handling of ``USR1`` signal to a new greenlet under gevent + ([Issue #1645](https://github.com/benoitc/gunicorn/issues/1645), [PR #1651](https://github.com/benoitc/gunicorn/pull/1651)) +- fix: the threaded worker would sometimes close the wrong keep-alive + connection under Python 2 ([Issue #1698](https://github.com/benoitc/gunicorn/issues/1698), [PR #1699](https://github.com/benoitc/gunicorn/pull/1699)) +- fix: re-open log files on ``USR1`` signal using ``handler._open`` to + support subclasses of ``FileHandler`` ([Issue #1739](https://github.com/benoitc/gunicorn/issues/1739), [PR #1742](https://github.com/benoitc/gunicorn/pull/1742)) +- deprecation: the ``gaiohttp`` worker is deprecated, see the + [worker-class](reference/settings.md#worker_class) documentation for more information + ([Issue #1338](https://github.com/benoitc/gunicorn/issues/1338), [PR #1418](https://github.com/benoitc/gunicorn/pull/1418), [PR #1569](https://github.com/benoitc/gunicorn/pull/1569)) diff --git a/docs/content/2019-news.md b/docs/content/2019-news.md new file mode 100644 index 000000000..8359edd66 --- /dev/null +++ b/docs/content/2019-news.md @@ -0,0 +1,112 @@ + +# Changelog - 2019 + +!!! note + Please see [news](news.md) for the latest changes + + +## 20.0.4 / 2019/11/26 + +- fix binding a socket using the file descriptor +- remove support for the `bdist_rpm` build + +## 20.0.3 / 2019/11/24 + +- fixed load of a config file without a Python extension +- fixed `socketfromfd.fromfd` when defaults are not set + +!!! note + ``` + ## 20.0.2 / 2019/11/23 + + - fix changelog + + ## 20.0.1 / 2019/11/23 + + - fixed the way the config module is loaded. `__file__` is now available + - fixed `wsgi.input_terminated`. It is always true. + - use the highest protocol version of openssl by default + - only support Python >= 3.5 + - added `__repr__` method to `Config` instance + - fixed support of AIX platform and musl libc in `socketfromfd.fromfd` function + - fixed support of applications loaded from a factory function + - fixed chunked encoding support to prevent any `request smuggling `_ + - Capture os.sendfile before patching in gevent and eventlet workers. + fix `RecursionError`. + - removed locking in reloader when adding new files + - load the WSGI application before the loader to pick up all files + +{note} +as documented in Flask and other places. +``` +## 19.10.0 / 2019/11/23 + +- unblock select loop during reload of a sync worker +- security fix: http desync attack +- handle `wsgi.input_terminated` +- added support for str and bytes in unix socket addresses +- fixed `max_requests` setting +- headers values are now encoded as LATN1, not ASCII +- fixed `InotifyReloadeder`: handle `module.__file__` is None +- fixed compatibility with tornado 6 +- fixed root logging +- Prevent removalof unix sockets from `reuse_port` +- Clear tornado ioloop before os.fork +- Miscellaneous fixes and improvement for linting using Pylint + +## 20.0 / 2019/10/30 + +- Fixed `fdopen` `RuntimeWarning` in Python 3.8 +- Added check and exception for str type on value in Response process_headers method. +- Ensure WSGI header value is string before conducting regex search on it. +- Added pypy3 to list of tested environments +- Grouped `StopIteration` and `KeyboardInterrupt` exceptions with same body together in Arbiter.run() +- Added `setproctitle` module to `extras_require` in setup.py +- Avoid unnecessary chown of temporary files +- Logging: Handle auth type case insensitively +- Removed `util.import_module` +- Removed fallback for `types.SimpleNamespace` in tests utils +- Use `SourceFileLoader` instead instead of `execfile_` +- Use `importlib` instead of `__import__` and eval` +- Fixed eventlet patching +- Added optional `datadog `_ tags for statsd metrics +- Header values now are encoded using latin-1, not ascii. +- Rewritten `parse_address` util added test +- Removed redundant super() arguments +- Simplify `futures` import in gthread module +- Fixed worker_connections` setting to also affects the Gthread worker type +- Fixed setting max_requests +- Bump minimum Eventlet and Gevent versions to 0.24 and 1.4 +- Use Python default SSL cipher list by default +- handle `wsgi.input_terminated` extension +- Simplify Paste Deployment documentation +- Fix root logging: root and logger are same level. +- Fixed typo in ssl_version documentation +- Documented systemd deployment unit examples +- Added systemd sd_notify support +- Fixed typo in gthread.py +- Added `tornado `_ 5 and 6 support +- Declare our setuptools dependency +- Added support to `--bind` to open file descriptors +- Document how to serve WSGI app modules from Gunicorn +- Provide guidance on X-Forwarded-For access log in documentation +- Add support for named constants in the `--ssl-version` flag +- Clarify log format usage of header & environment in documentation +- Fixed systemd documentation to properly setup gunicorn unix socket +- Prevent removal unix socket for reuse_port +- Fix `ResourceWarning` when reading a Python config module +- Remove unnecessary call to dict keys method +- Support str and bytes for UNIX socket addresses +- fixed `InotifyReloadeder`: handle `module.__file__` is None +- `/dev/shm` as a convenient alternative to making your own tmpfs mount in fchmod FAQ +- fix examples to work on python3 +- Fix typo in `--max-requests` documentation +- Clear tornado ioloop before os.fork +- Miscellaneous fixes and improvement for linting using Pylint + +### Breaking Change + +- Removed gaiohttp worker +- Drop support for Python 2.x +- Drop support for EOL Python 3.2 and 3.3 +- Drop support for Paste Deploy server blocks diff --git a/docs/content/2020-news.md b/docs/content/2020-news.md new file mode 100644 index 000000000..29195f687 --- /dev/null +++ b/docs/content/2020-news.md @@ -0,0 +1,7 @@ + +# Changelog - 2020 + +!!! note + Please see [news](news.md) for the latest changes + + diff --git a/docs/content/2021-news.md b/docs/content/2021-news.md new file mode 100644 index 000000000..d0572de10 --- /dev/null +++ b/docs/content/2021-news.md @@ -0,0 +1,51 @@ + +# Changelog - 2021 + +!!! note + Please see [news](news.md) for the latest changes + + +## 20.1.0 - 2021-02-12 + +- document WEB_CONCURRENCY is set by, at least, Heroku +- capture peername from accept: Avoid calls to getpeername by capturing the peer name returned by + accept +- log a warning when a worker was terminated due to a signal +- fix tornado usage with latest versions of Django +- add support for python -m gunicorn +- fix systemd socket activation example +- allows to set wsgi application in config file using `wsgi_app` +- document `--timeout = 0` +- always close a connection when the number of requests exceeds the max requests +- Disable keepalive during graceful shutdown +- kill tasks in the gthread workers during upgrade +- fix latency in gevent worker when accepting new requests +- fix file watcher: handle errors when new worker reboot and ensure the list of files is kept +- document the default name and path of the configuration file +- document how variable impact configuration +- document the `$PORT` environment variable +- added milliseconds option to request_time in access_log +- added PIP requirements to be used for example +- remove version from the Server header +- fix sendfile: use `socket.sendfile` instead of `os.sendfile` +- reloader: use absolute path to prevent empty to prevent0 `InotifyError` when a file + is added to the working directory +- Add --print-config option to print the resolved settings at startup. +- remove the `--log-dict-config` CLI flag because it never had a working format + (the `logconfig_dict` setting in configuration files continues to work) + + +### Breaking changes + +- minimum version is Python 3.5 +- remove version from the Server header + +** Documentation ** + + + +** Others ** + +- miscellaneous changes in the code base to be a better citizen with Python 3 +- remove dead code +- fix documentation generation diff --git a/docs/content/2023-news.md b/docs/content/2023-news.md new file mode 100644 index 000000000..9526c0c7f --- /dev/null +++ b/docs/content/2023-news.md @@ -0,0 +1,36 @@ + +# Changelog - 2023 + +## 21.2.0 - 2023-07-19 + +- fix thread worker: revert change considering connection as idle . + +!!! note + This is fixing the bad file description error. + + 21.1.0 - 2023-07-18 + + +=================== + +- fix thread worker: fix socket removal from the queue + +## 21.0.1 - 2023-07-17 + +- fix documentation build + +## 21.0.0 - 2023-07-17 + +- support python 3.11 +- fix gevent and eventlet workers +- fix threads support (gththread.md): improve performance and unblock requests +- SSL: now use SSLContext object +- HTTP parser: miscellaneous fixes +- remove unnecessary setuid calls +- fix testing +- improve logging +- miscellaneous fixes to core engine + +*** RELEASE NOTE *** + +We made this release major to start our new release cycle. More info will be provided on our discussion forum. diff --git a/docs/content/2024-news.md b/docs/content/2024-news.md new file mode 100644 index 000000000..8ae716118 --- /dev/null +++ b/docs/content/2024-news.md @@ -0,0 +1,58 @@ + +# Changelog - 2024 + +## 23.0.0 - 2024-08-10 + +- minor docs fixes ([PR #3217](https://github.com/benoitc/gunicorn/pull/3217), [PR #3089](https://github.com/benoitc/gunicorn/pull/3089), [PR #3167](https://github.com/benoitc/gunicorn/pull/3167)) +- worker_class parameter accepts a class ([PR #3079](https://github.com/benoitc/gunicorn/pull/3079)) +- fix deadlock if request terminated during chunked parsing ([PR #2688](https://github.com/benoitc/gunicorn/pull/2688)) +- permit receiving Transfer-Encodings: compress, deflate, gzip ([PR #3261](https://github.com/benoitc/gunicorn/pull/3261)) +- permit Transfer-Encoding headers specifying multiple encodings. note: no parameters, still ([PR #3261](https://github.com/benoitc/gunicorn/pull/3261)) +- sdist generation now explicitly excludes sphinx build folder ([PR #3257](https://github.com/benoitc/gunicorn/pull/3257)) +- decode bytes-typed status (as can be passed by gevent) as utf-8 instead of raising `TypeError` ([PR #2336](https://github.com/benoitc/gunicorn/pull/2336)) +- raise correct Exception when encounting invalid chunked requests ([PR #3258](https://github.com/benoitc/gunicorn/pull/3258)) +- the SCRIPT_NAME and PATH_INFO headers, when received from allowed forwarders, are no longer restricted for containing an underscore ([PR #3192](https://github.com/benoitc/gunicorn/pull/3192)) +- include IPv6 loopback address ``[::1]`` in default for [forwarded-allow-ips](reference/settings.md#forwarded_allow_ips) and [proxy-allow-ips](reference/settings.md#proxy_allow_ips) ([PR #3192](https://github.com/benoitc/gunicorn/pull/3192)) + +!!! note + - The SCRIPT_NAME change mitigates a regression that appeared first in the 22.0.0 release + - Review your [forwarded-allow-ips](reference/settings.md#forwarded_allow_ips) setting if you are still not seeing the SCRIPT_NAME transmitted + - Review your [forwarder-headers](reference/settings.md#forwarder_headers) setting if you are missing headers after upgrading from a version prior to 22.0.0 + + +### Breaking changes + +- refuse requests where the uri field is empty ([PR #3255](https://github.com/benoitc/gunicorn/pull/3255)) +- refuse requests with invalid CR/LR/NUL in heade field values ([PR #3253](https://github.com/benoitc/gunicorn/pull/3253)) +- remove temporary ``--tolerate-dangerous-framing`` switch from 22.0 ([PR #3260](https://github.com/benoitc/gunicorn/pull/3260)) +- If any of the breaking changes affect you, be aware that now refused requests can post a security problem, especially so in setups involving request pipe-lining and/or proxies. + +## 22.0.0 - 2024-04-17 + +- use `utime` to notify workers liveness +- migrate setup to pyproject.toml +- fix numerous security vulnerabilities in HTTP parser (closing some request smuggling vectors) +- parsing additional requests is no longer attempted past unsupported request framing +- on HTTP versions < 1.1 support for chunked transfer is refused (only used in exploits) +- requests conflicting configured or passed SCRIPT_NAME now produce a verbose error +- Trailer fields are no longer inspected for headers indicating secure scheme +- support Python 3.12 + +### Breaking changes + +- minimum version is Python 3.7 +- the limitations on valid characters in the HTTP method have been bounded to Internet Standards +- requests specifying unsupported transfer coding (order.md) are refused by default (rare.md) +- HTTP methods are no longer casefolded by default (IANA method registry contains none affected) +- HTTP methods containing the number sign (#) are no longer accepted by default (rare.md) +- HTTP versions < 1.0 or >= 2.0 are no longer accepted by default (rare, only HTTP/1.1 is supported) +- HTTP versions consisting of multiple digits or containing a prefix/suffix are no longer accepted +- HTTP header field names Gunicorn cannot safely map to variables are silently dropped, as in other software +- HTTP headers with empty field name are refused by default (no legitimate use cases, used in exploits) +- requests with both Transfer-Encoding and Content-Length are refused by default (such a message might indicate an attempt to perform request smuggling) +- empty transfer codings are no longer permitted (reportedly seen with really old & broken proxies) + + +### Security + +- fix CVE-2024-1135 diff --git a/docs/content/assets/gunicorn.svg b/docs/content/assets/gunicorn.svg new file mode 100644 index 000000000..073f2029c --- /dev/null +++ b/docs/content/assets/gunicorn.svg @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + g + + + + + diff --git a/docs/content/community.md b/docs/content/community.md new file mode 100644 index 000000000..e9996b9d5 --- /dev/null +++ b/docs/content/community.md @@ -0,0 +1,40 @@ +# Community + +Connect with the project through these channels. + +## Project management & discussions + +Project maintenance guidelines live on the +[wiki](https://github.com/benoitc/gunicorn/wiki/Project-management). + +GitHub is used for: + +- [Bug reports](https://github.com/benoitc/gunicorn/issues) — search before + opening a new issue. +- [Discussions](https://github.com/benoitc/gunicorn/discussions) — Q&A and usage + tips. +- [Feature planning](https://github.com/benoitc/gunicorn/issues) — development + and project management topics. + +## IRC + +Join the Gunicorn channel on [Libera Chat](https://libera.chat/) at +[`#gunicorn`](https://web.libera.chat/?channels=#gunicorn). + +## Issue tracking + +File bugs, enhancements, and tasks in the +[GitHub issue tracker](https://github.com/benoitc/gunicorn/issues). + +## Security issues + +Report security vulnerabilities privately to +[`security@gunicorn.org`](mailto:security@gunicorn.org); only core developers +subscribe to this list. + +## Contributing + +Start with the +[contributing guide](https://github.com/benoitc/gunicorn/blob/master/CONTRIBUTING.md) +for development workflow, code style, and review expectations. New contributors +are welcome—open a draft pull request early to gather feedback. diff --git a/docs/content/configure.md b/docs/content/configure.md new file mode 100644 index 000000000..1698fba57 --- /dev/null +++ b/docs/content/configure.md @@ -0,0 +1,78 @@ + +# Configuration Overview + +Gunicorn reads configuration from five places, in increasing order of priority: + +1. Environment variables, for settings that support them. +2. Framework-specific configuration (currently Paste Deploy only). +3. A Python configuration file `gunicorn.conf.py` (default in the working directory). +4. The `GUNICORN_CMD_ARGS` environment variable. +5. Command-line arguments. + +If a configuration file is provided both via `GUNICORN_CMD_ARGS` and the CLI, +only the file specified on the command line is used. + +!!! note + Print the fully resolved configuration: + +bash +gunicorn --print-config APP_MODULE +``` + +Validate configuration and exit: + +```bash +gunicorn --check-config APP_MODULE +``` + +This is also a quick way to confirm that your application can start. +``` + +## Command line + +Options set on the command line override framework settings and values from the +configuration file. Not every setting has a command-line flag; run + +```bash +gunicorn -h +``` + +for the complete list. The CLI also exposes `--version`, which is not part of +the main [settings reference](reference/settings.md). + + +## Configuration file + +Provide a Python file (for example `gunicorn.conf.py`). Gunicorn executes the +file on every start or reload, so any valid Python is allowed: + +```python +import multiprocessing + +bind = "127.0.0.1:8000" +workers = multiprocessing.cpu_count() * 2 + 1 +``` + +Every configuration key is documented in the [settings reference](reference/settings.md). + +## Framework settings + +At present only Paste Deploy applications expose framework-specific settings. +If you have ideas for Django or other frameworks, open an +[issue](https://github.com/benoitc/gunicorn/issues). + +### Paste applications + +Reference Gunicorn as the server in your INI file: + +```ini +[server:main] +use = egg:gunicorn#main +host = 192.168.0.1 +port = 80 +workers = 2 +proc_name = brim +``` + +Gunicorn merges any recognised parameters into the base configuration. Values +from the configuration file and command line still override these defaults. diff --git a/docs/content/custom.md b/docs/content/custom.md new file mode 100644 index 000000000..f2bdfb736 --- /dev/null +++ b/docs/content/custom.md @@ -0,0 +1,62 @@ + +# Custom Application + +!!! info "Added in 19.0" + Use Gunicorn as part of your own WSGI application by subclassing + `gunicorn.app.base.BaseApplication`. + + + +Example: create a tiny WSGI app and load it with a custom application: + +```text +--8<-- "examples/standalone_app.py" +``` + + + +## Using server hooks + +Provide hooks through configuration, just like a standard Gunicorn deployment. +For example, a `pre_fork` hook: + +```python +def pre_fork(server, worker): + print(f"pre-fork server {server} worker {worker}", file=sys.stderr) + +if __name__ == "__main__": + options = { + "bind": "127.0.0.1:8080", + "workers": number_of_workers(), + "pre_fork": pre_fork, + } +``` + +## Direct usage of existing WSGI apps + +Run Gunicorn from Python to serve a WSGI application instance at runtime—useful +for rolling deploys or packaging with PEX. Gunicorn exposes +`gunicorn.app.wsgiapp`, which accepts any WSGI app (for example a Flask or +Django instance). Assuming your package is `exampleapi` and the application is +`app`: + +```bash +python -m gunicorn.app.wsgiapp exampleapi:app +``` + +All CLI flags and configuration files still apply: + +```bash +# Custom parameters +python -m gunicorn.app.wsgiapp exampleapi:app --bind=0.0.0.0:8081 --workers=4 +# Using a config file +python -m gunicorn.app.wsgiapp exampleapi:app -c config.py +``` + +For PEX builds use `-c gunicorn` at build time so the packaged app accepts the +entry point at runtime: + +```bash +pex . -v -c gunicorn -o compiledapp.pex +./compiledapp.pex exampleapi:app -c gunicorn_config.py +``` diff --git a/docs/content/deploy.md b/docs/content/deploy.md new file mode 100644 index 000000000..bb78674e4 --- /dev/null +++ b/docs/content/deploy.md @@ -0,0 +1,322 @@ +# Deploying Gunicorn + +We strongly recommend running Gunicorn behind a proxy server. + +## Nginx configuration + +Although many HTTP proxies exist, we recommend [Nginx](https://nginx.org/). +When using the default synchronous workers you must ensure the proxy buffers +slow clients; otherwise Gunicorn becomes vulnerable to denial-of-service +attacks. Use [Hey](https://github.com/rakyll/hey) to verify proxy behaviour. + +An example configuration for fast clients with Nginx +([source](https://github.com/benoitc/gunicorn/blob/master/examples/nginx.conf)): + +```nginx title="nginx.conf" +--8<-- "examples/nginx.conf" +``` + + + +To support streaming requests/responses or patterns such as Comet, long +polling, or WebSockets, disable proxy buffering and run Gunicorn with an async +worker class: + +```nginx +location @proxy_to_app { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_redirect off; + proxy_buffering off; + + proxy_pass http://app_server; +} +``` + +To ignore aborted requests (for example, health checks that close connections +prematurely) enable +[`proxy_ignore_client_abort`](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ignore_client_abort): + +```nginx +proxy_ignore_client_abort on; +``` + +!!! note + The default value for `proxy_ignore_client_abort` is `off`. If it remains off + Nginx logs will report error 499 and Gunicorn may log `Ignoring EPIPE` when the + log level is `debug`. + + + +Pass protocol information to Gunicorn so applications can generate correct +URLs. Add this header to your `location` block: + +```nginx +proxy_set_header X-Forwarded-Proto $scheme; +``` + +If Nginx runs on a different host, tell Gunicorn which proxies are trusted so it +accepts the `X-Forwarded-*` headers: + +```bash +gunicorn -w 3 --forwarded-allow-ips="10.170.3.217,10.170.3.220" test:app +``` + +When all traffic comes from trusted proxies (for example Heroku) you can set +`--forwarded-allow-ips='*'`. This is **dangerous** if untrusted clients can +reach Gunicorn directly, because forged headers could make your application +serve secure content over plain HTTP. + +Gunicorn 19 changed the handling of `REMOTE_ADDR` to conform to +[RFC 3875](https://www.rfc-editor.org/rfc/rfc3875), meaning it now records the +proxy IP rather than the upstream client. To log the real client address, set +[`access_log_format`](reference/settings.md#access_log_format) to include `X-Forwarded-For`: + +```text +%({x-forwarded-for}i)s %(l.md)s %(u.md)s %(t.md)s "%(r.md)s" %(s.md)s %(b.md)s "%(f.md)s" "%(a.md)s" +``` + +When binding Gunicorn to a UNIX socket `REMOTE_ADDR` will be empty. + +## Using virtual environments + +Install Gunicorn inside your project +[virtual environment](https://pypi.python.org/pypi/virtualenv) to keep versions +isolated: + +```bash +mkdir ~/venvs/ +virtualenv ~/venvs/webapp +source ~/venvs/webapp/bin/activate +pip install gunicorn +deactivate +``` + +Force installation into the active virtual environment with `--ignore-installed`: + +```bash +source ~/venvs/webapp/bin/activate +pip install -I gunicorn +``` + +## Monitoring + +!!! note + Do not enable Gunicorn's daemon mode when using process monitors. These + supervisors expect to manage the direct child process. + + + +### Gaffer + +Use [Gaffer](https://gaffer.readthedocs.io/) with *gafferd* to manage Gunicorn: + +```ini +[process:gunicorn] +cmd = gunicorn -w 3 test:app +cwd = /path/to/project +``` + +Create a `Procfile` if you prefer: + +```procfile +gunicorn = gunicorn -w 3 test:app +``` + +Start Gunicorn via Gaffer: + +```bash +gaffer start +``` + +Or load it into a running *gafferd* instance: + +```bash +gaffer load +``` + +### runit + +[runit](http://smarden.org/runit/) is a popular supervisor. A sample service +script (see the +[full example](https://github.com/benoitc/gunicorn/blob/master/examples/gunicorn_rc)): + +```bash +#!/bin/sh + +GUNICORN=/usr/local/bin/gunicorn +ROOT=/path/to/project +PID=/var/run/gunicorn.pid + +APP=main:application + +if [ -f $PID ]; then rm $PID; fi + +cd $ROOT +exec $GUNICORN -c $ROOT/gunicorn.conf.py --pid=$PID $APP +``` + +Save as `/etc/sv//run`, make it executable, and symlink into +`/etc/service/`. runit will then supervise Gunicorn. + +### Supervisor + +[Supervisor](http://supervisord.org/) configuration example (adapted from +[examples/supervisor.conf](https://github.com/benoitc/gunicorn/blob/master/examples/supervisor.conf)): + +```ini +[program:gunicorn] +command=/path/to/gunicorn main:application -c /path/to/gunicorn.conf.py +directory=/path/to/project +user=nobody +autostart=true +autorestart=true +redirect_stderr=true +``` + +### Upstart + +Sample Upstart config (logs go to `/var/log/upstart/myapp.log`): + +```upstart +# /etc/init/myapp.conf + +description "myapp" + +start on (filesystem.md) +stop on runlevel [016] + +respawn +setuid nobody +setgid nogroup +chdir /path/to/app/directory + +exec /path/to/virtualenv/bin/gunicorn myapp:app +``` + +### systemd + +[systemd](https://www.freedesktop.org/wiki/Software/systemd/) can create a UNIX +socket and launch Gunicorn on demand. + +Service file: + +```ini +# /etc/systemd/system/gunicorn.service + +[Unit] +Description=gunicorn daemon +Requires=gunicorn.socket +After=network.target + +[Service] +Type=notify +NotifyAccess=main +User=someuser +Group=someuser +RuntimeDirectory=gunicorn +WorkingDirectory=/home/someuser/applicationroot +ExecStart=/usr/bin/gunicorn applicationname.wsgi +ExecReload=/bin/kill -s HUP $MAINPID +KillMode=mixed +TimeoutStopSec=5 +PrivateTmp=true + +[Install] +WantedBy=multi-user.target +``` + +`Type=notify` lets Gunicorn report readiness to systemd. If the service should +run under a transient user consider adding `DynamicUser=true`. Tighten +permissions further with `ProtectSystem=strict` if the app permits. + +Socket activation file: + +```ini +# /etc/systemd/system/gunicorn.socket + +[Unit] +Description=gunicorn socket + +[Socket] +ListenStream=/run/gunicorn.sock +SocketUser=www-data +SocketGroup=www-data +SocketMode=0660 + +[Install] +WantedBy=sockets.target +``` + +Enable and start the socket so it begins listening immediately and on reboot: + +```bash +systemctl enable --now gunicorn.socket +``` + +Test connectivity from the nginx user (Debian defaults to `www-data`): + +```bash +sudo -u www-data curl --unix-socket /run/gunicorn.sock http +``` + +!!! note + Use `systemctl show --value -p MainPID gunicorn.service` to retrieve the main + process ID or `systemctl kill -s HUP gunicorn.service` to send signals. + + + +Configure Nginx to proxy to the new socket: + +```nginx +user www-data; +... +http { + server { + listen 8000; + server_name 127.0.0.1; + location / { + proxy_pass http://unix:/run/gunicorn.sock; + } + } +} +... +``` + +!!! note + Adjust `listen` and `server_name` for production (typically port 80 and your + site's domain). + + + +Ensure nginx starts automatically: + +```bash +systemctl enable nginx.service +systemctl start nginx +``` + +Browse to to verify Gunicorn + Nginx + systemd. + +## Logging + +Configure logging through the CLI flags described in the +[settings documentation](reference/settings.md#logging) or via a +[logging configuration file](https://github.com/benoitc/gunicorn/blob/master/examples/logging.conf). +Rotate logs with `logrotate` by sending `SIGUSR1`: + +```bash +kill -USR1 $(cat /var/run/gunicorn.pid) +``` + +!!! note + If you override the `LOGGING` dictionary, set `disable_existing_loggers` to + `False` so Gunicorn's loggers remain active. + + + +!!! warning + Gunicorn's error log should capture Gunicorn-related messages only. Route your + application logs separately. + + diff --git a/docs/content/design.md b/docs/content/design.md new file mode 100644 index 000000000..eda92ebb5 --- /dev/null +++ b/docs/content/design.md @@ -0,0 +1,83 @@ + +# Design + +A brief look at Gunicorn's architecture. + +## Server model + +Gunicorn uses a pre-fork worker model: a master process manages worker +processes, while the workers handle requests and responses. The master never +touches individual client sockets. + +### Master + +The master process listens for signals (TTIN, TTOU, CHLD, etc.) and adjusts the +worker pool accordingly. `TTIN`/`TTOU` change the number of workers; `CHLD` +indicates a worker exited and must be restarted. + +### Sync workers + +The default `sync` worker handles one request at a time. Errors affect only the +current request. Because connections close after each response, persistent +connections are not supported even if you set `Keep-Alive` headers manually. + +### Async workers + +Async workers are powered by [greenlets](https://github.com/python-greenlet/greenlet) +through [Eventlet](http://eventlet.net/) or [Gevent](http://www.gevent.org/). +Most apps work without modification, though full compatibility may require +patches (for example installing [`psycogreen`](https://github.com/psycopg/psycogreen/) +when using [Psycopg](http://initd.org/psycopg/)). Some apps that depend on the +original blocking behaviour may not be compatible. + +### Gthread workers + +`gthread` is a threaded worker. The main loop accepts connections and places +them in a thread pool. Keep-alive connections return to the pool to await +further events; idle connections close after the keepalive timeout. + +### Tornado workers + +A Tornado worker class exists for Tornado-based applications. While it can +serve WSGI apps, this configuration is not recommended. + + +### AsyncIO workers + +Use third-party workers to pair Gunicorn with asyncio frameworks (see the +[aiohttp deployment guide](https://docs.aiohttp.org/en/stable/deployment.html#nginx-gunicorn) +or the [Flask aiohttp example](https://github.com/benoitc/gunicorn/blob/master/examples/frameworks/flaskapp_aiohttp_wsgi.py)). + +## Choosing a worker type + +Synchronous workers assume your app is CPU/network bound and avoids indefinite +operations. Any outbound HTTP calls or other blocking behaviour benefit from an +async worker. Because synchronous workers are vulnerable to slow clients, +Gunicorn requires a buffering proxy in front of the default configuration. Tools +like [Hey](https://github.com/rakyll/hey) can simulate slow responses to test +this scenario. + +Examples that need async workers: + +- Long blocking calls (outbound web services) +- Direct internet traffic (no buffering proxy) +- Streaming request/response bodies +- Long polling +- WebSockets / Comet + +## How many workers? + +Do **not** scale workers to match client count. Gunicorn usually needs only 4–12 +workers to handle heavy traffic. Start with `(2 * num_cores) + 1` and adjust +under load using `TTIN`/`TTOU`. + +Too many workers waste resources and can reduce throughput. + +## How many threads? + +Since Gunicorn 19 you can set `--threads` (with the `gthread` worker) to process +requests concurrently. Threads can extend request time beyond the worker +timeout while still notifying the master. The optimal mix of threads and worker +processes depends on the runtime (for example CPython vs. Jython). Threads share +memory, lowering footprint, and still allow reloads because application code is +loaded in worker processes. diff --git a/docs/content/faq.md b/docs/content/faq.md new file mode 100644 index 000000000..f26f1797c --- /dev/null +++ b/docs/content/faq.md @@ -0,0 +1,160 @@ + +# FAQ + +## WSGI bits + +### How do I set `SCRIPT_NAME`? + +By default `SCRIPT_NAME` is an empty string. Set it via an environment variable +or HTTP header. Because the header contains an underscore it is only accepted +from trusted forwarders listed in [`forwarded_allow_ips`](reference/settings.md#forwarded_allow_ips). + +!!! note + If your application should appear under a subfolder, `SCRIPT_NAME` typically + starts with a single leading slash and no trailing slash. + + + +## Server stuff + +### How do I reload my application in Gunicorn? + +Send `HUP` to the master process for a graceful reload: + +```bash +kill -HUP masterpid +``` + +### How might I test a proxy configuration? + +Use [Hey](https://github.com/rakyll/hey) to confirm that your proxy buffers +responses correctly for synchronous workers: + +```bash +hey -n 10000 -c 100 http://127.0.0.1:5000/ +``` + +That benchmark issues 10,000 requests with a concurrency of 100. + +### How can I name processes? + +Install [setproctitle](https://pypi.python.org/pypi/setproctitle) to give +Gunicorn processes meaningful names in tools such as `ps` and `top`. This helps +when running multiple Gunicorn instances. See the +[`proc_name`](reference/settings.md#proc_name) setting for details. + +### Why is there no HTTP keep-alive? + +The default sync workers target Nginx, which uses HTTP/1.0 for upstream +connections. If you need to serve unbuffered internet traffic directly, pick an +async worker instead. + +## Worker processes + +### How do I know which type of worker to use? + +Read the [design guide](design.md) for guidance on worker types. + +### What types of workers are available? + +See the [`worker_class`](reference/settings.md#worker_class) configuration reference. + +### How can I figure out the best number of worker processes? + +Follow the recommendations for tuning the [`number of workers`](design.md#how-many-workers). + +### How can I change the number of workers dynamically? + +Send `TTIN` or `TTOU` to the master process: + +```bash +kill -TTIN $masterpid # increment workers +kill -TTOU $masterpid # decrement workers +``` + +### Does Gunicorn suffer from the thundering herd problem? + +Potentially, when many sleeping handlers wake simultaneously but only one takes +the request. There is ongoing work to mitigate this +([issue #792](https://github.com/benoitc/gunicorn/issues/792)). Monitor load if +you use large numbers of workers or threads. + +### Why don't I see logs in the console? + +Gunicorn 19.0 disabled console logging by default. Use `--log-file=-` to stream +logs to stdout. Console logging returned in 19.2. + +## Kernel parameters + +High-concurrency deployments may need kernel tuning. These Linux-oriented tips +apply to any network service. + +### How can I increase the maximum number of file descriptors? + +Raise the per-process limit (remember sockets count as files). Running `sudo +ulimit` is ineffective—switch to root, adjust the limit, then launch Gunicorn. +Consider managing limits via systemd service units or init scripts. + +### How can I increase the maximum socket backlog? + +Increase the queue of pending connections: + +```bash +sudo sysctl -w net.core.somaxconn="2048" +``` + +### How can I disable the use of `sendfile()`? + +Pass `--no-sendfile` or set the `SENDFILE=0` environment variable. + +## Troubleshooting + +### Django reports `ImproperlyConfigured` + +Asynchronous workers may break `django.core.urlresolvers.reverse`. Use +`reverse_lazy` instead. + +### How do I avoid blocking in `os.fchmod`? + +Gunicorn's heartbeat touches temporary files. On disk-backed filesystems (for +example `/tmp` on some distributions) `os.fchmod` can block if I/O stalls or the +filesystem fills up. Mount a `tmpfs` and point `--worker-tmp-dir` to it. + +Check whether `/tmp` is RAM-backed: + +```bash +df /tmp +``` + +If not, create a new `tmpfs` mount: + +```bash +sudo cp /etc/fstab /etc/fstab.orig +sudo mkdir /mem +echo 'tmpfs /mem tmpfs defaults,size=64m,mode=1777,noatime,comment=for-gunicorn 0 0' | sudo tee -a /etc/fstab +sudo mount /mem +``` + +Verify the result: + +```bash +df /mem +``` + +Then start Gunicorn with `--worker-tmp-dir /mem`. + +### Why are workers silently killed? + +If a worker vanishes without logs, check for `SIGKILL`. Reverse proxies may show +`502` responses while Gunicorn logs only new worker startups (for example, +`[INFO] Booting worker`). A common culprit is the OOM killer in cgroups-limited +environments. + +Inspect kernel logs: + +```bash +dmesg | grep gunicorn +``` + +If you see messages similar to `Memory cgroup out of memory ... Killed process +(gunicorn.md)`, raise memory limits or adjust OOM behaviour. diff --git a/docs/content/index.md b/docs/content/index.md new file mode 100644 index 000000000..c9a7079a0 --- /dev/null +++ b/docs/content/index.md @@ -0,0 +1,68 @@ +# Gunicorn + +
+
+
+ +

Production-ready Python web services

+

Gunicorn is a dependable WSGI HTTP server for UNIX that keeps Python applications running fast and resilient in production. Built on a pre-fork worker model and trusted in countless deployments, it pairs clean configuration with flexible worker strategies so you can meet any traffic pattern.

+ +
+
+
$ pip install gunicorn
+$ gunicorn example:app --workers 3
+
Latest release: {{ release }}
+
+
+
+ +## Quickstart + +1. Install Gunicorn into your application environment. +2. Point Gunicorn at your WSGI app: `gunicorn myproject.wsgi`. +3. Tune worker type, concurrency, and hooks using the rich [settings](reference/settings.md). + +Need a longer walkthrough? Jump into the [install guide](install.md). + +## Why teams choose Gunicorn + +
+
+

Works with your framework

+

Django, Flask, FastAPI, Pyramid, you name it—Gunicorn speaks WSGI so your stack just runs.

+ Running Gunicorn → +
+
+

Flexible workers

+

Sync, async, gevent, eventlet—choose the concurrency model that fits.

+ Worker classes → +
+
+

Battle-tested hooks

+

Lifecycle hooks let you instrument, reload, and extend Gunicorn to match your deployment requirements.

+ Server hooks → +
+
+

Containers to bare metal

+

Deploy with systemd, Kubernetes, Heroku, or Docker—the configuration stays predictable everywhere.

+ Deployment patterns → +
+
+ +## Documentation map + +- [Install](install.md): Set up Gunicorn in a clean environment. +- [Run](run.md): CLI usage and integration with frameworks. +- [Configure](configure.md): Combine CLI flags and config files effectively. +- [Settings reference](reference/settings.md): Generated from the Gunicorn source of truth. +- [Signals](signals.md): Manage worker lifecycle in production. +- [Instrumentation](instrumentation.md): Monitor metrics and logs. + +## Community & support + +- Report bugs or request features on [GitHub Issues](https://github.com/benoitc/gunicorn/issues). +- Discuss strategies with maintainers in `#gunicorn` on [Libera Chat](https://libera.chat/). +- Contributions are welcome—see the [contributing guide](community.md#contributing) and say hi to the maintainers. diff --git a/docs/content/install.md b/docs/content/install.md new file mode 100644 index 000000000..df69e64fa --- /dev/null +++ b/docs/content/install.md @@ -0,0 +1,142 @@ +# Installation + +!!! note + Gunicorn requires **Python 3.12 or newer**. + + + +```bash +pip install gunicorn +``` + +## From source + +Install Gunicorn from GitHub if you want the latest development version: + +```bash +pip install git+https://github.com/benoitc/gunicorn.git +``` + +Stay current by upgrading in place: + +```bash +pip install -U git+https://github.com/benoitc/gunicorn.git +``` + +## Async workers + +Install Eventlet or Gevent if your application benefits from cooperative I/O. +Both rely on `greenlet`, so make sure the Python headers are available (for +example, install the `python-dev` package on Ubuntu). + +```bash +pip install greenlet # Required for both +pip install eventlet # For eventlet workers +pip install gunicorn[eventlet] # Or, using extra +pip install gevent # For gevent workers +pip install gunicorn[gevent] # Or, using extra +``` + +!!! note + Gevent also needs `libevent` 1.4.x or 2.0.4+. Install it from your package + manager or build it manually if the packaged version is too old. + + + +## Extra packages + +Some Gunicorn options require additional dependencies. Install them via +extras to pull everything in with one command. + +Most extras enable alternative worker types—see the +[design docs](design.md) for when each worker makes sense. + +- `gunicorn[eventlet]` — Eventlet-based greenlet workers +- `gunicorn[gevent]` — Gevent-based greenlet workers +- `gunicorn[gthread]` — Threaded workers +- `gunicorn[tornado]` — Tornado-based workers (not recommended) + +If you run more than one Gunicorn instance, the +[`proc_name`](reference/settings.md#proc_name) setting helps distinguish them in tools such +as `ps` and `top`. + +- `gunicorn[setproctitle]` — Enables setting the process name + +You can combine multiple extras, for example: + +```bash +pip install gunicorn[gevent,setproctitle] +``` + +## Debian GNU/Linux + +On Debian systems prefer the distribution packages unless you need per-project +virtual environments: + +- Zero-effort installation: automatically starts multiple instances based on + configs in `/etc/gunicorn.d`. +- Sensible log locations (`/var/log/gunicorn`) with `logrotate` support. +- Improved security: run each instance with a dedicated UNIX user/group. +- Safe upgrades: minimal downtime, reversible changes, and easy package purge. + +### stable ("buster") + +The Debian [stable](https://www.debian.org/releases/stable/) release ships +Gunicorn 19.9.0 (December 2020): + +```bash +sudo apt-get install gunicorn3 +``` + +Install Gunicorn 20.0.4 from [Debian Backports](https://backports.debian.org/) +by adding this line to `/etc/apt/sources.list`: + +```text +deb http://ftp.debian.org/debian buster-backports main +``` + +Refresh package metadata and install: + +```bash +sudo apt-get update +sudo apt-get -t buster-backports install gunicorn +``` + +### oldstable ("stretch") + +Stretch provides Gunicorn 19.6.0 (December 2020). Install the Python 3 version: + +```bash +sudo apt-get install gunicorn3 +``` + +To upgrade to 19.7.1 from backports, add: + +```text +deb http://ftp.debian.org/debian stretch-backports main +``` + +Then update and install: + +```bash +sudo apt-get update +sudo apt-get -t stretch-backports install gunicorn3 +``` + +### testing ("bullseye") and unstable ("sid") + +Both distributions include Gunicorn 20.0.4. Install it in the usual way: + +```bash +sudo apt-get install gunicorn +``` + +## Ubuntu + +Ubuntu 20.04 LTS (Focal Fossa) and newer include Gunicorn 20.0.4. Keep it +current through the package manager: + +```bash +sudo apt-get update +sudo apt-get install gunicorn +``` diff --git a/docs/content/instrumentation.md b/docs/content/instrumentation.md new file mode 100644 index 000000000..c4d3c2483 --- /dev/null +++ b/docs/content/instrumentation.md @@ -0,0 +1,32 @@ + +# Instrumentation + +!!! info "Added in 19.1" + Gunicorn exposes optional instrumentation for the arbiter and workers using the + statsD protocol over UDP. The `gunicorn.instrument.statsd` module turns + Gunicorn into a statsD client. + + + +UDP keeps Gunicorn isolated from slow statsD consumers, so metrics collection +does not impact request handling. + +Tell Gunicorn where the statsD server is located: + +```bash +gunicorn --statsd-host=localhost:8125 --statsd-prefix=service.app ... +``` + +The `Statsd` logger subclasses `gunicorn.glogging.Logger` and tracks: + +- `gunicorn.requests` — request rate per second +- `gunicorn.request.duration` — request duration histogram (milliseconds.md) +- `gunicorn.workers` — number of workers managed by the arbiter (gauge.md) +- `gunicorn.log.critical` — rate of critical log messages +- `gunicorn.log.error` — rate of error log messages +- `gunicorn.log.warning` — rate of warning log messages +- `gunicorn.log.exception` — rate of exceptional log messages + +See the [`statsd_host`](reference/settings.md#statsd_host) setting for additional options. + +[statsD](https://github.com/etsy/statsd) diff --git a/docs/content/news.md b/docs/content/news.md new file mode 100644 index 000000000..1b7f07229 --- /dev/null +++ b/docs/content/news.md @@ -0,0 +1,75 @@ + +# Changelog + +## 23.0.0 - 2024-08-10 + +- minor docs fixes ([PR #3217](https://github.com/benoitc/gunicorn/pull/3217), [PR #3089](https://github.com/benoitc/gunicorn/pull/3089), [PR #3167](https://github.com/benoitc/gunicorn/pull/3167)) +- worker_class parameter accepts a class ([PR #3079](https://github.com/benoitc/gunicorn/pull/3079)) +- fix deadlock if request terminated during chunked parsing ([PR #2688](https://github.com/benoitc/gunicorn/pull/2688)) +- permit receiving Transfer-Encodings: compress, deflate, gzip ([PR #3261](https://github.com/benoitc/gunicorn/pull/3261)) +- permit Transfer-Encoding headers specifying multiple encodings. note: no parameters, still ([PR #3261](https://github.com/benoitc/gunicorn/pull/3261)) +- sdist generation now explicitly excludes sphinx build folder ([PR #3257](https://github.com/benoitc/gunicorn/pull/3257)) +- decode bytes-typed status (as can be passed by gevent) as utf-8 instead of raising `TypeError` ([PR #2336](https://github.com/benoitc/gunicorn/pull/2336)) +- raise correct Exception when encounting invalid chunked requests ([PR #3258](https://github.com/benoitc/gunicorn/pull/3258)) +- the SCRIPT_NAME and PATH_INFO headers, when received from allowed forwarders, are no longer restricted for containing an underscore ([PR #3192](https://github.com/benoitc/gunicorn/pull/3192)) +- include IPv6 loopback address ``[::1]`` in default for [forwarded-allow-ips](reference/settings.md#forwarded_allow_ips) and [proxy-allow-ips](reference/settings.md#proxy_allow_ips) ([PR #3192](https://github.com/benoitc/gunicorn/pull/3192)) + +!!! note + - The SCRIPT_NAME change mitigates a regression that appeared first in the 22.0.0 release + - Review your [forwarded-allow-ips](reference/settings.md#forwarded_allow_ips) setting if you are still not seeing the SCRIPT_NAME transmitted + - Review your [forwarder-headers](reference/settings.md#forwarder_headers) setting if you are missing headers after upgrading from a version prior to 22.0.0 + + +### Breaking changes + +- refuse requests where the uri field is empty ([PR #3255](https://github.com/benoitc/gunicorn/pull/3255)) +- refuse requests with invalid CR/LR/NUL in heade field values ([PR #3253](https://github.com/benoitc/gunicorn/pull/3253)) +- remove temporary ``--tolerate-dangerous-framing`` switch from 22.0 ([PR #3260](https://github.com/benoitc/gunicorn/pull/3260)) +- If any of the breaking changes affect you, be aware that now refused requests can post a security problem, especially so in setups involving request pipe-lining and/or proxies. + +## 22.0.0 - 2024-04-17 + +- use `utime` to notify workers liveness +- migrate setup to pyproject.toml +- fix numerous security vulnerabilities in HTTP parser (closing some request smuggling vectors) +- parsing additional requests is no longer attempted past unsupported request framing +- on HTTP versions < 1.1 support for chunked transfer is refused (only used in exploits) +- requests conflicting configured or passed SCRIPT_NAME now produce a verbose error +- Trailer fields are no longer inspected for headers indicating secure scheme +- support Python 3.12 + +### Breaking changes + +- minimum version is Python 3.7 +- the limitations on valid characters in the HTTP method have been bounded to Internet Standards +- requests specifying unsupported transfer coding (order.md) are refused by default (rare.md) +- HTTP methods are no longer casefolded by default (IANA method registry contains none affected) +- HTTP methods containing the number sign (#) are no longer accepted by default (rare.md) +- HTTP versions < 1.0 or >= 2.0 are no longer accepted by default (rare, only HTTP/1.1 is supported) +- HTTP versions consisting of multiple digits or containing a prefix/suffix are no longer accepted +- HTTP header field names Gunicorn cannot safely map to variables are silently dropped, as in other software +- HTTP headers with empty field name are refused by default (no legitimate use cases, used in exploits) +- requests with both Transfer-Encoding and Content-Length are refused by default (such a message might indicate an attempt to perform request smuggling) +- empty transfer codings are no longer permitted (reportedly seen with really old & broken proxies) + + +### Security + +- fix CVE-2024-1135 + +## History + +- [2024](2024-news.md) +- [2023](2023-news.md) +- [2021](2021-news.md) +- [2020](2020-news.md) +- [2019](2019-news.md) +- [2018](2018-news.md) +- [2017](2017-news.md) +- [2016](2016-news.md) +- [2015](2015-news.md) +- [2014](2014-news.md) +- [2013](2013-news.md) +- [2012](2012-news.md) +- [2011](2011-news.md) +- [2010](2010-news.md) diff --git a/docs/content/reference/settings.md b/docs/content/reference/settings.md new file mode 100644 index 000000000..d320fcf46 --- /dev/null +++ b/docs/content/reference/settings.md @@ -0,0 +1,1605 @@ +> **Generated file** — update `gunicorn/config.py` instead. + +# Settings + +This reference is built directly from `gunicorn.config.KNOWN_SETTINGS` and is +regenerated during every documentation build. + +!!! note + Settings can be provided through the `GUNICORN_CMD_ARGS` environment + variable. For example: + + ```console + $ GUNICORN_CMD_ARGS="--bind=127.0.0.1 --workers=3" gunicorn app:app + ``` + + _Added in 19.7._ + + + + +# Config File + +## `config` + +**Command line:** `-c CONFIG`, `--config CONFIG` + +**Default:** `'./gunicorn.conf.py'` + +[The Gunicorn config file](../configure.md#configuration-file). + +A string of the form ``PATH``, ``file:PATH``, or ``python:MODULE_NAME``. + +Only has an effect when specified on the command line or as part of an +application specific configuration. + +By default, a file named ``gunicorn.conf.py`` will be read from the same +directory where gunicorn is being run. + +!!! info "Changed in 19.4" + Loading the config from a Python module requires the ``python:`` + prefix. + +## `wsgi_app` + +**Default:** `None` + +A WSGI application path in pattern ``$(MODULE_NAME):$(VARIABLE_NAME)``. + +!!! info "Added in 20.1.0" + +# Debugging + +## `reload` + +**Command line:** `--reload` + +**Default:** `False` + +Restart workers when code changes. + +This setting is intended for development. It will cause workers to be +restarted whenever application code changes. + +The reloader is incompatible with application preloading. When using a +paste configuration be sure that the server block does not import any +application code or the reload will not work as designed. + +The default behavior is to attempt inotify with a fallback to file +system polling. Generally, inotify should be preferred if available +because it consumes less system resources. + +!!! note + In order to use the inotify reloader, you must have the ``inotify`` + package installed. + +## `reload_engine` + +**Command line:** `--reload-engine STRING` + +**Default:** `'auto'` + +The implementation that should be used to power [reload](#reload). + +Valid engines are: + +* ``'auto'`` +* ``'poll'`` +* ``'inotify'`` (requires inotify) + +!!! info "Added in 19.7" + +## `reload_extra_files` + +**Command line:** `--reload-extra-file FILES` + +**Default:** `[]` + +Extends [reload](#reload) option to also watch and reload on additional files +(e.g., templates, configurations, specifications, etc.). + +!!! info "Added in 19.8" + +## `spew` + +**Command line:** `--spew` + +**Default:** `False` + +Install a trace function that spews every line executed by the server. + +This is the nuclear option. + +## `check_config` + +**Command line:** `--check-config` + +**Default:** `False` + +Check the configuration and exit. The exit status is 0 if the +configuration is correct, and 1 if the configuration is incorrect. + +## `print_config` + +**Command line:** `--print-config` + +**Default:** `False` + +Print the configuration settings as fully resolved. Implies [check-config](#check_config). + +# Logging + +## `accesslog` + +**Command line:** `--access-logfile FILE` + +**Default:** `None` + +The Access log file to write to. + +``'-'`` means log to stdout. + +## `disable_redirect_access_to_syslog` + +**Command line:** `--disable-redirect-access-to-syslog` + +**Default:** `False` + +Disable redirect access logs to syslog. + +!!! info "Added in 19.8" + +## `access_log_format` + +**Command line:** `--access-logformat STRING` + +**Default:** `'%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"'` + +The access log format. + +=========== =========== +Identifier Description +=========== =========== +h remote address +l ``'-'`` +u user name (if HTTP Basic auth used) +t date of the request +r status line (e.g. ``GET / HTTP/1.1``) +m request method +U URL path without query string +q query string +H protocol +s status +B response length +b response length or ``'-'`` (CLF format) +f referrer (note: header is ``referer``) +a user agent +T request time in seconds +M request time in milliseconds +D request time in microseconds +L request time in decimal seconds +p process ID +{header}i request header +{header}o response header +{variable}e environment variable +=========== =========== + +Use lowercase for header and environment variable names, and put +``{...}x`` names inside ``%(...)s``. For example:: + + %({x-forwarded-for}i)s + +## `errorlog` + +**Command line:** `--error-logfile FILE`, `--log-file FILE` + +**Default:** `'-'` + +The Error log file to write to. + +Using ``'-'`` for FILE makes gunicorn log to stderr. + +!!! info "Changed in 19.2" + Log to stderr by default. + +## `loglevel` + +**Command line:** `--log-level LEVEL` + +**Default:** `'info'` + +The granularity of Error log outputs. + +Valid level names are: + +* ``'debug'`` +* ``'info'`` +* ``'warning'`` +* ``'error'`` +* ``'critical'`` + +## `capture_output` + +**Command line:** `--capture-output` + +**Default:** `False` + +Redirect stdout/stderr to specified file in [errorlog](#errorlog). + +!!! info "Added in 19.6" + +## `logger_class` + +**Command line:** `--logger-class STRING` + +**Default:** `'gunicorn.glogging.Logger'` + +The logger you want to use to log events in Gunicorn. + +The default class (``gunicorn.glogging.Logger``) handles most +normal usages in logging. It provides error and access logging. + +You can provide your own logger by giving Gunicorn a Python path to a +class that quacks like ``gunicorn.glogging.Logger``. + +## `logconfig` + +**Command line:** `--log-config FILE` + +**Default:** `None` + +The log config file to use. +Gunicorn uses the standard Python logging module's Configuration +file format. + +## `logconfig_dict` + +**Default:** `{}` + +The log config dictionary to use, using the standard Python +logging module's dictionary configuration format. This option +takes precedence over the [logconfig](#logconfig) and [logconfig-json](#logconfig_json) options, +which uses the older file configuration format and JSON +respectively. + +Format: https://docs.python.org/3/library/logging.config.html#logging.config.dictConfig + +For more context you can look at the default configuration dictionary for logging, +which can be found at ``gunicorn.glogging.CONFIG_DEFAULTS``. + +!!! info "Added in 19.8" + +## `logconfig_json` + +**Command line:** `--log-config-json FILE` + +**Default:** `None` + +The log config to read config from a JSON file + +Format: https://docs.python.org/3/library/logging.config.html#logging.config.jsonConfig + +!!! info "Added in 20.0" + +## `syslog_addr` + +**Command line:** `--log-syslog-to SYSLOG_ADDR` + +**Default:** `'unix:///var/run/syslog'` + +Address to send syslog messages. + +Address is a string of the form: + +* ``unix://PATH#TYPE`` : for unix domain socket. ``TYPE`` can be ``stream`` + for the stream driver or ``dgram`` for the dgram driver. + ``stream`` is the default. +* ``udp://HOST:PORT`` : for UDP sockets +* ``tcp://HOST:PORT`` : for TCP sockets + +## `syslog` + +**Command line:** `--log-syslog` + +**Default:** `False` + +Send *Gunicorn* logs to syslog. + +!!! info "Changed in 19.8" + You can now disable sending access logs by using the + disable-redirect-access-to-syslog setting. + +## `syslog_prefix` + +**Command line:** `--log-syslog-prefix SYSLOG_PREFIX` + +**Default:** `None` + +Makes Gunicorn use the parameter as program-name in the syslog entries. + +All entries will be prefixed by ``gunicorn.``. By default the +program name is the name of the process. + +## `syslog_facility` + +**Command line:** `--log-syslog-facility SYSLOG_FACILITY` + +**Default:** `'user'` + +Syslog facility name + +## `enable_stdio_inheritance` + +**Command line:** `-R`, `--enable-stdio-inheritance` + +**Default:** `False` + +Enable stdio inheritance. + +Enable inheritance for stdio file descriptors in daemon mode. + +Note: To disable the Python stdout buffering, you can to set the user +environment variable ``PYTHONUNBUFFERED`` . + +## `statsd_host` + +**Command line:** `--statsd-host STATSD_ADDR` + +**Default:** `None` + +The address of the StatsD server to log to. + +Address is a string of the form: + +* ``unix://PATH`` : for a unix domain socket. +* ``HOST:PORT`` : for a network address + +!!! info "Added in 19.1" + +## `dogstatsd_tags` + +**Command line:** `--dogstatsd-tags DOGSTATSD_TAGS` + +**Default:** `''` + +A comma-delimited list of datadog statsd (dogstatsd) tags to append to +statsd metrics. + +!!! info "Added in 20" + +## `statsd_prefix` + +**Command line:** `--statsd-prefix STATSD_PREFIX` + +**Default:** `''` + +Prefix to use when emitting statsd metrics (a trailing ``.`` is added, +if not provided). + +!!! info "Added in 19.2" + +# Process Naming + +## `proc_name` + +**Command line:** `-n STRING`, `--name STRING` + +**Default:** `None` + +A base to use with setproctitle for process naming. + +This affects things like ``ps`` and ``top``. If you're going to be +running more than one instance of Gunicorn you'll probably want to set a +name to tell them apart. This requires that you install the setproctitle +module. + +If not set, the *default_proc_name* setting will be used. + +## `default_proc_name` + +**Default:** `'gunicorn'` + +Internal setting that is adjusted for each type of application. + +# SSL + +## `keyfile` + +**Command line:** `--keyfile FILE` + +**Default:** `None` + +SSL key file + +## `certfile` + +**Command line:** `--certfile FILE` + +**Default:** `None` + +SSL certificate file + +## `ssl_version` + +**Command line:** `--ssl-version` + +**Default:** `<_SSLMethod.PROTOCOL_TLS: 2>` + +SSL version to use (see stdlib ssl module's). + +!!! danger "Deprecated in 21.0" + The option is deprecated and it is currently ignored. Use [ssl-context](#ssl_context) instead. + +============= ============ +--ssl-version Description +============= ============ +SSLv3 SSLv3 is not-secure and is strongly discouraged. +SSLv23 Alias for TLS. Deprecated in Python 3.6, use TLS. +TLS Negotiate highest possible version between client/server. + Can yield SSL. (Python 3.6+) +TLSv1 TLS 1.0 +TLSv1_1 TLS 1.1 (Python 3.4+) +TLSv1_2 TLS 1.2 (Python 3.4+) +TLS_SERVER Auto-negotiate the highest protocol version like TLS, + but only support server-side SSLSocket connections. + (Python 3.6+) +============= ============ + +!!! info "Changed in 19.7" + The default value has been changed from ``ssl.PROTOCOL_TLSv1`` to + ``ssl.PROTOCOL_SSLv23``. + +!!! info "Changed in 20.0" + This setting now accepts string names based on ``ssl.PROTOCOL_`` + constants. + +!!! info "Changed in 20.0.1" + The default value has been changed from ``ssl.PROTOCOL_SSLv23`` to + ``ssl.PROTOCOL_TLS`` when Python >= 3.6 . + +## `cert_reqs` + +**Command line:** `--cert-reqs` + +**Default:** `` + +Whether client certificate is required (see stdlib ssl module's) + +=========== =========================== +--cert-reqs Description +=========== =========================== +`0` no client verification +`1` ssl.CERT_OPTIONAL +`2` ssl.CERT_REQUIRED +=========== =========================== + +## `ca_certs` + +**Command line:** `--ca-certs FILE` + +**Default:** `None` + +CA certificates file + +## `suppress_ragged_eofs` + +**Command line:** `--suppress-ragged-eofs` + +**Default:** `True` + +Suppress ragged EOFs (see stdlib ssl module's) + +## `do_handshake_on_connect` + +**Command line:** `--do-handshake-on-connect` + +**Default:** `False` + +Whether to perform SSL handshake on socket connect (see stdlib ssl module's) + +## `ciphers` + +**Command line:** `--ciphers` + +**Default:** `None` + +SSL Cipher suite to use, in the format of an OpenSSL cipher list. + +By default we use the default cipher list from Python's ``ssl`` module, +which contains ciphers considered strong at the time of each Python +release. + +As a recommended alternative, the Open Web App Security Project (OWASP) +offers `a vetted set of strong cipher strings rated A+ to C- +`_. +OWASP provides details on user-agent compatibility at each security level. + +See the `OpenSSL Cipher List Format Documentation +`_ +for details on the format of an OpenSSL cipher list. + +# Security + +## `limit_request_line` + +**Command line:** `--limit-request-line INT` + +**Default:** `4094` + +The maximum size of HTTP request line in bytes. + +This parameter is used to limit the allowed size of a client's +HTTP request-line. Since the request-line consists of the HTTP +method, URI, and protocol version, this directive places a +restriction on the length of a request-URI allowed for a request +on the server. A server needs this value to be large enough to +hold any of its resource names, including any information that +might be passed in the query part of a GET request. Value is a number +from 0 (unlimited) to 8190. + +This parameter can be used to prevent any DDOS attack. + +## `limit_request_fields` + +**Command line:** `--limit-request-fields INT` + +**Default:** `100` + +Limit the number of HTTP headers fields in a request. + +This parameter is used to limit the number of headers in a request to +prevent DDOS attack. Used with the *limit_request_field_size* it allows +more safety. By default this value is 100 and can't be larger than +32768. + +## `limit_request_field_size` + +**Command line:** `--limit-request-field_size INT` + +**Default:** `8190` + +Limit the allowed size of an HTTP request header field. + +Value is a positive number or 0. Setting it to 0 will allow unlimited +header field sizes. + +!!! warning + Setting this parameter to a very high or unlimited value can open + up for DDOS attacks. + +# Server Hooks + +## `on_starting` + +**Default:** + +```python +def on_starting(server): + pass +``` + +Called just before the master process is initialized. + +The callable needs to accept a single instance variable for the Arbiter. + +## `on_reload` + +**Default:** + +```python +def on_reload(server): + pass +``` + +Called to recycle workers during a reload via SIGHUP. + +The callable needs to accept a single instance variable for the Arbiter. + +## `when_ready` + +**Default:** + +```python +def when_ready(server): + pass +``` + +Called just after the server is started. + +The callable needs to accept a single instance variable for the Arbiter. + +## `pre_fork` + +**Default:** + +```python +def pre_fork(server, worker): + pass +``` + +Called just before a worker is forked. + +The callable needs to accept two instance variables for the Arbiter and +new Worker. + +## `post_fork` + +**Default:** + +```python +def post_fork(server, worker): + pass +``` + +Called just after a worker has been forked. + +The callable needs to accept two instance variables for the Arbiter and +new Worker. + +## `post_worker_init` + +**Default:** + +```python +def post_worker_init(worker): + pass +``` + +Called just after a worker has initialized the application. + +The callable needs to accept one instance variable for the initialized +Worker. + +## `worker_int` + +**Default:** + +```python +def worker_int(worker): + pass +``` + +Called just after a worker exited on SIGINT or SIGQUIT. + +The callable needs to accept one instance variable for the initialized +Worker. + +## `worker_abort` + +**Default:** + +```python +def worker_abort(worker): + pass +``` + +Called when a worker received the SIGABRT signal. + +This call generally happens on timeout. + +The callable needs to accept one instance variable for the initialized +Worker. + +## `pre_exec` + +**Default:** + +```python +def pre_exec(server): + pass +``` + +Called just before a new master process is forked. + +The callable needs to accept a single instance variable for the Arbiter. + +## `pre_request` + +**Default:** + +```python +def pre_request(worker, req): + worker.log.debug("%s %s", req.method, req.path) +``` + +Called just before a worker processes the request. + +The callable needs to accept two instance variables for the Worker and +the Request. + +## `post_request` + +**Default:** + +```python +def post_request(worker, req, environ, resp): + pass +``` + +Called after a worker processes the request. + +The callable needs to accept two instance variables for the Worker and +the Request. + +## `child_exit` + +**Default:** + +```python +def child_exit(server, worker): + pass +``` + +Called just after a worker has been exited, in the master process. + +The callable needs to accept two instance variables for the Arbiter and +the just-exited Worker. + +!!! info "Added in 19.7" + +## `worker_exit` + +**Default:** + +```python +def worker_exit(server, worker): + pass +``` + +Called just after a worker has been exited, in the worker process. + +The callable needs to accept two instance variables for the Arbiter and +the just-exited Worker. + +## `nworkers_changed` + +**Default:** + +```python +def nworkers_changed(server, new_value, old_value): + pass +``` + +Called just after *num_workers* has been changed. + +The callable needs to accept an instance variable of the Arbiter and +two integers of number of workers after and before change. + +If the number of workers is set for the first time, *old_value* would +be ``None``. + +## `on_exit` + +**Default:** + +```python +def on_exit(server): + pass +``` + +Called just before exiting Gunicorn. + +The callable needs to accept a single instance variable for the Arbiter. + +## `ssl_context` + +**Default:** + +```python +def ssl_context(config, default_ssl_context_factory): + return default_ssl_context_factory() +``` + +Called when SSLContext is needed. + +Allows customizing SSL context. + +The callable needs to accept an instance variable for the Config and +a factory function that returns default SSLContext which is initialized +with certificates, private key, cert_reqs, and ciphers according to +config and can be further customized by the callable. +The callable needs to return SSLContext object. + +Following example shows a configuration file that sets the minimum TLS version to 1.3: + +```python +def ssl_context(conf, default_ssl_context_factory): + import ssl + context = default_ssl_context_factory() + context.minimum_version = ssl.TLSVersion.TLSv1_3 + return context +``` + +!!! info "Added in 21.0" + +# Server Mechanics + +## `preload_app` + +**Command line:** `--preload` + +**Default:** `False` + +Load application code before the worker processes are forked. + +By preloading an application you can save some RAM resources as well as +speed up server boot times. Although, if you defer application loading +to each worker process, you can reload your application code easily by +restarting workers. + +## `sendfile` + +**Command line:** `--no-sendfile` + +**Default:** `None` + +Disables the use of ``sendfile()``. + +If not set, the value of the ``SENDFILE`` environment variable is used +to enable or disable its usage. + +!!! info "Added in 19.2" + +!!! info "Changed in 19.4" + Swapped ``--sendfile`` with ``--no-sendfile`` to actually allow + disabling. + +!!! info "Changed in 19.6" + added support for the ``SENDFILE`` environment variable + +## `reuse_port` + +**Command line:** `--reuse-port` + +**Default:** `False` + +Set the ``SO_REUSEPORT`` flag on the listening socket. + +!!! info "Added in 19.8" + +## `chdir` + +**Command line:** `--chdir` + +**Default:** + +``'.'`` + +Change directory to specified directory before loading apps. + +## `daemon` + +**Command line:** `-D`, `--daemon` + +**Default:** `False` + +Daemonize the Gunicorn process. + +Detaches the server from the controlling terminal and enters the +background. + +## `raw_env` + +**Command line:** `-e ENV`, `--env ENV` + +**Default:** `[]` + +Set environment variables in the execution environment. + +Should be a list of strings in the ``key=value`` format. + +For example on the command line: + +```console +$ gunicorn -b 127.0.0.1:8000 --env FOO=1 test:app +``` + +Or in the configuration file: + +```python +raw_env = ["FOO=1"] +``` + +## `pidfile` + +**Command line:** `-p FILE`, `--pid FILE` + +**Default:** `None` + +A filename to use for the PID file. + +If not set, no PID file will be written. + +## `worker_tmp_dir` + +**Command line:** `--worker-tmp-dir DIR` + +**Default:** `None` + +A directory to use for the worker heartbeat temporary file. + +If not set, the default temporary directory will be used. + +!!! note + The current heartbeat system involves calling ``os.fchmod`` on + temporary file handlers and may block a worker for arbitrary time + if the directory is on a disk-backed filesystem. + + See [blocking-os-fchmod](#blocking_os_fchmod) for more detailed information + and a solution for avoiding this problem. + +## `user` + +**Command line:** `-u USER`, `--user USER` + +**Default:** + +``os.geteuid()`` + +Switch worker processes to run as this user. + +A valid user id (as an integer) or the name of a user that can be +retrieved with a call to ``pwd.getpwnam(value)`` or ``None`` to not +change the worker process user. + +## `group` + +**Command line:** `-g GROUP`, `--group GROUP` + +**Default:** + +``os.getegid()`` + +Switch worker process to run as this group. + +A valid group id (as an integer) or the name of a user that can be +retrieved with a call to ``grp.getgrnam(value)`` or ``None`` to not +change the worker processes group. + +## `umask` + +**Command line:** `-m INT`, `--umask INT` + +**Default:** `0` + +A bit mask for the file mode on files written by Gunicorn. + +Note that this affects unix socket permissions. + +A valid value for the ``os.umask(mode)`` call or a string compatible +with ``int(value, 0)`` (``0`` means Python guesses the base, so values +like ``0``, ``0xFF``, ``0022`` are valid for decimal, hex, and octal +representations) + +## `initgroups` + +**Command line:** `--initgroups` + +**Default:** `False` + +If true, set the worker process's group access list with all of the +groups of which the specified username is a member, plus the specified +group id. + +!!! info "Added in 19.7" + +## `tmp_upload_dir` + +**Default:** `None` + +Directory to store temporary request data as they are read. + +This may disappear in the near future. + +This path should be writable by the process permissions set for Gunicorn +workers. If not specified, Gunicorn will choose a system generated +temporary directory. + +## `secure_scheme_headers` + +**Default:** `{'X-FORWARDED-PROTOCOL': 'ssl', 'X-FORWARDED-PROTO': 'https', 'X-FORWARDED-SSL': 'on'}` + +A dictionary containing headers and values that the front-end proxy +uses to indicate HTTPS requests. If the source IP is permitted by +[forwarded-allow-ips](#forwarded_allow_ips) (below), *and* at least one request header matches +a key-value pair listed in this dictionary, then Gunicorn will set +``wsgi.url_scheme`` to ``https``, so your application can tell that the +request is secure. + +If the other headers listed in this dictionary are not present in the request, they will be ignored, +but if the other headers are present and do not match the provided values, then +the request will fail to parse. See the note below for more detailed examples of this behaviour. + +The dictionary should map upper-case header names to exact string +values. The value comparisons are case-sensitive, unlike the header +names, so make sure they're exactly what your front-end proxy sends +when handling HTTPS requests. + +It is important that your front-end proxy configuration ensures that +the headers defined here can not be passed directly from the client. + +## `forwarded_allow_ips` + +**Command line:** `--forwarded-allow-ips STRING` + +**Default:** `'127.0.0.1,::1'` + +Front-end's IPs from which allowed to handle set secure headers. +(comma separated). + +Set to ``*`` to disable checking of front-end IPs. This is useful for setups +where you don't know in advance the IP address of front-end, but +instead have ensured via other means that only your +authorized front-ends can access Gunicorn. + +By default, the value of the ``FORWARDED_ALLOW_IPS`` environment +variable. If it is not defined, the default is ``"127.0.0.1,::1"``. + +!!! note + This option does not affect UNIX socket connections. Connections not associated with + an IP address are treated as allowed, unconditionally. + +!!! note + The interplay between the request headers, the value of ``forwarded_allow_ips``, and the value of + ``secure_scheme_headers`` is complex. Various scenarios are documented below to further elaborate. + In each case, we have a request from the remote address 134.213.44.18, and the default value of + ``secure_scheme_headers``: + + .. code:: + + secure_scheme_headers = { + 'X-FORWARDED-PROTOCOL': 'ssl', + 'X-FORWARDED-PROTO': 'https', + 'X-FORWARDED-SSL': 'on' + } + + .. list-table:: + :header-rows: 1 + :align: center + :widths: auto + + * - ``forwarded-allow-ips`` + - Secure Request Headers + - Result + - Explanation + * - .. code:: + + ["127.0.0.1"] + - .. code:: + + X-Forwarded-Proto: https + - .. code:: + + wsgi.url_scheme = "http" + - IP address was not allowed + * - .. code:: + + "*" + - + - .. code:: + + wsgi.url_scheme = "http" + - IP address allowed, but no secure headers provided + * - .. code:: + + "*" + - .. code:: + + X-Forwarded-Proto: https + - .. code:: + + wsgi.url_scheme = "https" + - IP address allowed, one request header matched + * - .. code:: + + ["134.213.44.18"] + - .. code:: + + X-Forwarded-Ssl: on + X-Forwarded-Proto: http + - ``InvalidSchemeHeaders()`` raised + - IP address allowed, but the two secure headers disagreed on if HTTPS was used + +## `pythonpath` + +**Command line:** `--pythonpath STRING` + +**Default:** `None` + +A comma-separated list of directories to add to the Python path. + +e.g. +``'/home/djangoprojects/myproject,/home/python/mylibrary'``. + +## `paste` + +**Command line:** `--paste STRING`, `--paster STRING` + +**Default:** `None` + +Load a PasteDeploy config file. The argument may contain a ``#`` +symbol followed by the name of an app section from the config file, +e.g. ``production.ini#admin``. + +At this time, using alternate server blocks is not supported. Use the +command line arguments to control server configuration instead. + +## `proxy_protocol` + +**Command line:** `--proxy-protocol` + +**Default:** `False` + +Enable detect PROXY protocol (PROXY mode). + +Allow using HTTP and Proxy together. It may be useful for work with +stunnel as HTTPS frontend and Gunicorn as HTTP server. + +PROXY protocol: http://haproxy.1wt.eu/download/1.5/doc/proxy-protocol.txt + +Example for stunnel config:: + + [https] + protocol = proxy + accept = 443 + connect = 80 + cert = /etc/ssl/certs/stunnel.pem + key = /etc/ssl/certs/stunnel.key + +## `proxy_allow_ips` + +**Command line:** `--proxy-allow-from` + +**Default:** `'127.0.0.1,::1'` + +Front-end's IPs from which allowed accept proxy requests (comma separated). + +Set to ``*`` to disable checking of front-end IPs. This is useful for setups +where you don't know in advance the IP address of front-end, but +instead have ensured via other means that only your +authorized front-ends can access Gunicorn. + +!!! note + This option does not affect UNIX socket connections. Connections not associated with + an IP address are treated as allowed, unconditionally. + +## `protocol` + +**Command line:** `--protocol STRING` + +**Default:** `'http'` + +The protocol for incoming connections. + +* ``http`` - Standard HTTP/1.x (default) +* ``uwsgi`` - uWSGI binary protocol (for nginx uwsgi_pass) + +When using the uWSGI protocol, Gunicorn can receive requests from +nginx using the uwsgi_pass directive:: + + upstream gunicorn { + server 127.0.0.1:8000; + } + location / { + uwsgi_pass gunicorn; + include uwsgi_params; + } + +## `uwsgi_allow_ips` + +**Command line:** `--uwsgi-allow-from` + +**Default:** `'127.0.0.1,::1'` + +IPs allowed to send uWSGI protocol requests (comma separated). + +Set to ``*`` to allow all IPs. This is useful for setups where you +don't know in advance the IP address of front-end, but instead have +ensured via other means that only your authorized front-ends can +access Gunicorn. + +!!! note + This option does not affect UNIX socket connections. Connections not associated with + an IP address are treated as allowed, unconditionally. + +## `raw_paste_global_conf` + +**Command line:** `--paste-global CONF` + +**Default:** `[]` + +Set a PasteDeploy global config variable in ``key=value`` form. + +The option can be specified multiple times. + +The variables are passed to the PasteDeploy entrypoint. Example:: + + $ gunicorn -b 127.0.0.1:8000 --paste development.ini --paste-global FOO=1 --paste-global BAR=2 + +!!! info "Added in 19.7" + +## `permit_obsolete_folding` + +**Command line:** `--permit-obsolete-folding` + +**Default:** `False` + +Permit requests employing obsolete HTTP line folding mechanism + +The folding mechanism was deprecated by rfc7230 Section 3.2.4 and will not be + employed in HTTP request headers from standards-compliant HTTP clients. + +This option is provided to diagnose backwards-incompatible changes. +Use with care and only if necessary. Temporary; the precise effect of this option may +change in a future version, or it may be removed altogether. + +!!! info "Added in 23.0.0" + +## `strip_header_spaces` + +**Command line:** `--strip-header-spaces` + +**Default:** `False` + +Strip spaces present between the header name and the the ``:``. + +This is known to induce vulnerabilities and is not compliant with the HTTP/1.1 standard. +See https://portswigger.net/research/http-desync-attacks-request-smuggling-reborn. + +Use with care and only if necessary. Deprecated; scheduled for removal in 25.0.0 + +!!! info "Added in 20.0.1" + +## `permit_unconventional_http_method` + +**Command line:** `--permit-unconventional-http-method` + +**Default:** `False` + +Permit HTTP methods not matching conventions, such as IANA registration guidelines + +This permits request methods of length less than 3 or more than 20, +methods with lowercase characters or methods containing the # character. +HTTP methods are case sensitive by definition, and merely uppercase by convention. + +If unset, Gunicorn will apply nonstandard restrictions and cause 400 response status +in cases where otherwise 501 status is expected. While this option does modify that +behaviour, it should not be depended upon to guarantee standards-compliant behaviour. +Rather, it is provided temporarily, to assist in diagnosing backwards-incompatible +changes around the incomplete application of those restrictions. + +Use with care and only if necessary. Temporary; scheduled for removal in 24.0.0 + +!!! info "Added in 22.0.0" + +## `permit_unconventional_http_version` + +**Command line:** `--permit-unconventional-http-version` + +**Default:** `False` + +Permit HTTP version not matching conventions of 2023 + +This disables the refusal of likely malformed request lines. +It is unusual to specify HTTP 1 versions other than 1.0 and 1.1. + +This option is provided to diagnose backwards-incompatible changes. +Use with care and only if necessary. Temporary; the precise effect of this option may +change in a future version, or it may be removed altogether. + +!!! info "Added in 22.0.0" + +## `casefold_http_method` + +**Command line:** `--casefold-http-method` + +**Default:** `False` + +Transform received HTTP methods to uppercase + +HTTP methods are case sensitive by definition, and merely uppercase by convention. + +This option is provided because previous versions of gunicorn defaulted to this behaviour. + +Use with care and only if necessary. Deprecated; scheduled for removal in 24.0.0 + +!!! info "Added in 22.0.0" + +## `forwarder_headers` + +**Command line:** `--forwarder-headers` + +**Default:** `'SCRIPT_NAME,PATH_INFO'` + +A list containing upper-case header field names that the front-end proxy +(see [forwarded-allow-ips](#forwarded_allow_ips)) sets, to be used in WSGI environment. + +This option has no effect for headers not present in the request. + +This option can be used to transfer ``SCRIPT_NAME``, ``PATH_INFO`` +and ``REMOTE_USER``. + +It is important that your front-end proxy configuration ensures that +the headers defined here can not be passed directly from the client. + +## `header_map` + +**Command line:** `--header-map` + +**Default:** `'drop'` + +Configure how header field names are mapped into environ + +Headers containing underscores are permitted by RFC9110, +but gunicorn joining headers of different names into +the same environment variable will dangerously confuse applications as to which is which. + +The safe default ``drop`` is to silently drop headers that cannot be unambiguously mapped. +The value ``refuse`` will return an error if a request contains *any* such header. +The value ``dangerous`` matches the previous, not advisable, behaviour of mapping different +header field names into the same environ name. + +If the source is permitted as explained in [forwarded-allow-ips](#forwarded_allow_ips), *and* the header name is +present in [forwarder-headers](#forwarder_headers), the header is mapped into environment regardless of +the state of this setting. + +Use with care and only if necessary and after considering if your problem could +instead be solved by specifically renaming or rewriting only the intended headers +on a proxy in front of Gunicorn. + +!!! info "Added in 22.0.0" + +## `root_path` + +**Command line:** `--root-path STRING` + +**Default:** `''` + +The root path for ASGI applications. + +This is used to set the ``root_path`` in the ASGI scope, which +allows applications to know their mount point when behind a +reverse proxy. + +For example, if your application is mounted at ``/api``, set +this to ``/api``. + +!!! info "Added in 24.0.0" + +# Server Socket + +## `bind` + +**Command line:** `-b ADDRESS`, `--bind ADDRESS` + +**Default:** `['127.0.0.1:8000']` + +The socket to bind. + +A string of the form: ``HOST``, ``HOST:PORT``, ``unix:PATH``, +``fd://FD``. An IP is a valid ``HOST``. + +!!! info "Changed in 20.0" + Support for ``fd://FD`` got added. + +Multiple addresses can be bound. ex.:: + + $ gunicorn -b 127.0.0.1:8000 -b [::1]:8000 test:app + +will bind the `test:app` application on localhost both on ipv6 +and ipv4 interfaces. + +If the ``PORT`` environment variable is defined, the default +is ``['0.0.0.0:$PORT']``. If it is not defined, the default +is ``['127.0.0.1:8000']``. + +## `backlog` + +**Command line:** `--backlog INT` + +**Default:** `2048` + +The maximum number of pending connections. + +This refers to the number of clients that can be waiting to be served. +Exceeding this number results in the client getting an error when +attempting to connect. It should only affect servers under significant +load. + +Must be a positive integer. Generally set in the 64-2048 range. + +# Worker Processes + +## `workers` + +**Command line:** `-w INT`, `--workers INT` + +**Default:** `1` + +The number of worker processes for handling requests. + +A positive integer generally in the ``2-4 x $(NUM_CORES)`` range. +You'll want to vary this a bit to find the best for your particular +application's work load. + +By default, the value of the ``WEB_CONCURRENCY`` environment variable, +which is set by some Platform-as-a-Service providers such as Heroku. If +it is not defined, the default is ``1``. + +## `worker_class` + +**Command line:** `-k STRING`, `--worker-class STRING` + +**Default:** `'sync'` + +The type of workers to use. + +The default class (``sync``) should handle most "normal" types of +workloads. You'll want to read :doc:`design` for information on when +you might want to choose one of the other worker classes. Required +libraries may be installed using setuptools' ``extras_require`` feature. + +A string referring to one of the following bundled classes: + +* ``sync`` +* ``eventlet`` - Requires eventlet >= 0.24.1 (or install it via + ``pip install gunicorn[eventlet]``) +* ``gevent`` - Requires gevent >= 1.4 (or install it via + ``pip install gunicorn[gevent]``) +* ``tornado`` - Requires tornado >= 0.2 (or install it via + ``pip install gunicorn[tornado]``) +* ``gthread`` - Python 2 requires the futures package to be installed + (or install it via ``pip install gunicorn[gthread]``) + +Optionally, you can provide your own worker by giving Gunicorn a +Python path to a subclass of ``gunicorn.workers.base.Worker``. +This alternative syntax will load the gevent class: +``gunicorn.workers.ggevent.GeventWorker``. + +## `threads` + +**Command line:** `--threads INT` + +**Default:** `1` + +The number of worker threads for handling requests. + +Run each worker with the specified number of threads. + +A positive integer generally in the ``2-4 x $(NUM_CORES)`` range. +You'll want to vary this a bit to find the best for your particular +application's work load. + +If it is not defined, the default is ``1``. + +This setting only affects the Gthread worker type. + +!!! note + If you try to use the ``sync`` worker type and set the ``threads`` + setting to more than 1, the ``gthread`` worker type will be used + instead. + +## `worker_connections` + +**Command line:** `--worker-connections INT` + +**Default:** `1000` + +The maximum number of simultaneous clients. + +This setting only affects the ``gthread``, ``eventlet`` and ``gevent`` worker types. + +## `max_requests` + +**Command line:** `--max-requests INT` + +**Default:** `0` + +The maximum number of requests a worker will process before restarting. + +Any value greater than zero will limit the number of requests a worker +will process before automatically restarting. This is a simple method +to help limit the damage of memory leaks. + +If this is set to zero (the default) then the automatic worker +restarts are disabled. + +## `max_requests_jitter` + +**Command line:** `--max-requests-jitter INT` + +**Default:** `0` + +The maximum jitter to add to the *max_requests* setting. + +The jitter causes the restart per worker to be randomized by +``randint(0, max_requests_jitter)``. This is intended to stagger worker +restarts to avoid all workers restarting at the same time. + +!!! info "Added in 19.2" + +## `timeout` + +**Command line:** `-t INT`, `--timeout INT` + +**Default:** `30` + +Workers silent for more than this many seconds are killed and restarted. + +Value is a positive number or 0. Setting it to 0 has the effect of +infinite timeouts by disabling timeouts for all workers entirely. + +Generally, the default of thirty seconds should suffice. Only set this +noticeably higher if you're sure of the repercussions for sync workers. +For the non sync workers it just means that the worker process is still +communicating and is not tied to the length of time required to handle a +single request. + +## `graceful_timeout` + +**Command line:** `--graceful-timeout INT` + +**Default:** `30` + +Timeout for graceful workers restart in seconds. + +After receiving a restart signal, workers have this much time to finish +serving requests. Workers still alive after the timeout (starting from +the receipt of the restart signal) are force killed. + +## `keepalive` + +**Command line:** `--keep-alive INT` + +**Default:** `2` + +The number of seconds to wait for requests on a Keep-Alive connection. + +Generally set in the 1-5 seconds range for servers with direct connection +to the client (e.g. when you don't have separate load balancer). When +Gunicorn is deployed behind a load balancer, it often makes sense to +set this to a higher value. + +!!! note + ``sync`` worker does not support persistent connections and will + ignore this option. + +## `asgi_loop` + +**Command line:** `--asgi-loop STRING` + +**Default:** `'auto'` + +Event loop implementation for ASGI workers. + +- auto: Use uvloop if available, otherwise asyncio +- asyncio: Use Python's built-in asyncio event loop +- uvloop: Use uvloop (must be installed separately) + +This setting only affects the ``asgi`` worker type. + +uvloop typically provides better performance but requires +installing the uvloop package. + +!!! info "Added in 24.0.0" + +## `asgi_lifespan` + +**Command line:** `--asgi-lifespan STRING` + +**Default:** `'auto'` + +Control ASGI lifespan protocol handling. + +- auto: Detect if app supports lifespan, enable if so +- on: Always run lifespan protocol (fail if unsupported) +- off: Never run lifespan protocol + +The lifespan protocol allows ASGI applications to run code at +startup and shutdown. This is essential for frameworks like +FastAPI that need to initialize database connections, caches, +or other resources. + +This setting only affects the ``asgi`` worker type. + +!!! info "Added in 24.0.0" diff --git a/docs/content/run.md b/docs/content/run.md new file mode 100644 index 000000000..a727c1c4b --- /dev/null +++ b/docs/content/run.md @@ -0,0 +1,154 @@ +# Running Gunicorn + +You can run Gunicorn directly from the command line or integrate it with +popular frameworks like Django, Pyramid, or TurboGears. For deployment +patterns see the [deployment guide](deploy.md). + +## Commands + +After installation you have access to the `gunicorn` executable. + + +### `gunicorn` + +Basic usage: + +```bash +gunicorn [OPTIONS] [WSGI_APP] +``` + +`WSGI_APP` follows the pattern `MODULE_NAME:VARIABLE_NAME`. The module can be a +full dotted path. The variable refers to a WSGI callable defined in that +module. + +!!! info "Changed in 20.1.0" + `WSGI_APP` can be omitted when defined in a [configuration file](configure.md). + + + +Example test application: + +```python +def app(environ, start_response): + """Simplest possible application object""" + data = b"Hello, World!\n" + status = "200 OK" + response_headers = [ + ("Content-type", "text/plain"), + ("Content-Length", str(len(data.md))) + ] + start_response(status, response_headers) + return iter([data]) +``` + +Run it with: + +```bash +gunicorn --workers=2 test:app +``` + +You can also expose a factory function that returns the application: + +```python +def create_app(): + app = FrameworkApp() + ... + return app +``` + +```bash +gunicorn --workers=2 'test:create_app()' +``` + +Passing positional and keyword arguments is supported but prefer +configuration files or environment variables for anything beyond quick tests. + +#### Commonly used arguments + +- `-c CONFIG`, `--config CONFIG` — configuration file (`PATH`, `file:PATH`, or + `python:MODULE_NAME`). +- `-b BIND`, `--bind BIND` — socket to bind (host, host:port, `fd://FD`, + or `unix:PATH`). +- `-w WORKERS`, `--workers WORKERS` — number of worker processes, typically + two to four per CPU core. See the [FAQ](faq.md) for tuning tips. +- `-k WORKERCLASS`, `--worker-class WORKERCLASS` — worker type (`sync`, + `eventlet`, `gevent`, `tornado`, `gthread`). Read the + [settings entry](reference/settings.md#worker_class) before switching classes. +- `-n APP_NAME`, `--name APP_NAME` — set the process name (requires + [`setproctitle`](https://pypi.python.org/pypi/setproctitle)). + +You can pass any setting via the environment variable +`GUNICORN_CMD_ARGS`. See the [configuration guide](configure.md) and +[settings reference](reference/settings.md) for details. + +## Integration + +Gunicorn integrates cleanly with Django and Paste Deploy applications. + +### Django + +Gunicorn looks for a WSGI callable named `application`. A typical invocation is: + +```bash +gunicorn myproject.wsgi +``` + +!!! note + Ensure your project is on `PYTHONPATH`. The easiest way is to run this command + from the directory containing `manage.py`. + + + +Set environment variables with `--env` and add your project to `PYTHONPATH` +if needed: + +```bash +gunicorn --env DJANGO_SETTINGS_MODULE=myproject.settings myproject.wsgi +``` + +See [`raw_env`](reference/settings.md#raw_env) and [`pythonpath`](reference/settings.md#pythonpath) for +more options. + +### Paste Deployment + +Frameworks such as Pyramid and TurboGears often rely on Paste Deployment +configuration. You can use Gunicorn in two ways. + +#### As a Paste server runner + +Let your framework command (for example `pserve` or `gearbox`) load Gunicorn by +configuring it as the server: + +```ini +[server:main] +use = egg:gunicorn#main +host = 127.0.0.1 +port = 8080 +workers = 3 +``` + +This approach is quick to set up but Gunicorn cannot control how the +application loads. Options like [`reload`](reference/settings.md#reload) will be ignored and +hot upgrades are unavailable. Features such as daemon mode may conflict with +what your framework already provides. Prefer running those features through the +framework (for example `pserve --reload`). Advanced configuration is still +possible by pointing the `config` key at a Gunicorn configuration file. + +#### Using Gunicorn's Paste support + +Use the [`paste`](reference/settings.md#paste) option to load a Paste configuration directly +with the Gunicorn CLI. This unlocks Gunicorn's reloader and hot code upgrades, +while still letting Paste define the application object. + +```bash +gunicorn --paste development.ini -b :8080 --chdir /path/to/project +``` + +Select a different application section by appending the name: + +```bash +gunicorn --paste development.ini#admin -b :8080 --chdir /path/to/project +``` + +In both modes Gunicorn will honor any Paste `loggers` configuration unless you +override it with Gunicorn-specific [logging settings](reference/settings.md#logging). diff --git a/docs/content/signals.md b/docs/content/signals.md new file mode 100644 index 000000000..ce08ca099 --- /dev/null +++ b/docs/content/signals.md @@ -0,0 +1,97 @@ + +# Signal Handling + +A quick reference to the signals handled by Gunicorn. This includes the signals +used internally to coordinate with worker processes. + +## Master process + +- `QUIT`, `INT` — quick shutdown. +- `TERM` — graceful shutdown; waits for workers to finish requests up to + [`graceful_timeout`](reference/settings.md#graceful_timeout). +- `HUP` — reload configuration, spawn new workers, and gracefully stop old + ones. If the app is not preloaded (see [`preload_app`](reference/settings.md#preload_app)) + the application code is reloaded too. +- `TTIN` — increase worker count by one. +- `TTOU` — decrease worker count by one. +- `USR1` — reopen log files. +- `USR2` — perform a binary upgrade. Send `TERM` to the old master afterwards + to stop it. This also reloads preloaded applications (see + [binary upgrades](#binary-upgrade)). +- `WINCH` — gracefully stop workers when Gunicorn runs as a daemon. + +## Worker process + +Workers rarely need direct signalling—if the master stays alive it will respawn +workers automatically. + +- `QUIT`, `INT` — quick shutdown. +- `TERM` — graceful shutdown. +- `USR1` — reopen log files. + +## Reload the configuration + +Use `HUP` to reload Gunicorn on the fly: + +```text +2013-06-29 06:26:55 [20682] [INFO] Handling signal: hup +2013-06-29 06:26:55 [20682] [INFO] Hang up: Master +2013-06-29 06:26:55 [20703] [INFO] Booting worker with pid: 20703 +2013-06-29 06:26:55 [20702] [INFO] Booting worker with pid: 20702 +2013-06-29 06:26:55 [20688] [INFO] Worker exiting (pid: 20688) +2013-06-29 06:26:55 [20687] [INFO] Worker exiting (pid: 20687) +2013-06-29 06:26:55 [20689] [INFO] Worker exiting (pid: 20689) +2013-06-29 06:26:55 [20704] [INFO] Booting worker with pid: 20704 +``` + +Gunicorn reloads its settings, starts new workers, and gracefully shuts down the +previous ones. If the app is not preloaded it reloads the application module as +well. + + +## Upgrading to a new binary on the fly + +!!! info "Changed in 19.6.0" + PID files now follow the pattern `.pid.2` instead of `.pid.oldbin`. + + + +You can replace the Gunicorn binary without downtime. Incoming requests remain +served and preloaded applications reload. + +1. Replace the old binary and send `USR2` to the master. Gunicorn starts a new + master whose PID file ends with `.2` and spawns new workers. + + ```text + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 20844 benoitc 20 0 54808 11m 3352 S 0.0 0.1 0:00.36 gunicorn: master [test:app] + 20849 benoitc 20 0 54808 9.9m 1500 S 0.0 0.1 0:00.02 gunicorn: worker [test:app] + 20850 benoitc 20 0 54808 9.9m 1500 S 0.0 0.1 0:00.01 gunicorn: worker [test:app] + 20851 benoitc 20 0 54808 9.9m 1500 S 0.0 0.1 0:00.01 gunicorn: worker [test:app] + 20854 benoitc 20 0 55748 12m 3348 S 0.0 0.2 0:00.35 gunicorn: master [test:app] + 20859 benoitc 20 0 55748 11m 1500 S 0.0 0.1 0:00.01 gunicorn: worker [test:app] + 20860 benoitc 20 0 55748 11m 1500 S 0.0 0.1 0:00.00 gunicorn: worker [test:app] + 20861 benoitc 20 0 55748 11m 1500 S 0.0 0.1 0:00.01 gunicorn: worker [test:app] + ``` + +2. Send `WINCH` to the old master to gracefully stop its workers. + +You can still roll back while the old master keeps its listen sockets: + +1. Send `HUP` to the old master to restart its workers without reloading the + config file. +2. Send `TERM` to the new master to shut down its workers gracefully. +3. Send `QUIT` to the new master to force it to exit. + +If the new workers linger, send `KILL` after the new master quits. + +To complete the upgrade, send `TERM` to the old master so only the new server +continues running: + +```text +PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND +20854 benoitc 20 0 55748 12m 3348 S 0.0 0.2 0:00.45 gunicorn: master [test:app] +20859 benoitc 20 0 55748 11m 1500 S 0.0 0.1 0:00.02 gunicorn: worker [test:app] +20860 benoitc 20 0 55748 11m 1500 S 0.0 0.1 0:00.02 gunicorn: worker [test:app] +20861 benoitc 20 0 55748 11m 1500 S 0.0 0.1 0:00.01 gunicorn: worker [test:app] +``` diff --git a/docs/content/styles/overrides.css b/docs/content/styles/overrides.css new file mode 100644 index 000000000..7cf82930d --- /dev/null +++ b/docs/content/styles/overrides.css @@ -0,0 +1,192 @@ +:root { + --gunicorn-green: #1d692d; + --gunicorn-green-dark: #14501f; + --gunicorn-green-light: #2a8729; + --gunicorn-cream: #f6f6f1; + --md-primary-fg-color: var(--gunicorn-green-light); + --md-primary-fg-color--light: #3da843; + --md-primary-fg-color--dark: var(--gunicorn-green-dark); + --md-accent-fg-color: var(--gunicorn-green); +} + +[data-md-color-scheme="slate"] { + --gunicorn-cream: #1d1f1d; + --md-primary-fg-color: var(--gunicorn-green); + --md-primary-fg-color--light: #3da843; + --md-primary-fg-color--dark: var(--gunicorn-green-dark); + --md-accent-fg-color: var(--gunicorn-green-light); +} + +.md-header__button.md-logo svg { + height: 1.8rem; +} + +.md-typeset .hero { + margin: 2rem 0 3rem; + padding: 3.5rem; + background: linear-gradient(135deg, rgba(29, 105, 45, 0.96), rgba(42, 135, 41, 0.85)); + color: #fff; + border-radius: 18px; + box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12); +} + +[data-md-color-scheme="slate"] .md-typeset .hero { + background: linear-gradient(135deg, rgba(20, 80, 31, 0.95), rgba(29, 105, 45, 0.88)); + box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4); +} + +.md-typeset .hero__inner { + display: flex; + flex-wrap: wrap; + gap: 2.5rem; + align-items: center; + justify-content: space-between; +} + +.md-typeset .hero__copy { + flex: 1 1 320px; + max-width: 520px; + font-size: 1.05rem; + line-height: 1.6; +} + +.md-typeset .hero__copy h1 { + margin: 0 0 1rem; + font-size: 2.6rem; + font-weight: 700; + line-height: 1.2; +} + +.md-typeset .hero__cta { + margin-top: 1.75rem; + display: flex; + flex-wrap: wrap; + gap: 0.75rem; +} + +.md-typeset .hero__code { + flex: 1 1 260px; + max-width: 420px; + background: rgba(255, 255, 255, 0.08); + border-radius: 14px; + padding: 1.5rem; + backdrop-filter: blur(4px); + font-size: 0.95rem; +} + +[data-md-color-scheme="slate"] .md-typeset .hero__code { + background: rgba(0, 0, 0, 0.35); +} + +.md-typeset .hero__code pre { + margin: 0 0 1rem; + border: none; + background: rgba(0, 0, 0, 0.35); + color: #e8f5ea; +} + +[data-md-color-scheme="slate"] .md-typeset .hero__code pre { + background: rgba(0, 0, 0, 0.55); +} + +.md-typeset .hero__version { + font-weight: 600; + letter-spacing: 0.01em; +} + +.md-typeset .feature-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); + gap: 1.6rem; + margin: 2.5rem 0 3rem; +} + +.md-typeset .feature-card { + background: var(--gunicorn-cream); + border-radius: 14px; + padding: 1.5rem; + border: 1px solid rgba(0, 0, 0, 0.05); + box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); + transition: transform 0.2s ease, box-shadow 0.2s ease; +} + +[data-md-color-scheme="slate"] .md-typeset .feature-card { + background: rgba(45, 48, 45, 0.9); + border: 1px solid rgba(255, 255, 255, 0.05); + box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35); +} + +.md-typeset .feature-card h3 { + margin-top: 0; + font-size: 1.3rem; + color: var(--gunicorn-green-dark); +} + +[data-md-color-scheme="slate"] .md-typeset .feature-card h3 { + color: var(--gunicorn-cream); +} + +.md-typeset .feature-card a { + display: inline-flex; + align-items: center; + gap: 0.35rem; + font-weight: 600; + color: var(--gunicorn-green); +} + +.md-typeset .feature-card:hover { + transform: translateY(-4px); + box-shadow: 0 18px 36px rgba(0, 0, 0, 0.12); +} + +.md-typeset .feature-card:hover a::after { + content: '\\2192'; + opacity: 1; + transform: translateX(4px); +} + +.md-typeset .feature-card a::after { + content: '\\2192'; + opacity: 0; + transition: opacity 0.2s ease, transform 0.2s ease; + transform: translateX(0); +} + +@media (max-width: 960px) { + .md-typeset .hero { + padding: 2.25rem; + } + + .md-typeset .hero__copy h1 { + font-size: 2.2rem; + } +} + +@media (max-width: 720px) { + .md-typeset .hero { + margin-top: 1.5rem; + padding: 1.75rem; + } + + .md-typeset .hero__cta { + flex-direction: column; + align-items: stretch; + } + + .md-typeset .hero__code { + width: 100%; + } +} + +.md-footer-meta__inner { + flex-wrap: wrap; +} + +.md-typeset .hero__logo { + height: 64px; + margin-bottom: 1.25rem; +} + +[data-md-color-scheme="slate"] .md-typeset .hero__logo { + filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.35)); +} diff --git a/docs/macros.py b/docs/macros.py new file mode 100644 index 000000000..093476ee7 --- /dev/null +++ b/docs/macros.py @@ -0,0 +1,11 @@ +from importlib import import_module + +def define_env(env): + """Register template variables for MkDocs macros.""" + gunicorn = import_module("gunicorn") + env.variables.update( + release=gunicorn.__version__, + version=gunicorn.__version__, + github_repo="https://github.com/benoitc/gunicorn", + pypi_url=f"https://pypi.org/project/gunicorn/{gunicorn.__version__}/", + ) diff --git a/docs/modernization-plan.md b/docs/modernization-plan.md new file mode 100644 index 000000000..6c04bb4d0 --- /dev/null +++ b/docs/modernization-plan.md @@ -0,0 +1,35 @@ +# Website Modernization Plan + +## Goals +- Serve a single, canonical domain backed by a static MkDocs build. +- Keep the documentation authoring experience entirely in Markdown. +- Modernize the marketing home page with a refreshed visual identity. +- Preserve the generated settings reference sourced from Python code. + +## Architecture Overview +- **Static site generator:** MkDocs with the Material theme. +- **Content layout:** Markdown files in `docs/content/`, grouped by guides, reference, and news archives. +- **Styling:** Lightweight CSS overrides in `docs/content/styles/overrides.css` for hero, feature cards, and color palette. +- **Dynamic data:** `docs/macros.py` exposes the Gunicorn version, while `scripts/build_settings_doc.py` renders the settings reference into Markdown during every build. +- **Assets:** SVG mascot and hero art live under `docs/content/assets/` so both the homepage and docs share the same branding. + +## Completed Work +- Removed Sphinx configuration, themes, and the legacy static snapshot under `docs/site/`. +- Converted the entire content library (guides, FAQ, design notes, yearly news) from MyST/RST to MkDocs-friendly Markdown. +- Rebuilt the homepage using Material’s layout primitives with responsive hero, CTAs, and feature cards. +- Added CSS overrides that mirror Gunicorn’s brand colors and support light/dark modes. +- Replaced the Sphinx extension with a standalone Markdown generator for the settings reference. +- Introduced an automated MkDocs workflow (`.github/workflows/docs.yml`) that builds on every push and deploys to `gh-pages` from the `main` branch. + +## Remaining Enhancements +1. **Visual polish:** produce updated screenshots/asciicasts for quickstart and deployment examples; add Open Graph imagery. +2. **Content review:** prune outdated news entries, tighten FAQs, and add framework-specific quickstarts (FastAPI, Flask, Django). +3. **Accessibility & internationalization:** run axe audits, ensure color contrast, and consider adding minimal localization support. +4. **Performance extras:** enable MkDocs search index minification and gzip the GitHub Pages output (served automatically once deployed). +5. **Contributor docs:** extend `CONTRIBUTING.md` with MkDocs authoring tips, link to preview artifacts, and describe the `mkdocs serve` workflow. + +## Deployment Checklist +- [x] Update DNS to point away from ReadTheDocs once `gh-pages` is published. +- [x] Verify `site_url` in `mkdocs.yml` for canonical URLs and sitemap generation. +- [x] Ensure `CNAME` (if required) is checked into `gh-pages` during deployment. +- [ ] Announce the migration to end-users and update links in READMEs and PyPI metadata. diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 000000000..d6945086c --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,94 @@ +site_name: Gunicorn +site_url: https://gunicorn.org +repo_url: https://github.com/benoitc/gunicorn +repo_name: benoitc/gunicorn +docs_dir: docs/content +use_directory_urls: true + +nav: + - Home: index.md + - Guides: + - Install: install.md + - Run: run.md + - Configure: configure.md + - Deploy: deploy.md + - Signals: signals.md + - Instrumentation: instrumentation.md + - Custom: custom.md + - Community: community.md + - FAQ: faq.md + - Design: design.md + - Reference: + - Settings: reference/settings.md + - News: + - Latest: news.md + - '2024': 2024-news.md + - '2023': 2023-news.md + - '2021': 2021-news.md + - '2020': 2020-news.md + - '2019': 2019-news.md + - '2018': 2018-news.md + - '2017': 2017-news.md + - '2016': 2016-news.md + - '2015': 2015-news.md + - '2014': 2014-news.md + - '2013': 2013-news.md + - '2012': 2012-news.md + - '2011': 2011-news.md + - '2010': 2010-news.md + +theme: + name: material + language: en + logo: assets/gunicorn.svg + favicon: assets/gunicorn.svg + features: + - content.code.copy + - navigation.instant + - navigation.tracking + - navigation.sections + - navigation.tabs + - navigation.top + - search.highlight + - search.suggest + - toc.follow + +plugins: + - search + - macros + - gen-files: + scripts: + - scripts/build_settings_doc.py + +markdown_extensions: + - admonition + - attr_list + - def_list + - footnotes + - md_in_html + - tables + - toc: + permalink: true + - pymdownx.details + - pymdownx.highlight + - pymdownx.inlinehilite + - pymdownx.magiclink + - pymdownx.superfences + - pymdownx.snippets: + base_path: + - . + check_paths: true + - pymdownx.tabbed: + alternate_style: true + - pymdownx.tasklist: + custom_checkbox: true + +extra_css: + - styles/overrides.css + +extra: + social: + - icon: fontawesome/brands/github + link: https://github.com/benoitc/gunicorn + - icon: fontawesome/brands/python + link: https://pypi.org/project/gunicorn/ diff --git a/requirements_dev.txt b/requirements_dev.txt index 1d8c01291..40b6dae6b 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -5,5 +5,8 @@ # otherwise, oldest known-working version is 61.2 setuptools>=68.0 -sphinx -sphinx_rtd_theme +mkdocs>=1.6 +mkdocs-material>=9.5 +mkdocs-gen-files>=0.5 +mkdocs-macros-plugin>=1.0 +pymdown-extensions>=10.0 diff --git a/scripts/build_settings_doc.py b/scripts/build_settings_doc.py new file mode 100644 index 000000000..eb370f090 --- /dev/null +++ b/scripts/build_settings_doc.py @@ -0,0 +1,254 @@ +"""Generate the Markdown settings reference for MkDocs.""" +from __future__ import annotations + +import inspect +import textwrap +from pathlib import Path +from typing import List + +import re + +import gunicorn.config as guncfg + +HEAD = """\ +> **Generated file** — update `gunicorn/config.py` instead. + +# Settings + +This reference is built directly from `gunicorn.config.KNOWN_SETTINGS` and is +regenerated during every documentation build. + +!!! note + Settings can be provided through the `GUNICORN_CMD_ARGS` environment + variable. For example: + + ```console + $ GUNICORN_CMD_ARGS="--bind=127.0.0.1 --workers=3" gunicorn app:app + ``` + + _Added in 19.7._ + +""" + + +def _format_default(setting: guncfg.Setting) -> tuple[str, bool]: + if hasattr(setting, "default_doc"): + text = textwrap.dedent(setting.default_doc).strip("\n") + return text, True + default = setting.default + if callable(default): + source = textwrap.dedent(inspect.getsource(default)).strip("\n") + return f"```python\n{source}\n```", True + if default == "": + return "`''`", False + return f"`{default!r}`", False + + +def _format_cli(setting: guncfg.Setting) -> str | None: + if not setting.cli: + return None + if setting.meta: + variants = [f"`{opt} {setting.meta}`" for opt in setting.cli] + else: + variants = [f"`{opt}`" for opt in setting.cli] + return ", ".join(variants) + + +REF_MAP = { + "forwarded-allow-ips": ("reference/settings.md", "forwarded_allow_ips"), + "forwarder-headers": ("reference/settings.md", "forwarder_headers"), + "proxy-allow-ips": ("reference/settings.md", "proxy_allow_ips"), + "worker-class": ("reference/settings.md", "worker_class"), + "reload": ("reference/settings.md", "reload"), + "raw-env": ("reference/settings.md", "raw_env"), + "check-config": ("reference/settings.md", "check_config"), + "errorlog": ("reference/settings.md", "errorlog"), + "logconfig": ("reference/settings.md", "logconfig"), + "logconfig-json": ("reference/settings.md", "logconfig_json"), + "ssl-context": ("reference/settings.md", "ssl_context"), + "ssl-version": ("reference/settings.md", "ssl_version"), + "blocking-os-fchmod": ("reference/settings.md", "blocking_os_fchmod"), + "configuration_file": ("../configure.md", "configuration-file"), +} + +REF_PATTERN = re.compile(r":ref:`([^`]+)`") + + +def _convert_refs(text: str) -> str: + def repl(match: re.Match[str]) -> str: + raw = match.group(1) + if "<" in raw and raw.endswith(">"): + label, target = raw.split("<", 1) + target = target[:-1] + label = label.replace("\n", " ").strip() + else: + label, target = None, raw.strip() + info = REF_MAP.get(target) + if not info: + return (label or target).replace("\n", " ").strip() + path, anchor = info + if path.endswith(".md"): + if path == "reference/settings.md" and anchor: + href = f"#{anchor}" + else: + href = path + (f"#{anchor}" if anchor else "") + else: + href = path + (f"#{anchor}" if anchor else "") + text = (label or target).replace("\n", " ").strip() + return f"[{text}]({href})" + + return REF_PATTERN.sub(repl, text) + + +def _consume_indented(lines: List[str], start: int) -> tuple[str, int]: + body: List[str] = [] + i = start + while i < len(lines): + line = lines[i] + if line.startswith(" ") or not line.strip(): + body.append(line) + i += 1 + else: + break + text = textwrap.dedent("\n".join(body)).strip("\n") + return text, i + + +def _convert_desc(desc: str) -> str: + raw_lines = textwrap.dedent(desc).splitlines() + output: List[str] = [] + i = 0 + while i < len(raw_lines): + line = raw_lines[i] + stripped = line.strip() + if stripped.startswith(".. note::"): + body, i = _consume_indented(raw_lines, i + 1) + output.append("!!! note") + if body: + for body_line in body.splitlines(): + output.append(f" {body_line}" if body_line else "") + output.append("") + continue + if stripped.startswith(".. warning::"): + body, i = _consume_indented(raw_lines, i + 1) + output.append("!!! warning") + if body: + for body_line in body.splitlines(): + output.append(f" {body_line}" if body_line else "") + output.append("") + continue + if stripped.startswith(".. deprecated::"): + version = stripped.split("::", 1)[1].strip() + body, i = _consume_indented(raw_lines, i + 1) + title = f"Deprecated in {version}" if version else "Deprecated" + output.append(f"!!! danger \"{title}\"") + if body: + for body_line in body.splitlines(): + output.append(f" {body_line}" if body_line else "") + output.append("") + continue + if stripped.startswith(".. versionadded::"): + version = stripped.split("::", 1)[1].strip() + body, i = _consume_indented(raw_lines, i + 1) + title = f"Added in {version}" if version else "Added" + output.append(f"!!! info \"{title}\"") + if body: + for body_line in body.splitlines(): + output.append(f" {body_line}" if body_line else "") + output.append("") + continue + if stripped.startswith(".. versionchanged::"): + version = stripped.split("::", 1)[1].strip() + body, i = _consume_indented(raw_lines, i + 1) + title = f"Changed in {version}" if version else "Changed" + output.append(f"!!! info \"{title}\"") + if body: + for body_line in body.splitlines(): + output.append(f" {body_line}" if body_line else "") + output.append("") + continue + if stripped.startswith(".. code::") or stripped.startswith(".. code-block::"): + language = stripped.split("::", 1)[1].strip() + body, i = _consume_indented(raw_lines, i + 1) + fence = language or "text" + output.append(f"```{fence}") + if body: + output.append(body) + output.append("```") + output.append("") + continue + + output.append(line) + i += 1 + + text = "\n".join(output) + text = _convert_refs(text) + # Collapse excessive blank lines + text = re.sub(r"\n{3,}", "\n\n", text) + return text.strip("\n") + + +def _format_setting(setting: guncfg.Setting) -> str: + lines: list[str] = [f"## `{setting.name}`", ""] + + cli = _format_cli(setting) + if cli: + lines.extend((f"**Command line:** {cli}", "")) + + default_text, is_block = _format_default(setting) + if is_block: + lines.append("**Default:**") + lines.append("") + lines.append(default_text) + else: + lines.append(f"**Default:** {default_text}") + lines.append("") + + desc = _convert_desc(setting.desc) + if desc: + lines.append(desc) + lines.append("") + + return "\n".join(lines) + + +def render_settings() -> str: + sections: list[str] = [HEAD, '', ""] + known_settings = sorted(guncfg.KNOWN_SETTINGS, key=lambda s: s.section) + current_section: str | None = None + + for setting in known_settings: + if setting.section != current_section: + current_section = setting.section + sections.append(f"# {current_section}\n") + sections.append(_format_setting(setting)) + + return "\n".join(sections).strip() + "\n" + + +def _write_output(markdown: str) -> None: + try: + import mkdocs_gen_files # type: ignore + except ImportError: + mkdocs_gen_files = None + + if mkdocs_gen_files is not None: + try: + with mkdocs_gen_files.open("reference/settings.md", "w") as fh: + fh.write(markdown) + return + except Exception: + pass + + output = Path(__file__).resolve().parents[1] / "docs" / "content" / "reference" / "settings.md" + output.parent.mkdir(parents=True, exist_ok=True) + output.write_text(markdown, encoding="utf-8") + + +def main() -> None: + markdown = render_settings() + _write_output(markdown) + + +if __name__ == "__main__": + main() diff --git a/uv.lock b/uv.lock new file mode 100644 index 000000000..d933d0867 --- /dev/null +++ b/uv.lock @@ -0,0 +1,643 @@ +version = 1 +revision = 3 +requires-python = ">=3.10" + +[[package]] +name = "backports-asyncio-runner" +version = "1.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/8e/ff/70dca7d7cb1cbc0edb2c6cc0c38b65cba36cccc491eca64cabd5fe7f8670/backports_asyncio_runner-1.2.0.tar.gz", hash = "sha256:a5aa7b2b7d8f8bfcaa2b57313f70792df84e32a2a746f585213373f900b42162", size = 69893, upload-time = "2025-07-02T02:27:15.685Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a0/59/76ab57e3fe74484f48a53f8e337171b4a2349e506eabe136d7e01d059086/backports_asyncio_runner-1.2.0-py3-none-any.whl", hash = "sha256:0da0a936a8aeb554eccb426dc55af3ba63bcdc69fa1a600b5bb305413a4477b5", size = 12313, upload-time = "2025-07-02T02:27:14.263Z" }, +] + +[[package]] +name = "cffi" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pycparser", marker = "implementation_name != 'PyPy'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/eb/56/b1ba7935a17738ae8453301356628e8147c79dbb825bcbc73dc7401f9846/cffi-2.0.0.tar.gz", hash = "sha256:44d1b5909021139fe36001ae048dbdde8214afa20200eda0f64c068cac5d5529", size = 523588, upload-time = "2025-09-08T23:24:04.541Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e2/cc/027d7fb82e58c48ea717149b03bcadcbdc293553edb283af792bd4bcbb3f/cffi-2.0.0-cp310-cp310-win32.whl", hash = "sha256:1f72fb8906754ac8a2cc3f9f5aaa298070652a0ffae577e0ea9bd480dc3c931a", size = 172184, upload-time = "2025-09-08T23:22:23.328Z" }, + { url = "https://files.pythonhosted.org/packages/33/fa/072dd15ae27fbb4e06b437eb6e944e75b068deb09e2a2826039e49ee2045/cffi-2.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:b18a3ed7d5b3bd8d9ef7a8cb226502c6bf8308df1525e1cc676c3680e7176739", size = 182790, upload-time = "2025-09-08T23:22:24.752Z" }, + { url = "https://files.pythonhosted.org/packages/2b/c0/015b25184413d7ab0a410775fdb4a50fca20f5589b5dab1dbbfa3baad8ce/cffi-2.0.0-cp311-cp311-win32.whl", hash = "sha256:c649e3a33450ec82378822b3dad03cc228b8f5963c0c12fc3b1e0ab940f768a5", size = 172076, upload-time = "2025-09-08T23:22:40.95Z" }, + { url = "https://files.pythonhosted.org/packages/ae/8f/dc5531155e7070361eb1b7e4c1a9d896d0cb21c49f807a6c03fd63fc877e/cffi-2.0.0-cp311-cp311-win_amd64.whl", hash = "sha256:66f011380d0e49ed280c789fbd08ff0d40968ee7b665575489afa95c98196ab5", size = 182820, upload-time = "2025-09-08T23:22:42.463Z" }, + { url = "https://files.pythonhosted.org/packages/95/5c/1b493356429f9aecfd56bc171285a4c4ac8697f76e9bbbbb105e537853a1/cffi-2.0.0-cp311-cp311-win_arm64.whl", hash = "sha256:c6638687455baf640e37344fe26d37c404db8b80d037c3d29f58fe8d1c3b194d", size = 177635, upload-time = "2025-09-08T23:22:43.623Z" }, + { url = "https://files.pythonhosted.org/packages/7b/2b/2b6435f76bfeb6bbf055596976da087377ede68df465419d192acf00c437/cffi-2.0.0-cp312-cp312-win32.whl", hash = "sha256:da902562c3e9c550df360bfa53c035b2f241fed6d9aef119048073680ace4a18", size = 172932, upload-time = "2025-09-08T23:22:57.188Z" }, + { url = "https://files.pythonhosted.org/packages/f8/ed/13bd4418627013bec4ed6e54283b1959cf6db888048c7cf4b4c3b5b36002/cffi-2.0.0-cp312-cp312-win_amd64.whl", hash = "sha256:da68248800ad6320861f129cd9c1bf96ca849a2771a59e0344e88681905916f5", size = 183557, upload-time = "2025-09-08T23:22:58.351Z" }, + { url = "https://files.pythonhosted.org/packages/95/31/9f7f93ad2f8eff1dbc1c3656d7ca5bfd8fb52c9d786b4dcf19b2d02217fa/cffi-2.0.0-cp312-cp312-win_arm64.whl", hash = "sha256:4671d9dd5ec934cb9a73e7ee9676f9362aba54f7f34910956b84d727b0d73fb6", size = 177762, upload-time = "2025-09-08T23:22:59.668Z" }, + { url = "https://files.pythonhosted.org/packages/eb/6d/bf9bda840d5f1dfdbf0feca87fbdb64a918a69bca42cfa0ba7b137c48cb8/cffi-2.0.0-cp313-cp313-win32.whl", hash = "sha256:74a03b9698e198d47562765773b4a8309919089150a0bb17d829ad7b44b60d27", size = 172909, upload-time = "2025-09-08T23:23:14.32Z" }, + { url = "https://files.pythonhosted.org/packages/37/18/6519e1ee6f5a1e579e04b9ddb6f1676c17368a7aba48299c3759bbc3c8b3/cffi-2.0.0-cp313-cp313-win_amd64.whl", hash = "sha256:19f705ada2530c1167abacb171925dd886168931e0a7b78f5bffcae5c6b5be75", size = 183402, upload-time = "2025-09-08T23:23:15.535Z" }, + { url = "https://files.pythonhosted.org/packages/cb/0e/02ceeec9a7d6ee63bb596121c2c8e9b3a9e150936f4fbef6ca1943e6137c/cffi-2.0.0-cp313-cp313-win_arm64.whl", hash = "sha256:256f80b80ca3853f90c21b23ee78cd008713787b1b1e93eae9f3d6a7134abd91", size = 177780, upload-time = "2025-09-08T23:23:16.761Z" }, + { url = "https://files.pythonhosted.org/packages/3e/aa/df335faa45b395396fcbc03de2dfcab242cd61a9900e914fe682a59170b1/cffi-2.0.0-cp314-cp314-win32.whl", hash = "sha256:087067fa8953339c723661eda6b54bc98c5625757ea62e95eb4898ad5e776e9f", size = 175328, upload-time = "2025-09-08T23:23:44.61Z" }, + { url = "https://files.pythonhosted.org/packages/bb/92/882c2d30831744296ce713f0feb4c1cd30f346ef747b530b5318715cc367/cffi-2.0.0-cp314-cp314-win_amd64.whl", hash = "sha256:203a48d1fb583fc7d78a4c6655692963b860a417c0528492a6bc21f1aaefab25", size = 185650, upload-time = "2025-09-08T23:23:45.848Z" }, + { url = "https://files.pythonhosted.org/packages/9f/2c/98ece204b9d35a7366b5b2c6539c350313ca13932143e79dc133ba757104/cffi-2.0.0-cp314-cp314-win_arm64.whl", hash = "sha256:dbd5c7a25a7cb98f5ca55d258b103a2054f859a46ae11aaf23134f9cc0d356ad", size = 180687, upload-time = "2025-09-08T23:23:47.105Z" }, + { url = "https://files.pythonhosted.org/packages/a0/1d/ec1a60bd1a10daa292d3cd6bb0b359a81607154fb8165f3ec95fe003b85c/cffi-2.0.0-cp314-cp314t-win32.whl", hash = "sha256:1fc9ea04857caf665289b7a75923f2c6ed559b8298a1b8c49e59f7dd95c8481e", size = 180487, upload-time = "2025-09-08T23:23:40.423Z" }, + { url = "https://files.pythonhosted.org/packages/bf/41/4c1168c74fac325c0c8156f04b6749c8b6a8f405bbf91413ba088359f60d/cffi-2.0.0-cp314-cp314t-win_amd64.whl", hash = "sha256:d68b6cef7827e8641e8ef16f4494edda8b36104d79773a334beaa1e3521430f6", size = 191726, upload-time = "2025-09-08T23:23:41.742Z" }, + { url = "https://files.pythonhosted.org/packages/ae/3a/dbeec9d1ee0844c679f6bb5d6ad4e9f198b1224f4e7a32825f47f6192b0c/cffi-2.0.0-cp314-cp314t-win_arm64.whl", hash = "sha256:0a1527a803f0a659de1af2e1fd700213caba79377e27e4693648c2923da066f9", size = 184195, upload-time = "2025-09-08T23:23:43.004Z" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "coverage" +version = "7.13.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/23/f9/e92df5e07f3fc8d4c7f9a0f146ef75446bf870351cd37b788cf5897f8079/coverage-7.13.1.tar.gz", hash = "sha256:b7593fe7eb5feaa3fbb461ac79aac9f9fc0387a5ca8080b0c6fe2ca27b091afd", size = 825862, upload-time = "2025-12-28T15:42:56.969Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2d/9a/3742e58fd04b233df95c012ee9f3dfe04708a5e1d32613bd2d47d4e1be0d/coverage-7.13.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e1fa280b3ad78eea5be86f94f461c04943d942697e0dac889fa18fff8f5f9147", size = 218633, upload-time = "2025-12-28T15:40:10.165Z" }, + { url = "https://files.pythonhosted.org/packages/7e/45/7e6bdc94d89cd7c8017ce735cf50478ddfe765d4fbf0c24d71d30ea33d7a/coverage-7.13.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c3d8c679607220979434f494b139dfb00131ebf70bb406553d69c1ff01a5c33d", size = 219147, upload-time = "2025-12-28T15:40:12.069Z" }, + { url = "https://files.pythonhosted.org/packages/f7/38/0d6a258625fd7f10773fe94097dc16937a5f0e3e0cdf3adef67d3ac6baef/coverage-7.13.1-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:339dc63b3eba969067b00f41f15ad161bf2946613156fb131266d8debc8e44d0", size = 245894, upload-time = "2025-12-28T15:40:13.556Z" }, + { url = "https://files.pythonhosted.org/packages/27/58/409d15ea487986994cbd4d06376e9860e9b157cfbfd402b1236770ab8dd2/coverage-7.13.1-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:db622b999ffe49cb891f2fff3b340cdc2f9797d01a0a202a0973ba2562501d90", size = 247721, upload-time = "2025-12-28T15:40:15.37Z" }, + { url = "https://files.pythonhosted.org/packages/da/bf/6e8056a83fd7a96c93341f1ffe10df636dd89f26d5e7b9ca511ce3bcf0df/coverage-7.13.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d1443ba9acbb593fa7c1c29e011d7c9761545fe35e7652e85ce7f51a16f7e08d", size = 249585, upload-time = "2025-12-28T15:40:17.226Z" }, + { url = "https://files.pythonhosted.org/packages/f4/15/e1daff723f9f5959acb63cbe35b11203a9df77ee4b95b45fffd38b318390/coverage-7.13.1-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c832ec92c4499ac463186af72f9ed4d8daec15499b16f0a879b0d1c8e5cf4a3b", size = 246597, upload-time = "2025-12-28T15:40:19.028Z" }, + { url = "https://files.pythonhosted.org/packages/74/a6/1efd31c5433743a6ddbc9d37ac30c196bb07c7eab3d74fbb99b924c93174/coverage-7.13.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:562ec27dfa3f311e0db1ba243ec6e5f6ab96b1edfcfc6cf86f28038bc4961ce6", size = 247626, upload-time = "2025-12-28T15:40:20.846Z" }, + { url = "https://files.pythonhosted.org/packages/6d/9f/1609267dd3e749f57fdd66ca6752567d1c13b58a20a809dc409b263d0b5f/coverage-7.13.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:4de84e71173d4dada2897e5a0e1b7877e5eefbfe0d6a44edee6ce31d9b8ec09e", size = 245629, upload-time = "2025-12-28T15:40:22.397Z" }, + { url = "https://files.pythonhosted.org/packages/e2/f6/6815a220d5ec2466383d7cc36131b9fa6ecbe95c50ec52a631ba733f306a/coverage-7.13.1-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:a5a68357f686f8c4d527a2dc04f52e669c2fc1cbde38f6f7eb6a0e58cbd17cae", size = 245901, upload-time = "2025-12-28T15:40:23.836Z" }, + { url = "https://files.pythonhosted.org/packages/ac/58/40576554cd12e0872faf6d2c0eb3bc85f71d78427946ddd19ad65201e2c0/coverage-7.13.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:77cc258aeb29a3417062758975521eae60af6f79e930d6993555eeac6a8eac29", size = 246505, upload-time = "2025-12-28T15:40:25.421Z" }, + { url = "https://files.pythonhosted.org/packages/3b/77/9233a90253fba576b0eee81707b5781d0e21d97478e5377b226c5b096c0f/coverage-7.13.1-cp310-cp310-win32.whl", hash = "sha256:bb4f8c3c9a9f34423dba193f241f617b08ffc63e27f67159f60ae6baf2dcfe0f", size = 221257, upload-time = "2025-12-28T15:40:27.217Z" }, + { url = "https://files.pythonhosted.org/packages/e0/43/e842ff30c1a0a623ec80db89befb84a3a7aad7bfe44a6ea77d5a3e61fedd/coverage-7.13.1-cp310-cp310-win_amd64.whl", hash = "sha256:c8e2706ceb622bc63bac98ebb10ef5da80ed70fbd8a7999a5076de3afaef0fb1", size = 222191, upload-time = "2025-12-28T15:40:28.916Z" }, + { url = "https://files.pythonhosted.org/packages/b4/9b/77baf488516e9ced25fc215a6f75d803493fc3f6a1a1227ac35697910c2a/coverage-7.13.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1a55d509a1dc5a5b708b5dad3b5334e07a16ad4c2185e27b40e4dba796ab7f88", size = 218755, upload-time = "2025-12-28T15:40:30.812Z" }, + { url = "https://files.pythonhosted.org/packages/d7/cd/7ab01154e6eb79ee2fab76bf4d89e94c6648116557307ee4ebbb85e5c1bf/coverage-7.13.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4d010d080c4888371033baab27e47c9df7d6fb28d0b7b7adf85a4a49be9298b3", size = 219257, upload-time = "2025-12-28T15:40:32.333Z" }, + { url = "https://files.pythonhosted.org/packages/01/d5/b11ef7863ffbbdb509da0023fad1e9eda1c0eaea61a6d2ea5b17d4ac706e/coverage-7.13.1-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:d938b4a840fb1523b9dfbbb454f652967f18e197569c32266d4d13f37244c3d9", size = 249657, upload-time = "2025-12-28T15:40:34.1Z" }, + { url = "https://files.pythonhosted.org/packages/f7/7c/347280982982383621d29b8c544cf497ae07ac41e44b1ca4903024131f55/coverage-7.13.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:bf100a3288f9bb7f919b87eb84f87101e197535b9bd0e2c2b5b3179633324fee", size = 251581, upload-time = "2025-12-28T15:40:36.131Z" }, + { url = "https://files.pythonhosted.org/packages/82/f6/ebcfed11036ade4c0d75fa4453a6282bdd225bc073862766eec184a4c643/coverage-7.13.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ef6688db9bf91ba111ae734ba6ef1a063304a881749726e0d3575f5c10a9facf", size = 253691, upload-time = "2025-12-28T15:40:37.626Z" }, + { url = "https://files.pythonhosted.org/packages/02/92/af8f5582787f5d1a8b130b2dcba785fa5e9a7a8e121a0bb2220a6fdbdb8a/coverage-7.13.1-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0b609fc9cdbd1f02e51f67f51e5aee60a841ef58a68d00d5ee2c0faf357481a3", size = 249799, upload-time = "2025-12-28T15:40:39.47Z" }, + { url = "https://files.pythonhosted.org/packages/24/aa/0e39a2a3b16eebf7f193863323edbff38b6daba711abaaf807d4290cf61a/coverage-7.13.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c43257717611ff5e9a1d79dce8e47566235ebda63328718d9b65dd640bc832ef", size = 251389, upload-time = "2025-12-28T15:40:40.954Z" }, + { url = "https://files.pythonhosted.org/packages/73/46/7f0c13111154dc5b978900c0ccee2e2ca239b910890e674a77f1363d483e/coverage-7.13.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e09fbecc007f7b6afdfb3b07ce5bd9f8494b6856dd4f577d26c66c391b829851", size = 249450, upload-time = "2025-12-28T15:40:42.489Z" }, + { url = "https://files.pythonhosted.org/packages/ac/ca/e80da6769e8b669ec3695598c58eef7ad98b0e26e66333996aee6316db23/coverage-7.13.1-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:a03a4f3a19a189919c7055098790285cc5c5b0b3976f8d227aea39dbf9f8bfdb", size = 249170, upload-time = "2025-12-28T15:40:44.279Z" }, + { url = "https://files.pythonhosted.org/packages/af/18/9e29baabdec1a8644157f572541079b4658199cfd372a578f84228e860de/coverage-7.13.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3820778ea1387c2b6a818caec01c63adc5b3750211af6447e8dcfb9b6f08dbba", size = 250081, upload-time = "2025-12-28T15:40:45.748Z" }, + { url = "https://files.pythonhosted.org/packages/00/f8/c3021625a71c3b2f516464d322e41636aea381018319050a8114105872ee/coverage-7.13.1-cp311-cp311-win32.whl", hash = "sha256:ff10896fa55167371960c5908150b434b71c876dfab97b69478f22c8b445ea19", size = 221281, upload-time = "2025-12-28T15:40:47.232Z" }, + { url = "https://files.pythonhosted.org/packages/27/56/c216625f453df6e0559ed666d246fcbaaa93f3aa99eaa5080cea1229aa3d/coverage-7.13.1-cp311-cp311-win_amd64.whl", hash = "sha256:a998cc0aeeea4c6d5622a3754da5a493055d2d95186bad877b0a34ea6e6dbe0a", size = 222215, upload-time = "2025-12-28T15:40:49.19Z" }, + { url = "https://files.pythonhosted.org/packages/5c/9a/be342e76f6e531cae6406dc46af0d350586f24d9b67fdfa6daee02df71af/coverage-7.13.1-cp311-cp311-win_arm64.whl", hash = "sha256:fea07c1a39a22614acb762e3fbbb4011f65eedafcb2948feeef641ac78b4ee5c", size = 220886, upload-time = "2025-12-28T15:40:51.067Z" }, + { url = "https://files.pythonhosted.org/packages/ce/8a/87af46cccdfa78f53db747b09f5f9a21d5fc38d796834adac09b30a8ce74/coverage-7.13.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:6f34591000f06e62085b1865c9bc5f7858df748834662a51edadfd2c3bfe0dd3", size = 218927, upload-time = "2025-12-28T15:40:52.814Z" }, + { url = "https://files.pythonhosted.org/packages/82/a8/6e22fdc67242a4a5a153f9438d05944553121c8f4ba70cb072af4c41362e/coverage-7.13.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b67e47c5595b9224599016e333f5ec25392597a89d5744658f837d204e16c63e", size = 219288, upload-time = "2025-12-28T15:40:54.262Z" }, + { url = "https://files.pythonhosted.org/packages/d0/0a/853a76e03b0f7c4375e2ca025df45c918beb367f3e20a0a8e91967f6e96c/coverage-7.13.1-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:3e7b8bd70c48ffb28461ebe092c2345536fb18bbbf19d287c8913699735f505c", size = 250786, upload-time = "2025-12-28T15:40:56.059Z" }, + { url = "https://files.pythonhosted.org/packages/ea/b4/694159c15c52b9f7ec7adf49d50e5f8ee71d3e9ef38adb4445d13dd56c20/coverage-7.13.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:c223d078112e90dc0e5c4e35b98b9584164bea9fbbd221c0b21c5241f6d51b62", size = 253543, upload-time = "2025-12-28T15:40:57.585Z" }, + { url = "https://files.pythonhosted.org/packages/96/b2/7f1f0437a5c855f87e17cf5d0dc35920b6440ff2b58b1ba9788c059c26c8/coverage-7.13.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:794f7c05af0763b1bbd1b9e6eff0e52ad068be3b12cd96c87de037b01390c968", size = 254635, upload-time = "2025-12-28T15:40:59.443Z" }, + { url = "https://files.pythonhosted.org/packages/e9/d1/73c3fdb8d7d3bddd9473c9c6a2e0682f09fc3dfbcb9c3f36412a7368bcab/coverage-7.13.1-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0642eae483cc8c2902e4af7298bf886d605e80f26382124cddc3967c2a3df09e", size = 251202, upload-time = "2025-12-28T15:41:01.328Z" }, + { url = "https://files.pythonhosted.org/packages/66/3c/f0edf75dcc152f145d5598329e864bbbe04ab78660fe3e8e395f9fff010f/coverage-7.13.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:9f5e772ed5fef25b3de9f2008fe67b92d46831bd2bc5bdc5dd6bfd06b83b316f", size = 252566, upload-time = "2025-12-28T15:41:03.319Z" }, + { url = "https://files.pythonhosted.org/packages/17/b3/e64206d3c5f7dcbceafd14941345a754d3dbc78a823a6ed526e23b9cdaab/coverage-7.13.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:45980ea19277dc0a579e432aef6a504fe098ef3a9032ead15e446eb0f1191aee", size = 250711, upload-time = "2025-12-28T15:41:06.411Z" }, + { url = "https://files.pythonhosted.org/packages/dc/ad/28a3eb970a8ef5b479ee7f0c484a19c34e277479a5b70269dc652b730733/coverage-7.13.1-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:e4f18eca6028ffa62adbd185a8f1e1dd242f2e68164dba5c2b74a5204850b4cf", size = 250278, upload-time = "2025-12-28T15:41:08.285Z" }, + { url = "https://files.pythonhosted.org/packages/54/e3/c8f0f1a93133e3e1291ca76cbb63565bd4b5c5df63b141f539d747fff348/coverage-7.13.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:f8dca5590fec7a89ed6826fce625595279e586ead52e9e958d3237821fbc750c", size = 252154, upload-time = "2025-12-28T15:41:09.969Z" }, + { url = "https://files.pythonhosted.org/packages/d0/bf/9939c5d6859c380e405b19e736321f1c7d402728792f4c752ad1adcce005/coverage-7.13.1-cp312-cp312-win32.whl", hash = "sha256:ff86d4e85188bba72cfb876df3e11fa243439882c55957184af44a35bd5880b7", size = 221487, upload-time = "2025-12-28T15:41:11.468Z" }, + { url = "https://files.pythonhosted.org/packages/fa/dc/7282856a407c621c2aad74021680a01b23010bb8ebf427cf5eacda2e876f/coverage-7.13.1-cp312-cp312-win_amd64.whl", hash = "sha256:16cc1da46c04fb0fb128b4dc430b78fa2aba8a6c0c9f8eb391fd5103409a6ac6", size = 222299, upload-time = "2025-12-28T15:41:13.386Z" }, + { url = "https://files.pythonhosted.org/packages/10/79/176a11203412c350b3e9578620013af35bcdb79b651eb976f4a4b32044fa/coverage-7.13.1-cp312-cp312-win_arm64.whl", hash = "sha256:8d9bc218650022a768f3775dd7fdac1886437325d8d295d923ebcfef4892ad5c", size = 220941, upload-time = "2025-12-28T15:41:14.975Z" }, + { url = "https://files.pythonhosted.org/packages/a3/a4/e98e689347a1ff1a7f67932ab535cef82eb5e78f32a9e4132e114bbb3a0a/coverage-7.13.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:cb237bfd0ef4d5eb6a19e29f9e528ac67ac3be932ea6b44fb6cc09b9f3ecff78", size = 218951, upload-time = "2025-12-28T15:41:16.653Z" }, + { url = "https://files.pythonhosted.org/packages/32/33/7cbfe2bdc6e2f03d6b240d23dc45fdaf3fd270aaf2d640be77b7f16989ab/coverage-7.13.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1dcb645d7e34dcbcc96cd7c132b1fc55c39263ca62eb961c064eb3928997363b", size = 219325, upload-time = "2025-12-28T15:41:18.609Z" }, + { url = "https://files.pythonhosted.org/packages/59/f6/efdabdb4929487baeb7cb2a9f7dac457d9356f6ad1b255be283d58b16316/coverage-7.13.1-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:3d42df8201e00384736f0df9be2ced39324c3907607d17d50d50116c989d84cd", size = 250309, upload-time = "2025-12-28T15:41:20.629Z" }, + { url = "https://files.pythonhosted.org/packages/12/da/91a52516e9d5aea87d32d1523f9cdcf7a35a3b298e6be05d6509ba3cfab2/coverage-7.13.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:fa3edde1aa8807de1d05934982416cb3ec46d1d4d91e280bcce7cca01c507992", size = 252907, upload-time = "2025-12-28T15:41:22.257Z" }, + { url = "https://files.pythonhosted.org/packages/75/38/f1ea837e3dc1231e086db1638947e00d264e7e8c41aa8ecacf6e1e0c05f4/coverage-7.13.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9edd0e01a343766add6817bc448408858ba6b489039eaaa2018474e4001651a4", size = 254148, upload-time = "2025-12-28T15:41:23.87Z" }, + { url = "https://files.pythonhosted.org/packages/7f/43/f4f16b881aaa34954ba446318dea6b9ed5405dd725dd8daac2358eda869a/coverage-7.13.1-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:985b7836931d033570b94c94713c6dba5f9d3ff26045f72c3e5dbc5fe3361e5a", size = 250515, upload-time = "2025-12-28T15:41:25.437Z" }, + { url = "https://files.pythonhosted.org/packages/84/34/8cba7f00078bd468ea914134e0144263194ce849ec3baad187ffb6203d1c/coverage-7.13.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ffed1e4980889765c84a5d1a566159e363b71d6b6fbaf0bebc9d3c30bc016766", size = 252292, upload-time = "2025-12-28T15:41:28.459Z" }, + { url = "https://files.pythonhosted.org/packages/8c/a4/cffac66c7652d84ee4ac52d3ccb94c015687d3b513f9db04bfcac2ac800d/coverage-7.13.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:8842af7f175078456b8b17f1b73a0d16a65dcbdc653ecefeb00a56b3c8c298c4", size = 250242, upload-time = "2025-12-28T15:41:30.02Z" }, + { url = "https://files.pythonhosted.org/packages/f4/78/9a64d462263dde416f3c0067efade7b52b52796f489b1037a95b0dc389c9/coverage-7.13.1-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:ccd7a6fca48ca9c131d9b0a2972a581e28b13416fc313fb98b6d24a03ce9a398", size = 250068, upload-time = "2025-12-28T15:41:32.007Z" }, + { url = "https://files.pythonhosted.org/packages/69/c8/a8994f5fece06db7c4a97c8fc1973684e178599b42e66280dded0524ef00/coverage-7.13.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:0403f647055de2609be776965108447deb8e384fe4a553c119e3ff6bfbab4784", size = 251846, upload-time = "2025-12-28T15:41:33.946Z" }, + { url = "https://files.pythonhosted.org/packages/cc/f7/91fa73c4b80305c86598a2d4e54ba22df6bf7d0d97500944af7ef155d9f7/coverage-7.13.1-cp313-cp313-win32.whl", hash = "sha256:549d195116a1ba1e1ae2f5ca143f9777800f6636eab917d4f02b5310d6d73461", size = 221512, upload-time = "2025-12-28T15:41:35.519Z" }, + { url = "https://files.pythonhosted.org/packages/45/0b/0768b4231d5a044da8f75e097a8714ae1041246bb765d6b5563bab456735/coverage-7.13.1-cp313-cp313-win_amd64.whl", hash = "sha256:5899d28b5276f536fcf840b18b61a9fce23cc3aec1d114c44c07fe94ebeaa500", size = 222321, upload-time = "2025-12-28T15:41:37.371Z" }, + { url = "https://files.pythonhosted.org/packages/9b/b8/bdcb7253b7e85157282450262008f1366aa04663f3e3e4c30436f596c3e2/coverage-7.13.1-cp313-cp313-win_arm64.whl", hash = "sha256:868a2fae76dfb06e87291bcbd4dcbcc778a8500510b618d50496e520bd94d9b9", size = 220949, upload-time = "2025-12-28T15:41:39.553Z" }, + { url = "https://files.pythonhosted.org/packages/70/52/f2be52cc445ff75ea8397948c96c1b4ee14f7f9086ea62fc929c5ae7b717/coverage-7.13.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:67170979de0dacac3f3097d02b0ad188d8edcea44ccc44aaa0550af49150c7dc", size = 219643, upload-time = "2025-12-28T15:41:41.567Z" }, + { url = "https://files.pythonhosted.org/packages/47/79/c85e378eaa239e2edec0c5523f71542c7793fe3340954eafb0bc3904d32d/coverage-7.13.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:f80e2bb21bfab56ed7405c2d79d34b5dc0bc96c2c1d2a067b643a09fb756c43a", size = 219997, upload-time = "2025-12-28T15:41:43.418Z" }, + { url = "https://files.pythonhosted.org/packages/fe/9b/b1ade8bfb653c0bbce2d6d6e90cc6c254cbb99b7248531cc76253cb4da6d/coverage-7.13.1-cp313-cp313t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:f83351e0f7dcdb14d7326c3d8d8c4e915fa685cbfdc6281f9470d97a04e9dfe4", size = 261296, upload-time = "2025-12-28T15:41:45.207Z" }, + { url = "https://files.pythonhosted.org/packages/1f/af/ebf91e3e1a2473d523e87e87fd8581e0aa08741b96265730e2d79ce78d8d/coverage-7.13.1-cp313-cp313t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:bb3f6562e89bad0110afbe64e485aac2462efdce6232cdec7862a095dc3412f6", size = 263363, upload-time = "2025-12-28T15:41:47.163Z" }, + { url = "https://files.pythonhosted.org/packages/c4/8b/fb2423526d446596624ac7fde12ea4262e66f86f5120114c3cfd0bb2befa/coverage-7.13.1-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:77545b5dcda13b70f872c3b5974ac64c21d05e65b1590b441c8560115dc3a0d1", size = 265783, upload-time = "2025-12-28T15:41:49.03Z" }, + { url = "https://files.pythonhosted.org/packages/9b/26/ef2adb1e22674913b89f0fe7490ecadcef4a71fa96f5ced90c60ec358789/coverage-7.13.1-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a4d240d260a1aed814790bbe1f10a5ff31ce6c21bc78f0da4a1e8268d6c80dbd", size = 260508, upload-time = "2025-12-28T15:41:51.035Z" }, + { url = "https://files.pythonhosted.org/packages/ce/7d/f0f59b3404caf662e7b5346247883887687c074ce67ba453ea08c612b1d5/coverage-7.13.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:d2287ac9360dec3837bfdad969963a5d073a09a85d898bd86bea82aa8876ef3c", size = 263357, upload-time = "2025-12-28T15:41:52.631Z" }, + { url = "https://files.pythonhosted.org/packages/1a/b1/29896492b0b1a047604d35d6fa804f12818fa30cdad660763a5f3159e158/coverage-7.13.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:0d2c11f3ea4db66b5cbded23b20185c35066892c67d80ec4be4bab257b9ad1e0", size = 260978, upload-time = "2025-12-28T15:41:54.589Z" }, + { url = "https://files.pythonhosted.org/packages/48/f2/971de1238a62e6f0a4128d37adadc8bb882ee96afbe03ff1570291754629/coverage-7.13.1-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:3fc6a169517ca0d7ca6846c3c5392ef2b9e38896f61d615cb75b9e7134d4ee1e", size = 259877, upload-time = "2025-12-28T15:41:56.263Z" }, + { url = "https://files.pythonhosted.org/packages/6a/fc/0474efcbb590ff8628830e9aaec5f1831594874360e3251f1fdec31d07a3/coverage-7.13.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:d10a2ed46386e850bb3de503a54f9fe8192e5917fcbb143bfef653a9355e9a53", size = 262069, upload-time = "2025-12-28T15:41:58.093Z" }, + { url = "https://files.pythonhosted.org/packages/88/4f/3c159b7953db37a7b44c0eab8a95c37d1aa4257c47b4602c04022d5cb975/coverage-7.13.1-cp313-cp313t-win32.whl", hash = "sha256:75a6f4aa904301dab8022397a22c0039edc1f51e90b83dbd4464b8a38dc87842", size = 222184, upload-time = "2025-12-28T15:41:59.763Z" }, + { url = "https://files.pythonhosted.org/packages/58/a5/6b57d28f81417f9335774f20679d9d13b9a8fb90cd6160957aa3b54a2379/coverage-7.13.1-cp313-cp313t-win_amd64.whl", hash = "sha256:309ef5706e95e62578cda256b97f5e097916a2c26247c287bbe74794e7150df2", size = 223250, upload-time = "2025-12-28T15:42:01.52Z" }, + { url = "https://files.pythonhosted.org/packages/81/7c/160796f3b035acfbb58be80e02e484548595aa67e16a6345e7910ace0a38/coverage-7.13.1-cp313-cp313t-win_arm64.whl", hash = "sha256:92f980729e79b5d16d221038dbf2e8f9a9136afa072f9d5d6ed4cb984b126a09", size = 221521, upload-time = "2025-12-28T15:42:03.275Z" }, + { url = "https://files.pythonhosted.org/packages/aa/8e/ba0e597560c6563fc0adb902fda6526df5d4aa73bb10adf0574d03bd2206/coverage-7.13.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:97ab3647280d458a1f9adb85244e81587505a43c0c7cff851f5116cd2814b894", size = 218996, upload-time = "2025-12-28T15:42:04.978Z" }, + { url = "https://files.pythonhosted.org/packages/6b/8e/764c6e116f4221dc7aa26c4061181ff92edb9c799adae6433d18eeba7a14/coverage-7.13.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:8f572d989142e0908e6acf57ad1b9b86989ff057c006d13b76c146ec6a20216a", size = 219326, upload-time = "2025-12-28T15:42:06.691Z" }, + { url = "https://files.pythonhosted.org/packages/4f/a6/6130dc6d8da28cdcbb0f2bf8865aeca9b157622f7c0031e48c6cf9a0e591/coverage-7.13.1-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:d72140ccf8a147e94274024ff6fd8fb7811354cf7ef88b1f0a988ebaa5bc774f", size = 250374, upload-time = "2025-12-28T15:42:08.786Z" }, + { url = "https://files.pythonhosted.org/packages/82/2b/783ded568f7cd6b677762f780ad338bf4b4750205860c17c25f7c708995e/coverage-7.13.1-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:d3c9f051b028810f5a87c88e5d6e9af3c0ff32ef62763bf15d29f740453ca909", size = 252882, upload-time = "2025-12-28T15:42:10.515Z" }, + { url = "https://files.pythonhosted.org/packages/cd/b2/9808766d082e6a4d59eb0cc881a57fc1600eb2c5882813eefff8254f71b5/coverage-7.13.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f398ba4df52d30b1763f62eed9de5620dcde96e6f491f4c62686736b155aa6e4", size = 254218, upload-time = "2025-12-28T15:42:12.208Z" }, + { url = "https://files.pythonhosted.org/packages/44/ea/52a985bb447c871cb4d2e376e401116520991b597c85afdde1ea9ef54f2c/coverage-7.13.1-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:132718176cc723026d201e347f800cd1a9e4b62ccd3f82476950834dad501c75", size = 250391, upload-time = "2025-12-28T15:42:14.21Z" }, + { url = "https://files.pythonhosted.org/packages/7f/1d/125b36cc12310718873cfc8209ecfbc1008f14f4f5fa0662aa608e579353/coverage-7.13.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:9e549d642426e3579b3f4b92d0431543b012dcb6e825c91619d4e93b7363c3f9", size = 252239, upload-time = "2025-12-28T15:42:16.292Z" }, + { url = "https://files.pythonhosted.org/packages/6a/16/10c1c164950cade470107f9f14bbac8485f8fb8515f515fca53d337e4a7f/coverage-7.13.1-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:90480b2134999301eea795b3a9dbf606c6fbab1b489150c501da84a959442465", size = 250196, upload-time = "2025-12-28T15:42:18.54Z" }, + { url = "https://files.pythonhosted.org/packages/2a/c6/cd860fac08780c6fd659732f6ced1b40b79c35977c1356344e44d72ba6c4/coverage-7.13.1-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:e825dbb7f84dfa24663dd75835e7257f8882629fc11f03ecf77d84a75134b864", size = 250008, upload-time = "2025-12-28T15:42:20.365Z" }, + { url = "https://files.pythonhosted.org/packages/f0/3a/a8c58d3d38f82a5711e1e0a67268362af48e1a03df27c03072ac30feefcf/coverage-7.13.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:623dcc6d7a7ba450bbdbeedbaa0c42b329bdae16491af2282f12a7e809be7eb9", size = 251671, upload-time = "2025-12-28T15:42:22.114Z" }, + { url = "https://files.pythonhosted.org/packages/f0/bc/fd4c1da651d037a1e3d53e8cb3f8182f4b53271ffa9a95a2e211bacc0349/coverage-7.13.1-cp314-cp314-win32.whl", hash = "sha256:6e73ebb44dca5f708dc871fe0b90cf4cff1a13f9956f747cc87b535a840386f5", size = 221777, upload-time = "2025-12-28T15:42:23.919Z" }, + { url = "https://files.pythonhosted.org/packages/4b/50/71acabdc8948464c17e90b5ffd92358579bd0910732c2a1c9537d7536aa6/coverage-7.13.1-cp314-cp314-win_amd64.whl", hash = "sha256:be753b225d159feb397bd0bf91ae86f689bad0da09d3b301478cd39b878ab31a", size = 222592, upload-time = "2025-12-28T15:42:25.619Z" }, + { url = "https://files.pythonhosted.org/packages/f7/c8/a6fb943081bb0cc926499c7907731a6dc9efc2cbdc76d738c0ab752f1a32/coverage-7.13.1-cp314-cp314-win_arm64.whl", hash = "sha256:228b90f613b25ba0019361e4ab81520b343b622fc657daf7e501c4ed6a2366c0", size = 221169, upload-time = "2025-12-28T15:42:27.629Z" }, + { url = "https://files.pythonhosted.org/packages/16/61/d5b7a0a0e0e40d62e59bc8c7aa1afbd86280d82728ba97f0673b746b78e2/coverage-7.13.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:60cfb538fe9ef86e5b2ab0ca8fc8d62524777f6c611dcaf76dc16fbe9b8e698a", size = 219730, upload-time = "2025-12-28T15:42:29.306Z" }, + { url = "https://files.pythonhosted.org/packages/a3/2c/8881326445fd071bb49514d1ce97d18a46a980712b51fee84f9ab42845b4/coverage-7.13.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:57dfc8048c72ba48a8c45e188d811e5efd7e49b387effc8fb17e97936dde5bf6", size = 220001, upload-time = "2025-12-28T15:42:31.319Z" }, + { url = "https://files.pythonhosted.org/packages/b5/d7/50de63af51dfa3a7f91cc37ad8fcc1e244b734232fbc8b9ab0f3c834a5cd/coverage-7.13.1-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:3f2f725aa3e909b3c5fdb8192490bdd8e1495e85906af74fe6e34a2a77ba0673", size = 261370, upload-time = "2025-12-28T15:42:32.992Z" }, + { url = "https://files.pythonhosted.org/packages/e1/2c/d31722f0ec918fd7453b2758312729f645978d212b410cd0f7c2aed88a94/coverage-7.13.1-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:9ee68b21909686eeb21dfcba2c3b81fee70dcf38b140dcd5aa70680995fa3aa5", size = 263485, upload-time = "2025-12-28T15:42:34.759Z" }, + { url = "https://files.pythonhosted.org/packages/fa/7a/2c114fa5c5fc08ba0777e4aec4c97e0b4a1afcb69c75f1f54cff78b073ab/coverage-7.13.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:724b1b270cb13ea2e6503476e34541a0b1f62280bc997eab443f87790202033d", size = 265890, upload-time = "2025-12-28T15:42:36.517Z" }, + { url = "https://files.pythonhosted.org/packages/65/d9/f0794aa1c74ceabc780fe17f6c338456bbc4e96bd950f2e969f48ac6fb20/coverage-7.13.1-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:916abf1ac5cf7eb16bc540a5bf75c71c43a676f5c52fcb9fe75a2bd75fb944e8", size = 260445, upload-time = "2025-12-28T15:42:38.646Z" }, + { url = "https://files.pythonhosted.org/packages/49/23/184b22a00d9bb97488863ced9454068c79e413cb23f472da6cbddc6cfc52/coverage-7.13.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:776483fd35b58d8afe3acbd9988d5de592ab6da2d2a865edfdbc9fdb43e7c486", size = 263357, upload-time = "2025-12-28T15:42:40.788Z" }, + { url = "https://files.pythonhosted.org/packages/7d/bd/58af54c0c9199ea4190284f389005779d7daf7bf3ce40dcd2d2b2f96da69/coverage-7.13.1-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:b6f3b96617e9852703f5b633ea01315ca45c77e879584f283c44127f0f1ec564", size = 260959, upload-time = "2025-12-28T15:42:42.808Z" }, + { url = "https://files.pythonhosted.org/packages/4b/2a/6839294e8f78a4891bf1df79d69c536880ba2f970d0ff09e7513d6e352e9/coverage-7.13.1-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:bd63e7b74661fed317212fab774e2a648bc4bb09b35f25474f8e3325d2945cd7", size = 259792, upload-time = "2025-12-28T15:42:44.818Z" }, + { url = "https://files.pythonhosted.org/packages/ba/c3/528674d4623283310ad676c5af7414b9850ab6d55c2300e8aa4b945ec554/coverage-7.13.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:933082f161bbb3e9f90d00990dc956120f608cdbcaeea15c4d897f56ef4fe416", size = 262123, upload-time = "2025-12-28T15:42:47.108Z" }, + { url = "https://files.pythonhosted.org/packages/06/c5/8c0515692fb4c73ac379d8dc09b18eaf0214ecb76ea6e62467ba7a1556ff/coverage-7.13.1-cp314-cp314t-win32.whl", hash = "sha256:18be793c4c87de2965e1c0f060f03d9e5aff66cfeae8e1dbe6e5b88056ec153f", size = 222562, upload-time = "2025-12-28T15:42:49.144Z" }, + { url = "https://files.pythonhosted.org/packages/05/0e/c0a0c4678cb30dac735811db529b321d7e1c9120b79bd728d4f4d6b010e9/coverage-7.13.1-cp314-cp314t-win_amd64.whl", hash = "sha256:0e42e0ec0cd3e0d851cb3c91f770c9301f48647cb2877cb78f74bdaa07639a79", size = 223670, upload-time = "2025-12-28T15:42:51.218Z" }, + { url = "https://files.pythonhosted.org/packages/f5/5f/b177aa0011f354abf03a8f30a85032686d290fdeed4222b27d36b4372a50/coverage-7.13.1-cp314-cp314t-win_arm64.whl", hash = "sha256:eaecf47ef10c72ece9a2a92118257da87e460e113b83cc0d2905cbbe931792b4", size = 221707, upload-time = "2025-12-28T15:42:53.034Z" }, + { url = "https://files.pythonhosted.org/packages/cc/48/d9f421cb8da5afaa1a64570d9989e00fb7955e6acddc5a12979f7666ef60/coverage-7.13.1-py3-none-any.whl", hash = "sha256:2016745cb3ba554469d02819d78958b571792bb68e31302610e898f80dd3a573", size = 210722, upload-time = "2025-12-28T15:42:54.901Z" }, +] + +[package.optional-dependencies] +toml = [ + { name = "tomli", marker = "python_full_version <= '3.11'" }, +] + +[[package]] +name = "dnspython" +version = "2.8.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/8c/8b/57666417c0f90f08bcafa776861060426765fdb422eb10212086fb811d26/dnspython-2.8.0.tar.gz", hash = "sha256:181d3c6996452cb1189c4046c61599b84a5a86e099562ffde77d26984ff26d0f", size = 368251, upload-time = "2025-09-07T18:58:00.022Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ba/5a/18ad964b0086c6e62e2e7500f7edc89e3faa45033c71c1893d34eed2b2de/dnspython-2.8.0-py3-none-any.whl", hash = "sha256:01d9bbc4a2d76bf0db7c1f729812ded6d912bd318d3b1cf81d30c0f845dbf3af", size = 331094, upload-time = "2025-09-07T18:57:58.071Z" }, +] + +[[package]] +name = "eventlet" +version = "0.40.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "dnspython" }, + { name = "greenlet" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/d1/d8/f72d8583db7c559445e0e9500a9b9787332370c16980802204a403634585/eventlet-0.40.4.tar.gz", hash = "sha256:69bef712b1be18b4930df6f0c495d2a882bf7b63aa111e7b6eeff461cfcaf26f", size = 565920, upload-time = "2025-11-26T13:57:31.126Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/22/6d/8e1fa901f6a8307f90e7bd932064e27a0062a4a7a16af38966a9c3293c52/eventlet-0.40.4-py3-none-any.whl", hash = "sha256:6326c6d0bf55810bece151f7a5750207c610f389ba110ffd1541ed6e5215485b", size = 364588, upload-time = "2025-11-26T13:57:29.09Z" }, +] + +[[package]] +name = "exceptiongroup" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8a/0e/97c33bf5009bdbac74fd2beace167cab3f978feb69cc36f1ef79360d6c4e/exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598", size = 16740, upload-time = "2025-11-21T23:01:53.443Z" }, +] + +[[package]] +name = "gevent" +version = "25.9.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cffi", marker = "platform_python_implementation == 'CPython' and sys_platform == 'win32'" }, + { name = "greenlet", marker = "platform_python_implementation == 'CPython'" }, + { name = "zope-event" }, + { name = "zope-interface" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9e/48/b3ef2673ffb940f980966694e40d6d32560f3ffa284ecaeb5ea3a90a6d3f/gevent-25.9.1.tar.gz", hash = "sha256:adf9cd552de44a4e6754c51ff2e78d9193b7fa6eab123db9578a210e657235dd", size = 5059025, upload-time = "2025-09-17T16:15:34.528Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ae/c7/2c60fc4e5c9144f2b91e23af8d87c626870ad3183cfd09d2b3ba6d699178/gevent-25.9.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:856b990be5590e44c3a3dc6c8d48a40eaccbb42e99d2b791d11d1e7711a4297e", size = 1831980, upload-time = "2025-09-17T15:41:22.597Z" }, + { url = "https://files.pythonhosted.org/packages/2e/ae/49bf0a01f95a1c92c001d7b3f482a2301626b8a0617f448c4cd14ca9b5d4/gevent-25.9.1-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:fe1599d0b30e6093eb3213551751b24feeb43db79f07e89d98dd2f3330c9063e", size = 1918777, upload-time = "2025-09-17T15:48:57.223Z" }, + { url = "https://files.pythonhosted.org/packages/88/3f/266d2eb9f5d75c184a55a39e886b53a4ea7f42ff31f195220a363f0e3f9e/gevent-25.9.1-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:f0d8b64057b4bf1529b9ef9bd2259495747fba93d1f836c77bfeaacfec373fd0", size = 1869235, upload-time = "2025-09-17T15:49:18.255Z" }, + { url = "https://files.pythonhosted.org/packages/76/24/c0c7c7db70ca74c7b1918388ebda7c8c2a3c3bff0bbfbaa9280ed04b3340/gevent-25.9.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b56cbc820e3136ba52cd690bdf77e47a4c239964d5f80dc657c1068e0fe9521c", size = 2177334, upload-time = "2025-09-17T15:15:10.073Z" }, + { url = "https://files.pythonhosted.org/packages/4c/1e/de96bd033c03955f54c455b51a5127b1d540afcfc97838d1801fafce6d2e/gevent-25.9.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:c5fa9ce5122c085983e33e0dc058f81f5264cebe746de5c401654ab96dddfca8", size = 1847708, upload-time = "2025-09-17T15:52:38.475Z" }, + { url = "https://files.pythonhosted.org/packages/26/8b/6851e9cd3e4f322fa15c1d196cbf1a8a123da69788b078227dd13dd4208f/gevent-25.9.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:03c74fec58eda4b4edc043311fca8ba4f8744ad1632eb0a41d5ec25413581975", size = 2234274, upload-time = "2025-09-17T15:24:07.797Z" }, + { url = "https://files.pythonhosted.org/packages/0f/d8/b1178b70538c91493bec283018b47c16eab4bac9ddf5a3d4b7dd905dab60/gevent-25.9.1-cp310-cp310-win_amd64.whl", hash = "sha256:a8ae9f895e8651d10b0a8328a61c9c53da11ea51b666388aa99b0ce90f9fdc27", size = 1695326, upload-time = "2025-09-17T20:10:25.455Z" }, + { url = "https://files.pythonhosted.org/packages/81/86/03f8db0704fed41b0fa830425845f1eb4e20c92efa3f18751ee17809e9c6/gevent-25.9.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:18e5aff9e8342dc954adb9c9c524db56c2f3557999463445ba3d9cbe3dada7b7", size = 1792418, upload-time = "2025-09-17T15:41:24.384Z" }, + { url = "https://files.pythonhosted.org/packages/5f/35/f6b3a31f0849a62cfa2c64574bcc68a781d5499c3195e296e892a121a3cf/gevent-25.9.1-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:1cdf6db28f050ee103441caa8b0448ace545364f775059d5e2de089da975c457", size = 1875700, upload-time = "2025-09-17T15:48:59.652Z" }, + { url = "https://files.pythonhosted.org/packages/66/1e/75055950aa9b48f553e061afa9e3728061b5ccecca358cef19166e4ab74a/gevent-25.9.1-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:812debe235a8295be3b2a63b136c2474241fa5c58af55e6a0f8cfc29d4936235", size = 1831365, upload-time = "2025-09-17T15:49:19.426Z" }, + { url = "https://files.pythonhosted.org/packages/31/e8/5c1f6968e5547e501cfa03dcb0239dff55e44c3660a37ec534e32a0c008f/gevent-25.9.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b28b61ff9216a3d73fe8f35669eefcafa957f143ac534faf77e8a19eb9e6883a", size = 2122087, upload-time = "2025-09-17T15:15:12.329Z" }, + { url = "https://files.pythonhosted.org/packages/c0/2c/ebc5d38a7542af9fb7657bfe10932a558bb98c8a94e4748e827d3823fced/gevent-25.9.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5e4b6278b37373306fc6b1e5f0f1cf56339a1377f67c35972775143d8d7776ff", size = 1808776, upload-time = "2025-09-17T15:52:40.16Z" }, + { url = "https://files.pythonhosted.org/packages/e6/26/e1d7d6c8ffbf76fe1fbb4e77bdb7f47d419206adc391ec40a8ace6ebbbf0/gevent-25.9.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:d99f0cb2ce43c2e8305bf75bee61a8bde06619d21b9d0316ea190fc7a0620a56", size = 2179141, upload-time = "2025-09-17T15:24:09.895Z" }, + { url = "https://files.pythonhosted.org/packages/1d/6c/bb21fd9c095506aeeaa616579a356aa50935165cc0f1e250e1e0575620a7/gevent-25.9.1-cp311-cp311-win_amd64.whl", hash = "sha256:72152517ecf548e2f838c61b4be76637d99279dbaa7e01b3924df040aa996586", size = 1677941, upload-time = "2025-09-17T19:59:50.185Z" }, + { url = "https://files.pythonhosted.org/packages/f7/49/e55930ba5259629eb28ac7ee1abbca971996a9165f902f0249b561602f24/gevent-25.9.1-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:46b188248c84ffdec18a686fcac5dbb32365d76912e14fda350db5dc0bfd4f86", size = 2955991, upload-time = "2025-09-17T14:52:30.568Z" }, + { url = "https://files.pythonhosted.org/packages/aa/88/63dc9e903980e1da1e16541ec5c70f2b224ec0a8e34088cb42794f1c7f52/gevent-25.9.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:f2b54ea3ca6f0c763281cd3f96010ac7e98c2e267feb1221b5a26e2ca0b9a692", size = 1808503, upload-time = "2025-09-17T15:41:25.59Z" }, + { url = "https://files.pythonhosted.org/packages/7a/8d/7236c3a8f6ef7e94c22e658397009596fa90f24c7d19da11ad7ab3a9248e/gevent-25.9.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:7a834804ac00ed8a92a69d3826342c677be651b1c3cd66cc35df8bc711057aa2", size = 1890001, upload-time = "2025-09-17T15:49:01.227Z" }, + { url = "https://files.pythonhosted.org/packages/4f/63/0d7f38c4a2085ecce26b50492fc6161aa67250d381e26d6a7322c309b00f/gevent-25.9.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:323a27192ec4da6b22a9e51c3d9d896ff20bc53fdc9e45e56eaab76d1c39dd74", size = 1855335, upload-time = "2025-09-17T15:49:20.582Z" }, + { url = "https://files.pythonhosted.org/packages/95/18/da5211dfc54c7a57e7432fd9a6ffeae1ce36fe5a313fa782b1c96529ea3d/gevent-25.9.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:6ea78b39a2c51d47ff0f130f4c755a9a4bbb2dd9721149420ad4712743911a51", size = 2109046, upload-time = "2025-09-17T15:15:13.817Z" }, + { url = "https://files.pythonhosted.org/packages/a6/5a/7bb5ec8e43a2c6444853c4a9f955f3e72f479d7c24ea86c95fb264a2de65/gevent-25.9.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:dc45cd3e1cc07514a419960af932a62eb8515552ed004e56755e4bf20bad30c5", size = 1827099, upload-time = "2025-09-17T15:52:41.384Z" }, + { url = "https://files.pythonhosted.org/packages/ca/d4/b63a0a60635470d7d986ef19897e893c15326dd69e8fb342c76a4f07fe9e/gevent-25.9.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:34e01e50c71eaf67e92c186ee0196a039d6e4f4b35670396baed4a2d8f1b347f", size = 2172623, upload-time = "2025-09-17T15:24:12.03Z" }, + { url = "https://files.pythonhosted.org/packages/d5/98/caf06d5d22a7c129c1fb2fc1477306902a2c8ddfd399cd26bbbd4caf2141/gevent-25.9.1-cp312-cp312-win_amd64.whl", hash = "sha256:4acd6bcd5feabf22c7c5174bd3b9535ee9f088d2bbce789f740ad8d6554b18f3", size = 1682837, upload-time = "2025-09-17T19:48:47.318Z" }, + { url = "https://files.pythonhosted.org/packages/5a/77/b97f086388f87f8ad3e01364f845004aef0123d4430241c7c9b1f9bde742/gevent-25.9.1-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:4f84591d13845ee31c13f44bdf6bd6c3dbf385b5af98b2f25ec328213775f2ed", size = 2973739, upload-time = "2025-09-17T14:53:30.279Z" }, + { url = "https://files.pythonhosted.org/packages/3c/2e/9d5f204ead343e5b27bbb2fedaec7cd0009d50696b2266f590ae845d0331/gevent-25.9.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:9cdbb24c276a2d0110ad5c978e49daf620b153719ac8a548ce1250a7eb1b9245", size = 1809165, upload-time = "2025-09-17T15:41:27.193Z" }, + { url = "https://files.pythonhosted.org/packages/10/3e/791d1bf1eb47748606d5f2c2aa66571f474d63e0176228b1f1fd7b77ab37/gevent-25.9.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:88b6c07169468af631dcf0fdd3658f9246d6822cc51461d43f7c44f28b0abb82", size = 1890638, upload-time = "2025-09-17T15:49:02.45Z" }, + { url = "https://files.pythonhosted.org/packages/f2/5c/9ad0229b2b4d81249ca41e4f91dd8057deaa0da6d4fbe40bf13cdc5f7a47/gevent-25.9.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:b7bb0e29a7b3e6ca9bed2394aa820244069982c36dc30b70eb1004dd67851a48", size = 1857118, upload-time = "2025-09-17T15:49:22.125Z" }, + { url = "https://files.pythonhosted.org/packages/49/2a/3010ed6c44179a3a5c5c152e6de43a30ff8bc2c8de3115ad8733533a018f/gevent-25.9.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:2951bb070c0ee37b632ac9134e4fdaad70d2e660c931bb792983a0837fe5b7d7", size = 2111598, upload-time = "2025-09-17T15:15:15.226Z" }, + { url = "https://files.pythonhosted.org/packages/08/75/6bbe57c19a7aa4527cc0f9afcdf5a5f2aed2603b08aadbccb5bf7f607ff4/gevent-25.9.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:e4e17c2d57e9a42e25f2a73d297b22b60b2470a74be5a515b36c984e1a246d47", size = 1829059, upload-time = "2025-09-17T15:52:42.596Z" }, + { url = "https://files.pythonhosted.org/packages/06/6e/19a9bee9092be45679cb69e4dd2e0bf5f897b7140b4b39c57cc123d24829/gevent-25.9.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8d94936f8f8b23d9de2251798fcb603b84f083fdf0d7f427183c1828fb64f117", size = 2173529, upload-time = "2025-09-17T15:24:13.897Z" }, + { url = "https://files.pythonhosted.org/packages/ca/4f/50de9afd879440e25737e63f5ba6ee764b75a3abe17376496ab57f432546/gevent-25.9.1-cp313-cp313-win_amd64.whl", hash = "sha256:eb51c5f9537b07da673258b4832f6635014fee31690c3f0944d34741b69f92fa", size = 1681518, upload-time = "2025-09-17T19:39:47.488Z" }, + { url = "https://files.pythonhosted.org/packages/15/1a/948f8167b2cdce573cf01cec07afc64d0456dc134b07900b26ac7018b37e/gevent-25.9.1-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:1a3fe4ea1c312dbf6b375b416925036fe79a40054e6bf6248ee46526ea628be1", size = 2982934, upload-time = "2025-09-17T14:54:11.302Z" }, + { url = "https://files.pythonhosted.org/packages/9b/ec/726b146d1d3aad82e03d2e1e1507048ab6072f906e83f97f40667866e582/gevent-25.9.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:0adb937f13e5fb90cca2edf66d8d7e99d62a299687400ce2edee3f3504009356", size = 1813982, upload-time = "2025-09-17T15:41:28.506Z" }, + { url = "https://files.pythonhosted.org/packages/35/5d/5f83f17162301662bd1ce702f8a736a8a8cac7b7a35e1d8b9866938d1f9d/gevent-25.9.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:427f869a2050a4202d93cf7fd6ab5cffb06d3e9113c10c967b6e2a0d45237cb8", size = 1894902, upload-time = "2025-09-17T15:49:03.702Z" }, + { url = "https://files.pythonhosted.org/packages/83/cd/cf5e74e353f60dab357829069ffc300a7bb414c761f52cf8c0c6e9728b8d/gevent-25.9.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:c049880175e8c93124188f9d926af0a62826a3b81aa6d3074928345f8238279e", size = 1861792, upload-time = "2025-09-17T15:49:23.279Z" }, + { url = "https://files.pythonhosted.org/packages/dd/65/b9a4526d4a4edce26fe4b3b993914ec9dc64baabad625a3101e51adb17f3/gevent-25.9.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b5a67a0974ad9f24721034d1e008856111e0535f1541499f72a733a73d658d1c", size = 2113215, upload-time = "2025-09-17T15:15:16.34Z" }, + { url = "https://files.pythonhosted.org/packages/e5/be/7d35731dfaf8370795b606e515d964a0967e129db76ea7873f552045dd39/gevent-25.9.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:1d0f5d8d73f97e24ea8d24d8be0f51e0cf7c54b8021c1fddb580bf239474690f", size = 1833449, upload-time = "2025-09-17T15:52:43.75Z" }, + { url = "https://files.pythonhosted.org/packages/65/58/7bc52544ea5e63af88c4a26c90776feb42551b7555a1c89c20069c168a3f/gevent-25.9.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ddd3ff26e5c4240d3fbf5516c2d9d5f2a998ef87cfb73e1429cfaeaaec860fa6", size = 2176034, upload-time = "2025-09-17T15:24:15.676Z" }, + { url = "https://files.pythonhosted.org/packages/c2/69/a7c4ba2ffbc7c7dbf6d8b4f5d0f0a421f7815d229f4909854266c445a3d4/gevent-25.9.1-cp314-cp314-win_amd64.whl", hash = "sha256:bb63c0d6cb9950cc94036a4995b9cc4667b8915366613449236970f4394f94d7", size = 1703019, upload-time = "2025-09-17T19:30:55.272Z" }, +] + +[[package]] +name = "greenlet" +version = "3.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c7/e5/40dbda2736893e3e53d25838e0f19a2b417dfc122b9989c91918db30b5d3/greenlet-3.3.0.tar.gz", hash = "sha256:a82bb225a4e9e4d653dd2fb7b8b2d36e4fb25bc0165422a11e48b88e9e6f78fb", size = 190651, upload-time = "2025-12-04T14:49:44.05Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/32/6a/33d1702184d94106d3cdd7bfb788e19723206fce152e303473ca3b946c7b/greenlet-3.3.0-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:6f8496d434d5cb2dce025773ba5597f71f5410ae499d5dd9533e0653258cdb3d", size = 273658, upload-time = "2025-12-04T14:23:37.494Z" }, + { url = "https://files.pythonhosted.org/packages/d6/b7/2b5805bbf1907c26e434f4e448cd8b696a0b71725204fa21a211ff0c04a7/greenlet-3.3.0-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b96dc7eef78fd404e022e165ec55327f935b9b52ff355b067eb4a0267fc1cffb", size = 574810, upload-time = "2025-12-04T14:50:04.154Z" }, + { url = "https://files.pythonhosted.org/packages/94/38/343242ec12eddf3d8458c73f555c084359883d4ddc674240d9e61ec51fd6/greenlet-3.3.0-cp310-cp310-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:73631cd5cccbcfe63e3f9492aaa664d278fda0ce5c3d43aeda8e77317e38efbd", size = 586248, upload-time = "2025-12-04T14:57:39.35Z" }, + { url = "https://files.pythonhosted.org/packages/f0/d0/0ae86792fb212e4384041e0ef8e7bc66f59a54912ce407d26a966ed2914d/greenlet-3.3.0-cp310-cp310-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b299a0cb979f5d7197442dccc3aee67fce53500cd88951b7e6c35575701c980b", size = 597403, upload-time = "2025-12-04T15:07:10.831Z" }, + { url = "https://files.pythonhosted.org/packages/b6/a8/15d0aa26c0036a15d2659175af00954aaaa5d0d66ba538345bd88013b4d7/greenlet-3.3.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7dee147740789a4632cace364816046e43310b59ff8fb79833ab043aefa72fd5", size = 586910, upload-time = "2025-12-04T14:25:59.705Z" }, + { url = "https://files.pythonhosted.org/packages/e1/9b/68d5e3b7ccaba3907e5532cf8b9bf16f9ef5056a008f195a367db0ff32db/greenlet-3.3.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:39b28e339fc3c348427560494e28d8a6f3561c8d2bcf7d706e1c624ed8d822b9", size = 1547206, upload-time = "2025-12-04T15:04:21.027Z" }, + { url = "https://files.pythonhosted.org/packages/66/bd/e3086ccedc61e49f91e2cfb5ffad9d8d62e5dc85e512a6200f096875b60c/greenlet-3.3.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:b3c374782c2935cc63b2a27ba8708471de4ad1abaa862ffdb1ef45a643ddbb7d", size = 1613359, upload-time = "2025-12-04T14:27:26.548Z" }, + { url = "https://files.pythonhosted.org/packages/f4/6b/d4e73f5dfa888364bbf02efa85616c6714ae7c631c201349782e5b428925/greenlet-3.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:b49e7ed51876b459bd645d83db257f0180e345d3f768a35a85437a24d5a49082", size = 300740, upload-time = "2025-12-04T14:47:52.773Z" }, + { url = "https://files.pythonhosted.org/packages/1f/cb/48e964c452ca2b92175a9b2dca037a553036cb053ba69e284650ce755f13/greenlet-3.3.0-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:e29f3018580e8412d6aaf5641bb7745d38c85228dacf51a73bd4e26ddf2a6a8e", size = 274908, upload-time = "2025-12-04T14:23:26.435Z" }, + { url = "https://files.pythonhosted.org/packages/28/da/38d7bff4d0277b594ec557f479d65272a893f1f2a716cad91efeb8680953/greenlet-3.3.0-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a687205fb22794e838f947e2194c0566d3812966b41c78709554aa883183fb62", size = 577113, upload-time = "2025-12-04T14:50:05.493Z" }, + { url = "https://files.pythonhosted.org/packages/3c/f2/89c5eb0faddc3ff014f1c04467d67dee0d1d334ab81fadbf3744847f8a8a/greenlet-3.3.0-cp311-cp311-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4243050a88ba61842186cb9e63c7dfa677ec146160b0efd73b855a3d9c7fcf32", size = 590338, upload-time = "2025-12-04T14:57:41.136Z" }, + { url = "https://files.pythonhosted.org/packages/80/d7/db0a5085035d05134f8c089643da2b44cc9b80647c39e93129c5ef170d8f/greenlet-3.3.0-cp311-cp311-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:670d0f94cd302d81796e37299bcd04b95d62403883b24225c6b5271466612f45", size = 601098, upload-time = "2025-12-04T15:07:11.898Z" }, + { url = "https://files.pythonhosted.org/packages/dc/a6/e959a127b630a58e23529972dbc868c107f9d583b5a9f878fb858c46bc1a/greenlet-3.3.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6cb3a8ec3db4a3b0eb8a3c25436c2d49e3505821802074969db017b87bc6a948", size = 590206, upload-time = "2025-12-04T14:26:01.254Z" }, + { url = "https://files.pythonhosted.org/packages/48/60/29035719feb91798693023608447283b266b12efc576ed013dd9442364bb/greenlet-3.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:2de5a0b09eab81fc6a382791b995b1ccf2b172a9fec934747a7a23d2ff291794", size = 1550668, upload-time = "2025-12-04T15:04:22.439Z" }, + { url = "https://files.pythonhosted.org/packages/0a/5f/783a23754b691bfa86bd72c3033aa107490deac9b2ef190837b860996c9f/greenlet-3.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:4449a736606bd30f27f8e1ff4678ee193bc47f6ca810d705981cfffd6ce0d8c5", size = 1615483, upload-time = "2025-12-04T14:27:28.083Z" }, + { url = "https://files.pythonhosted.org/packages/1d/d5/c339b3b4bc8198b7caa4f2bd9fd685ac9f29795816d8db112da3d04175bb/greenlet-3.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:7652ee180d16d447a683c04e4c5f6441bae7ba7b17ffd9f6b3aff4605e9e6f71", size = 301164, upload-time = "2025-12-04T14:42:51.577Z" }, + { url = "https://files.pythonhosted.org/packages/f8/0a/a3871375c7b9727edaeeea994bfff7c63ff7804c9829c19309ba2e058807/greenlet-3.3.0-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:b01548f6e0b9e9784a2c99c5651e5dc89ffcbe870bc5fb2e5ef864e9cc6b5dcb", size = 276379, upload-time = "2025-12-04T14:23:30.498Z" }, + { url = "https://files.pythonhosted.org/packages/43/ab/7ebfe34dce8b87be0d11dae91acbf76f7b8246bf9d6b319c741f99fa59c6/greenlet-3.3.0-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:349345b770dc88f81506c6861d22a6ccd422207829d2c854ae2af8025af303e3", size = 597294, upload-time = "2025-12-04T14:50:06.847Z" }, + { url = "https://files.pythonhosted.org/packages/a4/39/f1c8da50024feecd0793dbd5e08f526809b8ab5609224a2da40aad3a7641/greenlet-3.3.0-cp312-cp312-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e8e18ed6995e9e2c0b4ed264d2cf89260ab3ac7e13555b8032b25a74c6d18655", size = 607742, upload-time = "2025-12-04T14:57:42.349Z" }, + { url = "https://files.pythonhosted.org/packages/77/cb/43692bcd5f7a0da6ec0ec6d58ee7cddb606d055ce94a62ac9b1aa481e969/greenlet-3.3.0-cp312-cp312-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c024b1e5696626890038e34f76140ed1daf858e37496d33f2af57f06189e70d7", size = 622297, upload-time = "2025-12-04T15:07:13.552Z" }, + { url = "https://files.pythonhosted.org/packages/75/b0/6bde0b1011a60782108c01de5913c588cf51a839174538d266de15e4bf4d/greenlet-3.3.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:047ab3df20ede6a57c35c14bf5200fcf04039d50f908270d3f9a7a82064f543b", size = 609885, upload-time = "2025-12-04T14:26:02.368Z" }, + { url = "https://files.pythonhosted.org/packages/49/0e/49b46ac39f931f59f987b7cd9f34bfec8ef81d2a1e6e00682f55be5de9f4/greenlet-3.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2d9ad37fc657b1102ec880e637cccf20191581f75c64087a549e66c57e1ceb53", size = 1567424, upload-time = "2025-12-04T15:04:23.757Z" }, + { url = "https://files.pythonhosted.org/packages/05/f5/49a9ac2dff7f10091935def9165c90236d8f175afb27cbed38fb1d61ab6b/greenlet-3.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:83cd0e36932e0e7f36a64b732a6f60c2fc2df28c351bae79fbaf4f8092fe7614", size = 1636017, upload-time = "2025-12-04T14:27:29.688Z" }, + { url = "https://files.pythonhosted.org/packages/6c/79/3912a94cf27ec503e51ba493692d6db1e3cd8ac7ac52b0b47c8e33d7f4f9/greenlet-3.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:a7a34b13d43a6b78abf828a6d0e87d3385680eaf830cd60d20d52f249faabf39", size = 301964, upload-time = "2025-12-04T14:36:58.316Z" }, + { url = "https://files.pythonhosted.org/packages/02/2f/28592176381b9ab2cafa12829ba7b472d177f3acc35d8fbcf3673d966fff/greenlet-3.3.0-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:a1e41a81c7e2825822f4e068c48cb2196002362619e2d70b148f20a831c00739", size = 275140, upload-time = "2025-12-04T14:23:01.282Z" }, + { url = "https://files.pythonhosted.org/packages/2c/80/fbe937bf81e9fca98c981fe499e59a3f45df2a04da0baa5c2be0dca0d329/greenlet-3.3.0-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9f515a47d02da4d30caaa85b69474cec77b7929b2e936ff7fb853d42f4bf8808", size = 599219, upload-time = "2025-12-04T14:50:08.309Z" }, + { url = "https://files.pythonhosted.org/packages/c2/ff/7c985128f0514271b8268476af89aee6866df5eec04ac17dcfbc676213df/greenlet-3.3.0-cp313-cp313-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7d2d9fd66bfadf230b385fdc90426fcd6eb64db54b40c495b72ac0feb5766c54", size = 610211, upload-time = "2025-12-04T14:57:43.968Z" }, + { url = "https://files.pythonhosted.org/packages/79/07/c47a82d881319ec18a4510bb30463ed6891f2ad2c1901ed5ec23d3de351f/greenlet-3.3.0-cp313-cp313-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:30a6e28487a790417d036088b3bcb3f3ac7d8babaa7d0139edbaddebf3af9492", size = 624311, upload-time = "2025-12-04T15:07:14.697Z" }, + { url = "https://files.pythonhosted.org/packages/fd/8e/424b8c6e78bd9837d14ff7df01a9829fc883ba2ab4ea787d4f848435f23f/greenlet-3.3.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:087ea5e004437321508a8d6f20efc4cfec5e3c30118e1417ea96ed1d93950527", size = 612833, upload-time = "2025-12-04T14:26:03.669Z" }, + { url = "https://files.pythonhosted.org/packages/b5/ba/56699ff9b7c76ca12f1cdc27a886d0f81f2189c3455ff9f65246780f713d/greenlet-3.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ab97cf74045343f6c60a39913fa59710e4bd26a536ce7ab2397adf8b27e67c39", size = 1567256, upload-time = "2025-12-04T15:04:25.276Z" }, + { url = "https://files.pythonhosted.org/packages/1e/37/f31136132967982d698c71a281a8901daf1a8fbab935dce7c0cf15f942cc/greenlet-3.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:5375d2e23184629112ca1ea89a53389dddbffcf417dad40125713d88eb5f96e8", size = 1636483, upload-time = "2025-12-04T14:27:30.804Z" }, + { url = "https://files.pythonhosted.org/packages/7e/71/ba21c3fb8c5dce83b8c01f458a42e99ffdb1963aeec08fff5a18588d8fd7/greenlet-3.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:9ee1942ea19550094033c35d25d20726e4f1c40d59545815e1128ac58d416d38", size = 301833, upload-time = "2025-12-04T14:32:23.929Z" }, + { url = "https://files.pythonhosted.org/packages/d7/7c/f0a6d0ede2c7bf092d00bc83ad5bafb7e6ec9b4aab2fbdfa6f134dc73327/greenlet-3.3.0-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:60c2ef0f578afb3c8d92ea07ad327f9a062547137afe91f38408f08aacab667f", size = 275671, upload-time = "2025-12-04T14:23:05.267Z" }, + { url = "https://files.pythonhosted.org/packages/44/06/dac639ae1a50f5969d82d2e3dd9767d30d6dbdbab0e1a54010c8fe90263c/greenlet-3.3.0-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0a5d554d0712ba1de0a6c94c640f7aeba3f85b3a6e1f2899c11c2c0428da9365", size = 646360, upload-time = "2025-12-04T14:50:10.026Z" }, + { url = "https://files.pythonhosted.org/packages/e0/94/0fb76fe6c5369fba9bf98529ada6f4c3a1adf19e406a47332245ef0eb357/greenlet-3.3.0-cp314-cp314-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:3a898b1e9c5f7307ebbde4102908e6cbfcb9ea16284a3abe15cab996bee8b9b3", size = 658160, upload-time = "2025-12-04T14:57:45.41Z" }, + { url = "https://files.pythonhosted.org/packages/93/79/d2c70cae6e823fac36c3bbc9077962105052b7ef81db2f01ec3b9bf17e2b/greenlet-3.3.0-cp314-cp314-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:dcd2bdbd444ff340e8d6bdf54d2f206ccddbb3ccfdcd3c25bf4afaa7b8f0cf45", size = 671388, upload-time = "2025-12-04T15:07:15.789Z" }, + { url = "https://files.pythonhosted.org/packages/b8/14/bab308fc2c1b5228c3224ec2bf928ce2e4d21d8046c161e44a2012b5203e/greenlet-3.3.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5773edda4dc00e173820722711d043799d3adb4f01731f40619e07ea2750b955", size = 660166, upload-time = "2025-12-04T14:26:05.099Z" }, + { url = "https://files.pythonhosted.org/packages/4b/d2/91465d39164eaa0085177f61983d80ffe746c5a1860f009811d498e7259c/greenlet-3.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ac0549373982b36d5fd5d30beb8a7a33ee541ff98d2b502714a09f1169f31b55", size = 1615193, upload-time = "2025-12-04T15:04:27.041Z" }, + { url = "https://files.pythonhosted.org/packages/42/1b/83d110a37044b92423084d52d5d5a3b3a73cafb51b547e6d7366ff62eff1/greenlet-3.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:d198d2d977460358c3b3a4dc844f875d1adb33817f0613f663a656f463764ccc", size = 1683653, upload-time = "2025-12-04T14:27:32.366Z" }, + { url = "https://files.pythonhosted.org/packages/7c/9a/9030e6f9aa8fd7808e9c31ba4c38f87c4f8ec324ee67431d181fe396d705/greenlet-3.3.0-cp314-cp314-win_amd64.whl", hash = "sha256:73f51dd0e0bdb596fb0417e475fa3c5e32d4c83638296e560086b8d7da7c4170", size = 305387, upload-time = "2025-12-04T14:26:51.063Z" }, + { url = "https://files.pythonhosted.org/packages/a0/66/bd6317bc5932accf351fc19f177ffba53712a202f9df10587da8df257c7e/greenlet-3.3.0-cp314-cp314t-macosx_11_0_universal2.whl", hash = "sha256:d6ed6f85fae6cdfdb9ce04c9bf7a08d666cfcfb914e7d006f44f840b46741931", size = 282638, upload-time = "2025-12-04T14:25:20.941Z" }, + { url = "https://files.pythonhosted.org/packages/30/cf/cc81cb030b40e738d6e69502ccbd0dd1bced0588e958f9e757945de24404/greenlet-3.3.0-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d9125050fcf24554e69c4cacb086b87b3b55dc395a8b3ebe6487b045b2614388", size = 651145, upload-time = "2025-12-04T14:50:11.039Z" }, + { url = "https://files.pythonhosted.org/packages/9c/ea/1020037b5ecfe95ca7df8d8549959baceb8186031da83d5ecceff8b08cd2/greenlet-3.3.0-cp314-cp314t-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:87e63ccfa13c0a0f6234ed0add552af24cc67dd886731f2261e46e241608bee3", size = 654236, upload-time = "2025-12-04T14:57:47.007Z" }, + { url = "https://files.pythonhosted.org/packages/69/cc/1e4bae2e45ca2fa55299f4e85854606a78ecc37fead20d69322f96000504/greenlet-3.3.0-cp314-cp314t-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2662433acbca297c9153a4023fe2161c8dcfdcc91f10433171cf7e7d94ba2221", size = 662506, upload-time = "2025-12-04T15:07:16.906Z" }, + { url = "https://files.pythonhosted.org/packages/57/b9/f8025d71a6085c441a7eaff0fd928bbb275a6633773667023d19179fe815/greenlet-3.3.0-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3c6e9b9c1527a78520357de498b0e709fb9e2f49c3a513afd5a249007261911b", size = 653783, upload-time = "2025-12-04T14:26:06.225Z" }, + { url = "https://files.pythonhosted.org/packages/f6/c7/876a8c7a7485d5d6b5c6821201d542ef28be645aa024cfe1145b35c120c1/greenlet-3.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:286d093f95ec98fdd92fcb955003b8a3d054b4e2cab3e2707a5039e7b50520fd", size = 1614857, upload-time = "2025-12-04T15:04:28.484Z" }, + { url = "https://files.pythonhosted.org/packages/4f/dc/041be1dff9f23dac5f48a43323cd0789cb798342011c19a248d9c9335536/greenlet-3.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:6c10513330af5b8ae16f023e8ddbfb486ab355d04467c4679c5cfe4659975dd9", size = 1676034, upload-time = "2025-12-04T14:27:33.531Z" }, +] + +[[package]] +name = "gunicorn" +source = { editable = "." } +dependencies = [ + { name = "packaging" }, +] + +[package.optional-dependencies] +eventlet = [ + { name = "eventlet" }, +] +gevent = [ + { name = "gevent" }, +] +setproctitle = [ + { name = "setproctitle" }, +] +testing = [ + { name = "coverage" }, + { name = "eventlet" }, + { name = "gevent" }, + { name = "pytest" }, + { name = "pytest-asyncio" }, + { name = "pytest-cov" }, +] +tornado = [ + { name = "tornado" }, +] + +[package.metadata] +requires-dist = [ + { name = "coverage", marker = "extra == 'testing'" }, + { name = "eventlet", marker = "extra == 'eventlet'", specifier = ">=0.40.3" }, + { name = "eventlet", marker = "extra == 'testing'", specifier = ">=0.40.3" }, + { name = "gevent", marker = "extra == 'gevent'", specifier = ">=23.9.0" }, + { name = "gevent", marker = "extra == 'testing'", specifier = ">=23.9.0" }, + { name = "packaging" }, + { name = "pytest", marker = "extra == 'testing'" }, + { name = "pytest-asyncio", marker = "extra == 'testing'" }, + { name = "pytest-cov", marker = "extra == 'testing'" }, + { name = "setproctitle", marker = "extra == 'setproctitle'" }, + { name = "tornado", marker = "extra == 'tornado'", specifier = ">=6.5.0" }, +] +provides-extras = ["gevent", "eventlet", "tornado", "gthread", "setproctitle", "testing"] + +[[package]] +name = "iniconfig" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, +] + +[[package]] +name = "packaging" +version = "26.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/65/ee/299d360cdc32edc7d2cf530f3accf79c4fca01e96ffc950d8a52213bd8e4/packaging-26.0.tar.gz", hash = "sha256:00243ae351a257117b6a241061796684b084ed1c516a08c48a3f7e147a9d80b4", size = 143416, upload-time = "2026-01-21T20:50:39.064Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl", hash = "sha256:b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529", size = 74366, upload-time = "2026-01-21T20:50:37.788Z" }, +] + +[[package]] +name = "pluggy" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, +] + +[[package]] +name = "pycparser" +version = "3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1b/7d/92392ff7815c21062bea51aa7b87d45576f649f16458d78b7cf94b9ab2e6/pycparser-3.0.tar.gz", hash = "sha256:600f49d217304a5902ac3c37e1281c9fe94e4d0489de643a9504c5cdfdfc6b29", size = 103492, upload-time = "2026-01-21T14:26:51.89Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0c/c3/44f3fbbfa403ea2a7c779186dc20772604442dde72947e7d01069cbe98e3/pycparser-3.0-py3-none-any.whl", hash = "sha256:b727414169a36b7d524c1c3e31839a521725078d7b2ff038656844266160a992", size = 48172, upload-time = "2026-01-21T14:26:50.693Z" }, +] + +[[package]] +name = "pygments" +version = "2.19.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" }, +] + +[[package]] +name = "pytest" +version = "9.0.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/d1/db/7ef3487e0fb0049ddb5ce41d3a49c235bf9ad299b6a25d5780a89f19230f/pytest-9.0.2.tar.gz", hash = "sha256:75186651a92bd89611d1d9fc20f0b4345fd827c41ccd5c299a868a05d70edf11", size = 1568901, upload-time = "2025-12-06T21:30:51.014Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3b/ab/b3226f0bd7cdcf710fbede2b3548584366da3b19b5021e74f5bde2a8fa3f/pytest-9.0.2-py3-none-any.whl", hash = "sha256:711ffd45bf766d5264d487b917733b453d917afd2b0ad65223959f59089f875b", size = 374801, upload-time = "2025-12-06T21:30:49.154Z" }, +] + +[[package]] +name = "pytest-asyncio" +version = "1.3.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "backports-asyncio-runner", marker = "python_full_version < '3.11'" }, + { name = "pytest" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/90/2c/8af215c0f776415f3590cac4f9086ccefd6fd463befeae41cd4d3f193e5a/pytest_asyncio-1.3.0.tar.gz", hash = "sha256:d7f52f36d231b80ee124cd216ffb19369aa168fc10095013c6b014a34d3ee9e5", size = 50087, upload-time = "2025-11-10T16:07:47.256Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e5/35/f8b19922b6a25bc0880171a2f1a003eaeb93657475193ab516fd87cac9da/pytest_asyncio-1.3.0-py3-none-any.whl", hash = "sha256:611e26147c7f77640e6d0a92a38ed17c3e9848063698d5c93d5aa7aa11cebff5", size = 15075, upload-time = "2025-11-10T16:07:45.537Z" }, +] + +[[package]] +name = "pytest-cov" +version = "7.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "coverage", extra = ["toml"] }, + { name = "pluggy" }, + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/5e/f7/c933acc76f5208b3b00089573cf6a2bc26dc80a8aece8f52bb7d6b1855ca/pytest_cov-7.0.0.tar.gz", hash = "sha256:33c97eda2e049a0c5298e91f519302a1334c26ac65c1a483d6206fd458361af1", size = 54328, upload-time = "2025-09-09T10:57:02.113Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ee/49/1377b49de7d0c1ce41292161ea0f721913fa8722c19fb9c1e3aa0367eecb/pytest_cov-7.0.0-py3-none-any.whl", hash = "sha256:3b8e9558b16cc1479da72058bdecf8073661c7f57f7d3c5f22a1c23507f2d861", size = 22424, upload-time = "2025-09-09T10:57:00.695Z" }, +] + +[[package]] +name = "setproctitle" +version = "1.3.7" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/8d/48/49393a96a2eef1ab418b17475fb92b8fcfad83d099e678751b05472e69de/setproctitle-1.3.7.tar.gz", hash = "sha256:bc2bc917691c1537d5b9bca1468437176809c7e11e5694ca79a9ca12345dcb9e", size = 27002, upload-time = "2025-09-05T12:51:25.278Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f2/48/fb401ec8c4953d519d05c87feca816ad668b8258448ff60579ac7a1c1386/setproctitle-1.3.7-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cf555b6299f10a6eb44e4f96d2f5a3884c70ce25dc5c8796aaa2f7b40e72cb1b", size = 18079, upload-time = "2025-09-05T12:49:07.732Z" }, + { url = "https://files.pythonhosted.org/packages/cc/a3/c2b0333c2716fb3b4c9a973dd113366ac51b4f8d56b500f4f8f704b4817a/setproctitle-1.3.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:690b4776f9c15aaf1023bb07d7c5b797681a17af98a4a69e76a1d504e41108b7", size = 13099, upload-time = "2025-09-05T12:49:09.222Z" }, + { url = "https://files.pythonhosted.org/packages/0e/f8/17bda581c517678260e6541b600eeb67745f53596dc077174141ba2f6702/setproctitle-1.3.7-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:00afa6fc507967d8c9d592a887cdc6c1f5742ceac6a4354d111ca0214847732c", size = 31793, upload-time = "2025-09-05T12:49:10.297Z" }, + { url = "https://files.pythonhosted.org/packages/27/d1/76a33ae80d4e788ecab9eb9b53db03e81cfc95367ec7e3fbf4989962fedd/setproctitle-1.3.7-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9e02667f6b9fc1238ba753c0f4b0a37ae184ce8f3bbbc38e115d99646b3f4cd3", size = 32779, upload-time = "2025-09-05T12:49:12.157Z" }, + { url = "https://files.pythonhosted.org/packages/59/27/1a07c38121967061564f5e0884414a5ab11a783260450172d4fc68c15621/setproctitle-1.3.7-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:83fcd271567d133eb9532d3b067c8a75be175b2b3b271e2812921a05303a693f", size = 34578, upload-time = "2025-09-05T12:49:13.393Z" }, + { url = "https://files.pythonhosted.org/packages/d8/d4/725e6353935962d8bb12cbf7e7abba1d0d738c7f6935f90239d8e1ccf913/setproctitle-1.3.7-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:13fe37951dda1a45c35d77d06e3da5d90e4f875c4918a7312b3b4556cfa7ff64", size = 32030, upload-time = "2025-09-05T12:49:15.362Z" }, + { url = "https://files.pythonhosted.org/packages/67/24/e4677ae8e1cb0d549ab558b12db10c175a889be0974c589c428fece5433e/setproctitle-1.3.7-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:a05509cfb2059e5d2ddff701d38e474169e9ce2a298cf1b6fd5f3a213a553fe5", size = 33363, upload-time = "2025-09-05T12:49:16.829Z" }, + { url = "https://files.pythonhosted.org/packages/55/d4/69ce66e4373a48fdbb37489f3ded476bb393e27f514968c3a69a67343ae0/setproctitle-1.3.7-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:6da835e76ae18574859224a75db6e15c4c2aaa66d300a57efeaa4c97ca4c7381", size = 31508, upload-time = "2025-09-05T12:49:18.032Z" }, + { url = "https://files.pythonhosted.org/packages/4b/5a/42c1ed0e9665d068146a68326529b5686a1881c8b9197c2664db4baf6aeb/setproctitle-1.3.7-cp310-cp310-win32.whl", hash = "sha256:9e803d1b1e20240a93bac0bc1025363f7f80cb7eab67dfe21efc0686cc59ad7c", size = 12558, upload-time = "2025-09-05T12:49:19.742Z" }, + { url = "https://files.pythonhosted.org/packages/dc/fe/dd206cc19a25561921456f6cb12b405635319299b6f366e0bebe872abc18/setproctitle-1.3.7-cp310-cp310-win_amd64.whl", hash = "sha256:a97200acc6b64ec4cada52c2ecaf1fba1ef9429ce9c542f8a7db5bcaa9dcbd95", size = 13245, upload-time = "2025-09-05T12:49:21.023Z" }, + { url = "https://files.pythonhosted.org/packages/04/cd/1b7ba5cad635510720ce19d7122154df96a2387d2a74217be552887c93e5/setproctitle-1.3.7-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:a600eeb4145fb0ee6c287cb82a2884bd4ec5bbb076921e287039dcc7b7cc6dd0", size = 18085, upload-time = "2025-09-05T12:49:22.183Z" }, + { url = "https://files.pythonhosted.org/packages/8f/1a/b2da0a620490aae355f9d72072ac13e901a9fec809a6a24fc6493a8f3c35/setproctitle-1.3.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:97a090fed480471bb175689859532709e28c085087e344bca45cf318034f70c4", size = 13097, upload-time = "2025-09-05T12:49:23.322Z" }, + { url = "https://files.pythonhosted.org/packages/18/2e/bd03ff02432a181c1787f6fc2a678f53b7dacdd5ded69c318fe1619556e8/setproctitle-1.3.7-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:1607b963e7b53e24ec8a2cb4e0ab3ae591d7c6bf0a160feef0551da63452b37f", size = 32191, upload-time = "2025-09-05T12:49:24.567Z" }, + { url = "https://files.pythonhosted.org/packages/28/78/1e62fc0937a8549f2220445ed2175daacee9b6764c7963b16148119b016d/setproctitle-1.3.7-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a20fb1a3974e2dab857870cf874b325b8705605cb7e7e8bcbb915bca896f52a9", size = 33203, upload-time = "2025-09-05T12:49:25.871Z" }, + { url = "https://files.pythonhosted.org/packages/a0/3c/65edc65db3fa3df400cf13b05e9d41a3c77517b4839ce873aa6b4043184f/setproctitle-1.3.7-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f8d961bba676e07d77665204f36cffaa260f526e7b32d07ab3df6a2c1dfb44ba", size = 34963, upload-time = "2025-09-05T12:49:27.044Z" }, + { url = "https://files.pythonhosted.org/packages/a1/32/89157e3de997973e306e44152522385f428e16f92f3cf113461489e1e2ee/setproctitle-1.3.7-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:db0fd964fbd3a9f8999b502f65bd2e20883fdb5b1fae3a424e66db9a793ed307", size = 32398, upload-time = "2025-09-05T12:49:28.909Z" }, + { url = "https://files.pythonhosted.org/packages/4a/18/77a765a339ddf046844cb4513353d8e9dcd8183da9cdba6e078713e6b0b2/setproctitle-1.3.7-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:db116850fcf7cca19492030f8d3b4b6e231278e8fe097a043957d22ce1bdf3ee", size = 33657, upload-time = "2025-09-05T12:49:30.323Z" }, + { url = "https://files.pythonhosted.org/packages/6b/63/f0b6205c64d74d2a24a58644a38ec77bdbaa6afc13747e75973bf8904932/setproctitle-1.3.7-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:316664d8b24a5c91ee244460bdaf7a74a707adaa9e14fbe0dc0a53168bb9aba1", size = 31836, upload-time = "2025-09-05T12:49:32.309Z" }, + { url = "https://files.pythonhosted.org/packages/ba/51/e1277f9ba302f1a250bbd3eedbbee747a244b3cc682eb58fb9733968f6d8/setproctitle-1.3.7-cp311-cp311-win32.whl", hash = "sha256:b74774ca471c86c09b9d5037c8451fff06bb82cd320d26ae5a01c758088c0d5d", size = 12556, upload-time = "2025-09-05T12:49:33.529Z" }, + { url = "https://files.pythonhosted.org/packages/b6/7b/822a23f17e9003dfdee92cd72758441ca2a3680388da813a371b716fb07f/setproctitle-1.3.7-cp311-cp311-win_amd64.whl", hash = "sha256:acb9097213a8dd3410ed9f0dc147840e45ca9797785272928d4be3f0e69e3be4", size = 13243, upload-time = "2025-09-05T12:49:34.553Z" }, + { url = "https://files.pythonhosted.org/packages/fb/f0/2dc88e842077719d7384d86cc47403e5102810492b33680e7dadcee64cd8/setproctitle-1.3.7-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:2dc99aec591ab6126e636b11035a70991bc1ab7a261da428491a40b84376654e", size = 18049, upload-time = "2025-09-05T12:49:36.241Z" }, + { url = "https://files.pythonhosted.org/packages/f0/b4/50940504466689cda65680c9e9a1e518e5750c10490639fa687489ac7013/setproctitle-1.3.7-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:cdd8aa571b7aa39840fdbea620e308a19691ff595c3a10231e9ee830339dd798", size = 13079, upload-time = "2025-09-05T12:49:38.088Z" }, + { url = "https://files.pythonhosted.org/packages/d0/99/71630546b9395b095f4082be41165d1078204d1696c2d9baade3de3202d0/setproctitle-1.3.7-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:2906b6c7959cdb75f46159bf0acd8cc9906cf1361c9e1ded0d065fe8f9039629", size = 32932, upload-time = "2025-09-05T12:49:39.271Z" }, + { url = "https://files.pythonhosted.org/packages/50/22/cee06af4ffcfb0e8aba047bd44f5262e644199ae7527ae2c1f672b86495c/setproctitle-1.3.7-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6915964a6dda07920a1159321dcd6d94fc7fc526f815ca08a8063aeca3c204f1", size = 33736, upload-time = "2025-09-05T12:49:40.565Z" }, + { url = "https://files.pythonhosted.org/packages/5c/00/a5949a8bb06ef5e7df214fc393bb2fb6aedf0479b17214e57750dfdd0f24/setproctitle-1.3.7-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:cff72899861c765bd4021d1ff1c68d60edc129711a2fdba77f9cb69ef726a8b6", size = 35605, upload-time = "2025-09-05T12:49:42.362Z" }, + { url = "https://files.pythonhosted.org/packages/b0/3a/50caca532a9343828e3bf5778c7a84d6c737a249b1796d50dd680290594d/setproctitle-1.3.7-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:b7cb05bd446687ff816a3aaaf831047fc4c364feff7ada94a66024f1367b448c", size = 33143, upload-time = "2025-09-05T12:49:43.515Z" }, + { url = "https://files.pythonhosted.org/packages/ca/14/b843a251296ce55e2e17c017d6b9f11ce0d3d070e9265de4ecad948b913d/setproctitle-1.3.7-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:3a57b9a00de8cae7e2a1f7b9f0c2ac7b69372159e16a7708aa2f38f9e5cc987a", size = 34434, upload-time = "2025-09-05T12:49:45.31Z" }, + { url = "https://files.pythonhosted.org/packages/c8/b7/06145c238c0a6d2c4bc881f8be230bb9f36d2bf51aff7bddcb796d5eed67/setproctitle-1.3.7-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:d8828b356114f6b308b04afe398ed93803d7fca4a955dd3abe84430e28d33739", size = 32795, upload-time = "2025-09-05T12:49:46.419Z" }, + { url = "https://files.pythonhosted.org/packages/ef/dc/ef76a81fac9bf27b84ed23df19c1f67391a753eed6e3c2254ebcb5133f56/setproctitle-1.3.7-cp312-cp312-win32.whl", hash = "sha256:b0304f905efc845829ac2bc791ddebb976db2885f6171f4a3de678d7ee3f7c9f", size = 12552, upload-time = "2025-09-05T12:49:47.635Z" }, + { url = "https://files.pythonhosted.org/packages/e2/5b/a9fe517912cd6e28cf43a212b80cb679ff179a91b623138a99796d7d18a0/setproctitle-1.3.7-cp312-cp312-win_amd64.whl", hash = "sha256:9888ceb4faea3116cf02a920ff00bfbc8cc899743e4b4ac914b03625bdc3c300", size = 13247, upload-time = "2025-09-05T12:49:49.16Z" }, + { url = "https://files.pythonhosted.org/packages/5d/2f/fcedcade3b307a391b6e17c774c6261a7166aed641aee00ed2aad96c63ce/setproctitle-1.3.7-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:c3736b2a423146b5e62230502e47e08e68282ff3b69bcfe08a322bee73407922", size = 18047, upload-time = "2025-09-05T12:49:50.271Z" }, + { url = "https://files.pythonhosted.org/packages/23/ae/afc141ca9631350d0a80b8f287aac79a76f26b6af28fd8bf92dae70dc2c5/setproctitle-1.3.7-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:3384e682b158d569e85a51cfbde2afd1ab57ecf93ea6651fe198d0ba451196ee", size = 13073, upload-time = "2025-09-05T12:49:51.46Z" }, + { url = "https://files.pythonhosted.org/packages/87/ed/0a4f00315bc02510395b95eec3d4aa77c07192ee79f0baae77ea7b9603d8/setproctitle-1.3.7-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:0564a936ea687cd24dffcea35903e2a20962aa6ac20e61dd3a207652401492dd", size = 33284, upload-time = "2025-09-05T12:49:52.741Z" }, + { url = "https://files.pythonhosted.org/packages/fc/e4/adf3c4c0a2173cb7920dc9df710bcc67e9bcdbf377e243b7a962dc31a51a/setproctitle-1.3.7-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a5d1cb3f81531f0eb40e13246b679a1bdb58762b170303463cb06ecc296f26d0", size = 34104, upload-time = "2025-09-05T12:49:54.416Z" }, + { url = "https://files.pythonhosted.org/packages/52/4f/6daf66394152756664257180439d37047aa9a1cfaa5e4f5ed35e93d1dc06/setproctitle-1.3.7-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a7d159e7345f343b44330cbba9194169b8590cb13dae940da47aa36a72aa9929", size = 35982, upload-time = "2025-09-05T12:49:56.295Z" }, + { url = "https://files.pythonhosted.org/packages/1b/62/f2c0595403cf915db031f346b0e3b2c0096050e90e0be658a64f44f4278a/setproctitle-1.3.7-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0b5074649797fd07c72ca1f6bff0406f4a42e1194faac03ecaab765ce605866f", size = 33150, upload-time = "2025-09-05T12:49:58.025Z" }, + { url = "https://files.pythonhosted.org/packages/a0/29/10dd41cde849fb2f9b626c846b7ea30c99c81a18a5037a45cc4ba33c19a7/setproctitle-1.3.7-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:61e96febced3f61b766115381d97a21a6265a0f29188a791f6df7ed777aef698", size = 34463, upload-time = "2025-09-05T12:49:59.424Z" }, + { url = "https://files.pythonhosted.org/packages/71/3c/cedd8eccfaf15fb73a2c20525b68c9477518917c9437737fa0fda91e378f/setproctitle-1.3.7-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:047138279f9463f06b858e579cc79580fbf7a04554d24e6bddf8fe5dddbe3d4c", size = 32848, upload-time = "2025-09-05T12:50:01.107Z" }, + { url = "https://files.pythonhosted.org/packages/d1/3e/0a0e27d1c9926fecccfd1f91796c244416c70bf6bca448d988638faea81d/setproctitle-1.3.7-cp313-cp313-win32.whl", hash = "sha256:7f47accafac7fe6535ba8ba9efd59df9d84a6214565108d0ebb1199119c9cbbd", size = 12544, upload-time = "2025-09-05T12:50:15.81Z" }, + { url = "https://files.pythonhosted.org/packages/36/1b/6bf4cb7acbbd5c846ede1c3f4d6b4ee52744d402e43546826da065ff2ab7/setproctitle-1.3.7-cp313-cp313-win_amd64.whl", hash = "sha256:fe5ca35aeec6dc50cabab9bf2d12fbc9067eede7ff4fe92b8f5b99d92e21263f", size = 13235, upload-time = "2025-09-05T12:50:16.89Z" }, + { url = "https://files.pythonhosted.org/packages/e6/a4/d588d3497d4714750e3eaf269e9e8985449203d82b16b933c39bd3fc52a1/setproctitle-1.3.7-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:10e92915c4b3086b1586933a36faf4f92f903c5554f3c34102d18c7d3f5378e9", size = 18058, upload-time = "2025-09-05T12:50:02.501Z" }, + { url = "https://files.pythonhosted.org/packages/05/77/7637f7682322a7244e07c373881c7e982567e2cb1dd2f31bd31481e45500/setproctitle-1.3.7-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:de879e9c2eab637f34b1a14c4da1e030c12658cdc69ee1b3e5be81b380163ce5", size = 13072, upload-time = "2025-09-05T12:50:03.601Z" }, + { url = "https://files.pythonhosted.org/packages/52/09/f366eca0973cfbac1470068d1313fa3fe3de4a594683385204ec7f1c4101/setproctitle-1.3.7-cp313-cp313t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:c18246d88e227a5b16248687514f95642505000442165f4b7db354d39d0e4c29", size = 34490, upload-time = "2025-09-05T12:50:04.948Z" }, + { url = "https://files.pythonhosted.org/packages/71/36/611fc2ed149fdea17c3677e1d0df30d8186eef9562acc248682b91312706/setproctitle-1.3.7-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7081f193dab22df2c36f9fc6d113f3793f83c27891af8fe30c64d89d9a37e152", size = 35267, upload-time = "2025-09-05T12:50:06.015Z" }, + { url = "https://files.pythonhosted.org/packages/88/a4/64e77d0671446bd5a5554387b69e1efd915274686844bea733714c828813/setproctitle-1.3.7-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9cc9b901ce129350637426a89cfd650066a4adc6899e47822e2478a74023ff7c", size = 37376, upload-time = "2025-09-05T12:50:07.484Z" }, + { url = "https://files.pythonhosted.org/packages/89/bc/ad9c664fe524fb4a4b2d3663661a5c63453ce851736171e454fa2cdec35c/setproctitle-1.3.7-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:80e177eff2d1ec172188d0d7fd9694f8e43d3aab76a6f5f929bee7bf7894e98b", size = 33963, upload-time = "2025-09-05T12:50:09.056Z" }, + { url = "https://files.pythonhosted.org/packages/ab/01/a36de7caf2d90c4c28678da1466b47495cbbad43badb4e982d8db8167ed4/setproctitle-1.3.7-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:23e520776c445478a67ee71b2a3c1ffdafbe1f9f677239e03d7e2cc635954e18", size = 35550, upload-time = "2025-09-05T12:50:10.791Z" }, + { url = "https://files.pythonhosted.org/packages/dd/68/17e8aea0ed5ebc17fbf03ed2562bfab277c280e3625850c38d92a7b5fcd9/setproctitle-1.3.7-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:5fa1953126a3b9bd47049d58c51b9dac72e78ed120459bd3aceb1bacee72357c", size = 33727, upload-time = "2025-09-05T12:50:12.032Z" }, + { url = "https://files.pythonhosted.org/packages/b2/33/90a3bf43fe3a2242b4618aa799c672270250b5780667898f30663fd94993/setproctitle-1.3.7-cp313-cp313t-win32.whl", hash = "sha256:4a5e212bf438a4dbeece763f4962ad472c6008ff6702e230b4f16a037e2f6f29", size = 12549, upload-time = "2025-09-05T12:50:13.074Z" }, + { url = "https://files.pythonhosted.org/packages/0b/0e/50d1f07f3032e1f23d814ad6462bc0a138f369967c72494286b8a5228e40/setproctitle-1.3.7-cp313-cp313t-win_amd64.whl", hash = "sha256:cf2727b733e90b4f874bac53e3092aa0413fe1ea6d4f153f01207e6ce65034d9", size = 13243, upload-time = "2025-09-05T12:50:14.146Z" }, + { url = "https://files.pythonhosted.org/packages/89/c7/43ac3a98414f91d1b86a276bc2f799ad0b4b010e08497a95750d5bc42803/setproctitle-1.3.7-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:80c36c6a87ff72eabf621d0c79b66f3bdd0ecc79e873c1e9f0651ee8bf215c63", size = 18052, upload-time = "2025-09-05T12:50:17.928Z" }, + { url = "https://files.pythonhosted.org/packages/cd/2c/dc258600a25e1a1f04948073826bebc55e18dbd99dc65a576277a82146fa/setproctitle-1.3.7-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:b53602371a52b91c80aaf578b5ada29d311d12b8a69c0c17fbc35b76a1fd4f2e", size = 13071, upload-time = "2025-09-05T12:50:19.061Z" }, + { url = "https://files.pythonhosted.org/packages/ab/26/8e3bb082992f19823d831f3d62a89409deb6092e72fc6940962983ffc94f/setproctitle-1.3.7-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:fcb966a6c57cf07cc9448321a08f3be6b11b7635be502669bc1d8745115d7e7f", size = 33180, upload-time = "2025-09-05T12:50:20.395Z" }, + { url = "https://files.pythonhosted.org/packages/f1/af/ae692a20276d1159dd0cf77b0bcf92cbb954b965655eb4a69672099bb214/setproctitle-1.3.7-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:46178672599b940368d769474fe13ecef1b587d58bb438ea72b9987f74c56ea5", size = 34043, upload-time = "2025-09-05T12:50:22.454Z" }, + { url = "https://files.pythonhosted.org/packages/34/b2/6a092076324dd4dac1a6d38482bedebbff5cf34ef29f58585ec76e47bc9d/setproctitle-1.3.7-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7f9e9e3ff135cbcc3edd2f4cf29b139f4aca040d931573102742db70ff428c17", size = 35892, upload-time = "2025-09-05T12:50:23.937Z" }, + { url = "https://files.pythonhosted.org/packages/1c/1a/8836b9f28cee32859ac36c3df85aa03e1ff4598d23ea17ca2e96b5845a8f/setproctitle-1.3.7-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:14c7eba8d90c93b0e79c01f0bd92a37b61983c27d6d7d5a3b5defd599113d60e", size = 32898, upload-time = "2025-09-05T12:50:25.617Z" }, + { url = "https://files.pythonhosted.org/packages/ef/22/8fabdc24baf42defb599714799d8445fe3ae987ec425a26ec8e80ea38f8e/setproctitle-1.3.7-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:9e64e98077fb30b6cf98073d6c439cd91deb8ebbf8fc62d9dbf52bd38b0c6ac0", size = 34308, upload-time = "2025-09-05T12:50:26.827Z" }, + { url = "https://files.pythonhosted.org/packages/15/1b/b9bee9de6c8cdcb3b3a6cb0b3e773afdb86bbbc1665a3bfa424a4294fda2/setproctitle-1.3.7-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b91387cc0f02a00ac95dcd93f066242d3cca10ff9e6153de7ee07069c6f0f7c8", size = 32536, upload-time = "2025-09-05T12:50:28.5Z" }, + { url = "https://files.pythonhosted.org/packages/37/0c/75e5f2685a5e3eda0b39a8b158d6d8895d6daf3ba86dec9e3ba021510272/setproctitle-1.3.7-cp314-cp314-win32.whl", hash = "sha256:52b054a61c99d1b72fba58b7f5486e04b20fefc6961cd76722b424c187f362ed", size = 12731, upload-time = "2025-09-05T12:50:43.955Z" }, + { url = "https://files.pythonhosted.org/packages/d2/ae/acddbce90d1361e1786e1fb421bc25baeb0c22ef244ee5d0176511769ec8/setproctitle-1.3.7-cp314-cp314-win_amd64.whl", hash = "sha256:5818e4080ac04da1851b3ec71e8a0f64e3748bf9849045180566d8b736702416", size = 13464, upload-time = "2025-09-05T12:50:45.057Z" }, + { url = "https://files.pythonhosted.org/packages/01/6d/20886c8ff2e6d85e3cabadab6aab9bb90acaf1a5cfcb04d633f8d61b2626/setproctitle-1.3.7-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:6fc87caf9e323ac426910306c3e5d3205cd9f8dcac06d233fcafe9337f0928a3", size = 18062, upload-time = "2025-09-05T12:50:29.78Z" }, + { url = "https://files.pythonhosted.org/packages/9a/60/26dfc5f198715f1343b95c2f7a1c16ae9ffa45bd89ffd45a60ed258d24ea/setproctitle-1.3.7-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:6134c63853d87a4897ba7d5cc0e16abfa687f6c66fc09f262bb70d67718f2309", size = 13075, upload-time = "2025-09-05T12:50:31.604Z" }, + { url = "https://files.pythonhosted.org/packages/21/9c/980b01f50d51345dd513047e3ba9e96468134b9181319093e61db1c47188/setproctitle-1.3.7-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:1403d2abfd32790b6369916e2313dffbe87d6b11dca5bbd898981bcde48e7a2b", size = 34744, upload-time = "2025-09-05T12:50:32.777Z" }, + { url = "https://files.pythonhosted.org/packages/86/b4/82cd0c86e6d1c4538e1a7eb908c7517721513b801dff4ba3f98ef816a240/setproctitle-1.3.7-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e7c5bfe4228ea22373e3025965d1a4116097e555ee3436044f5c954a5e63ac45", size = 35589, upload-time = "2025-09-05T12:50:34.13Z" }, + { url = "https://files.pythonhosted.org/packages/8a/4f/9f6b2a7417fd45673037554021c888b31247f7594ff4bd2239918c5cd6d0/setproctitle-1.3.7-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:585edf25e54e21a94ccb0fe81ad32b9196b69ebc4fc25f81da81fb8a50cca9e4", size = 37698, upload-time = "2025-09-05T12:50:35.524Z" }, + { url = "https://files.pythonhosted.org/packages/20/92/927b7d4744aac214d149c892cb5fa6dc6f49cfa040cb2b0a844acd63dcaf/setproctitle-1.3.7-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:96c38cdeef9036eb2724c2210e8d0b93224e709af68c435d46a4733a3675fee1", size = 34201, upload-time = "2025-09-05T12:50:36.697Z" }, + { url = "https://files.pythonhosted.org/packages/0a/0c/fd4901db5ba4b9d9013e62f61d9c18d52290497f956745cd3e91b0d80f90/setproctitle-1.3.7-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:45e3ef48350abb49cf937d0a8ba15e42cee1e5ae13ca41a77c66d1abc27a5070", size = 35801, upload-time = "2025-09-05T12:50:38.314Z" }, + { url = "https://files.pythonhosted.org/packages/e7/e3/54b496ac724e60e61cc3447f02690105901ca6d90da0377dffe49ff99fc7/setproctitle-1.3.7-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:1fae595d032b30dab4d659bece20debd202229fce12b55abab978b7f30783d73", size = 33958, upload-time = "2025-09-05T12:50:39.841Z" }, + { url = "https://files.pythonhosted.org/packages/ea/a8/c84bb045ebf8c6fdc7f7532319e86f8380d14bbd3084e6348df56bdfe6fd/setproctitle-1.3.7-cp314-cp314t-win32.whl", hash = "sha256:02432f26f5d1329ab22279ff863c83589894977063f59e6c4b4845804a08f8c2", size = 12745, upload-time = "2025-09-05T12:50:41.377Z" }, + { url = "https://files.pythonhosted.org/packages/08/b6/3a5a4f9952972791a9114ac01dfc123f0df79903577a3e0a7a404a695586/setproctitle-1.3.7-cp314-cp314t-win_amd64.whl", hash = "sha256:cbc388e3d86da1f766d8fc2e12682e446064c01cea9f88a88647cfe7c011de6a", size = 13469, upload-time = "2025-09-05T12:50:42.67Z" }, + { url = "https://files.pythonhosted.org/packages/34/8a/aff5506ce89bc3168cb492b18ba45573158d528184e8a9759a05a09088a9/setproctitle-1.3.7-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:eb440c5644a448e6203935ed60466ec8d0df7278cd22dc6cf782d07911bcbea6", size = 12654, upload-time = "2025-09-05T12:51:17.141Z" }, + { url = "https://files.pythonhosted.org/packages/41/89/5b6f2faedd6ced3d3c085a5efbd91380fb1f61f4c12bc42acad37932f4e9/setproctitle-1.3.7-pp310-pypy310_pp73-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:502b902a0e4c69031b87870ff4986c290ebbb12d6038a70639f09c331b18efb2", size = 14284, upload-time = "2025-09-05T12:51:18.393Z" }, + { url = "https://files.pythonhosted.org/packages/0a/c0/4312fed3ca393a29589603fd48f17937b4ed0638b923bac75a728382e730/setproctitle-1.3.7-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:f6f268caeabb37ccd824d749e7ce0ec6337c4ed954adba33ec0d90cc46b0ab78", size = 13282, upload-time = "2025-09-05T12:51:19.703Z" }, + { url = "https://files.pythonhosted.org/packages/c3/5b/5e1c117ac84e3cefcf8d7a7f6b2461795a87e20869da065a5c087149060b/setproctitle-1.3.7-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:b1cac6a4b0252b8811d60b6d8d0f157c0fdfed379ac89c25a914e6346cf355a1", size = 12587, upload-time = "2025-09-05T12:51:21.195Z" }, + { url = "https://files.pythonhosted.org/packages/73/02/b9eadc226195dcfa90eed37afe56b5dd6fa2f0e5220ab8b7867b8862b926/setproctitle-1.3.7-pp311-pypy311_pp73-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:f1704c9e041f2b1dc38f5be4552e141e1432fba3dd52c72eeffd5bc2db04dc65", size = 14286, upload-time = "2025-09-05T12:51:22.61Z" }, + { url = "https://files.pythonhosted.org/packages/28/26/1be1d2a53c2a91ec48fa2ff4a409b395f836798adf194d99de9c059419ea/setproctitle-1.3.7-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:b08b61976ffa548bd5349ce54404bf6b2d51bd74d4f1b241ed1b0f25bce09c3a", size = 13282, upload-time = "2025-09-05T12:51:24.094Z" }, +] + +[[package]] +name = "tomli" +version = "2.4.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/82/30/31573e9457673ab10aa432461bee537ce6cef177667deca369efb79df071/tomli-2.4.0.tar.gz", hash = "sha256:aa89c3f6c277dd275d8e243ad24f3b5e701491a860d5121f2cdd399fbb31fc9c", size = 17477, upload-time = "2026-01-11T11:22:38.165Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3c/d9/3dc2289e1f3b32eb19b9785b6a006b28ee99acb37d1d47f78d4c10e28bf8/tomli-2.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b5ef256a3fd497d4973c11bf142e9ed78b150d36f5773f1ca6088c230ffc5867", size = 153663, upload-time = "2026-01-11T11:21:45.27Z" }, + { url = "https://files.pythonhosted.org/packages/51/32/ef9f6845e6b9ca392cd3f64f9ec185cc6f09f0a2df3db08cbe8809d1d435/tomli-2.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5572e41282d5268eb09a697c89a7bee84fae66511f87533a6f88bd2f7b652da9", size = 148469, upload-time = "2026-01-11T11:21:46.873Z" }, + { url = "https://files.pythonhosted.org/packages/d6/c2/506e44cce89a8b1b1e047d64bd495c22c9f71f21e05f380f1a950dd9c217/tomli-2.4.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:551e321c6ba03b55676970b47cb1b73f14a0a4dce6a3e1a9458fd6d921d72e95", size = 236039, upload-time = "2026-01-11T11:21:48.503Z" }, + { url = "https://files.pythonhosted.org/packages/b3/40/e1b65986dbc861b7e986e8ec394598187fa8aee85b1650b01dd925ca0be8/tomli-2.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e3f639a7a8f10069d0e15408c0b96a2a828cfdec6fca05296ebcdcc28ca7c76", size = 243007, upload-time = "2026-01-11T11:21:49.456Z" }, + { url = "https://files.pythonhosted.org/packages/9c/6f/6e39ce66b58a5b7ae572a0f4352ff40c71e8573633deda43f6a379d56b3e/tomli-2.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1b168f2731796b045128c45982d3a4874057626da0e2ef1fdd722848b741361d", size = 240875, upload-time = "2026-01-11T11:21:50.755Z" }, + { url = "https://files.pythonhosted.org/packages/aa/ad/cb089cb190487caa80204d503c7fd0f4d443f90b95cf4ef5cf5aa0f439b0/tomli-2.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:133e93646ec4300d651839d382d63edff11d8978be23da4cc106f5a18b7d0576", size = 246271, upload-time = "2026-01-11T11:21:51.81Z" }, + { url = "https://files.pythonhosted.org/packages/0b/63/69125220e47fd7a3a27fd0de0c6398c89432fec41bc739823bcc66506af6/tomli-2.4.0-cp311-cp311-win32.whl", hash = "sha256:b6c78bdf37764092d369722d9946cb65b8767bfa4110f902a1b2542d8d173c8a", size = 96770, upload-time = "2026-01-11T11:21:52.647Z" }, + { url = "https://files.pythonhosted.org/packages/1e/0d/a22bb6c83f83386b0008425a6cd1fa1c14b5f3dd4bad05e98cf3dbbf4a64/tomli-2.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:d3d1654e11d724760cdb37a3d7691f0be9db5fbdaef59c9f532aabf87006dbaa", size = 107626, upload-time = "2026-01-11T11:21:53.459Z" }, + { url = "https://files.pythonhosted.org/packages/2f/6d/77be674a3485e75cacbf2ddba2b146911477bd887dda9d8c9dfb2f15e871/tomli-2.4.0-cp311-cp311-win_arm64.whl", hash = "sha256:cae9c19ed12d4e8f3ebf46d1a75090e4c0dc16271c5bce1c833ac168f08fb614", size = 94842, upload-time = "2026-01-11T11:21:54.831Z" }, + { url = "https://files.pythonhosted.org/packages/3c/43/7389a1869f2f26dba52404e1ef13b4784b6b37dac93bac53457e3ff24ca3/tomli-2.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:920b1de295e72887bafa3ad9f7a792f811847d57ea6b1215154030cf131f16b1", size = 154894, upload-time = "2026-01-11T11:21:56.07Z" }, + { url = "https://files.pythonhosted.org/packages/e9/05/2f9bf110b5294132b2edf13fe6ca6ae456204f3d749f623307cbb7a946f2/tomli-2.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7d6d9a4aee98fac3eab4952ad1d73aee87359452d1c086b5ceb43ed02ddb16b8", size = 149053, upload-time = "2026-01-11T11:21:57.467Z" }, + { url = "https://files.pythonhosted.org/packages/e8/41/1eda3ca1abc6f6154a8db4d714a4d35c4ad90adc0bcf700657291593fbf3/tomli-2.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:36b9d05b51e65b254ea6c2585b59d2c4cb91c8a3d91d0ed0f17591a29aaea54a", size = 243481, upload-time = "2026-01-11T11:21:58.661Z" }, + { url = "https://files.pythonhosted.org/packages/d2/6d/02ff5ab6c8868b41e7d4b987ce2b5f6a51d3335a70aa144edd999e055a01/tomli-2.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1c8a885b370751837c029ef9bc014f27d80840e48bac415f3412e6593bbc18c1", size = 251720, upload-time = "2026-01-11T11:22:00.178Z" }, + { url = "https://files.pythonhosted.org/packages/7b/57/0405c59a909c45d5b6f146107c6d997825aa87568b042042f7a9c0afed34/tomli-2.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8768715ffc41f0008abe25d808c20c3d990f42b6e2e58305d5da280ae7d1fa3b", size = 247014, upload-time = "2026-01-11T11:22:01.238Z" }, + { url = "https://files.pythonhosted.org/packages/2c/0e/2e37568edd944b4165735687cbaf2fe3648129e440c26d02223672ee0630/tomli-2.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b438885858efd5be02a9a133caf5812b8776ee0c969fea02c45e8e3f296ba51", size = 251820, upload-time = "2026-01-11T11:22:02.727Z" }, + { url = "https://files.pythonhosted.org/packages/5a/1c/ee3b707fdac82aeeb92d1a113f803cf6d0f37bdca0849cb489553e1f417a/tomli-2.4.0-cp312-cp312-win32.whl", hash = "sha256:0408e3de5ec77cc7f81960c362543cbbd91ef883e3138e81b729fc3eea5b9729", size = 97712, upload-time = "2026-01-11T11:22:03.777Z" }, + { url = "https://files.pythonhosted.org/packages/69/13/c07a9177d0b3bab7913299b9278845fc6eaaca14a02667c6be0b0a2270c8/tomli-2.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:685306e2cc7da35be4ee914fd34ab801a6acacb061b6a7abca922aaf9ad368da", size = 108296, upload-time = "2026-01-11T11:22:04.86Z" }, + { url = "https://files.pythonhosted.org/packages/18/27/e267a60bbeeee343bcc279bb9e8fbed0cbe224bc7b2a3dc2975f22809a09/tomli-2.4.0-cp312-cp312-win_arm64.whl", hash = "sha256:5aa48d7c2356055feef06a43611fc401a07337d5b006be13a30f6c58f869e3c3", size = 94553, upload-time = "2026-01-11T11:22:05.854Z" }, + { url = "https://files.pythonhosted.org/packages/34/91/7f65f9809f2936e1f4ce6268ae1903074563603b2a2bd969ebbda802744f/tomli-2.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:84d081fbc252d1b6a982e1870660e7330fb8f90f676f6e78b052ad4e64714bf0", size = 154915, upload-time = "2026-01-11T11:22:06.703Z" }, + { url = "https://files.pythonhosted.org/packages/20/aa/64dd73a5a849c2e8f216b755599c511badde80e91e9bc2271baa7b2cdbb1/tomli-2.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9a08144fa4cba33db5255f9b74f0b89888622109bd2776148f2597447f92a94e", size = 149038, upload-time = "2026-01-11T11:22:07.56Z" }, + { url = "https://files.pythonhosted.org/packages/9e/8a/6d38870bd3d52c8d1505ce054469a73f73a0fe62c0eaf5dddf61447e32fa/tomli-2.4.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c73add4bb52a206fd0c0723432db123c0c75c280cbd67174dd9d2db228ebb1b4", size = 242245, upload-time = "2026-01-11T11:22:08.344Z" }, + { url = "https://files.pythonhosted.org/packages/59/bb/8002fadefb64ab2669e5b977df3f5e444febea60e717e755b38bb7c41029/tomli-2.4.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1fb2945cbe303b1419e2706e711b7113da57b7db31ee378d08712d678a34e51e", size = 250335, upload-time = "2026-01-11T11:22:09.951Z" }, + { url = "https://files.pythonhosted.org/packages/a5/3d/4cdb6f791682b2ea916af2de96121b3cb1284d7c203d97d92d6003e91c8d/tomli-2.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:bbb1b10aa643d973366dc2cb1ad94f99c1726a02343d43cbc011edbfac579e7c", size = 245962, upload-time = "2026-01-11T11:22:11.27Z" }, + { url = "https://files.pythonhosted.org/packages/f2/4a/5f25789f9a460bd858ba9756ff52d0830d825b458e13f754952dd15fb7bb/tomli-2.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4cbcb367d44a1f0c2be408758b43e1ffb5308abe0ea222897d6bfc8e8281ef2f", size = 250396, upload-time = "2026-01-11T11:22:12.325Z" }, + { url = "https://files.pythonhosted.org/packages/aa/2f/b73a36fea58dfa08e8b3a268750e6853a6aac2a349241a905ebd86f3047a/tomli-2.4.0-cp313-cp313-win32.whl", hash = "sha256:7d49c66a7d5e56ac959cb6fc583aff0651094ec071ba9ad43df785abc2320d86", size = 97530, upload-time = "2026-01-11T11:22:13.865Z" }, + { url = "https://files.pythonhosted.org/packages/3b/af/ca18c134b5d75de7e8dc551c5234eaba2e8e951f6b30139599b53de9c187/tomli-2.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:3cf226acb51d8f1c394c1b310e0e0e61fecdd7adcb78d01e294ac297dd2e7f87", size = 108227, upload-time = "2026-01-11T11:22:15.224Z" }, + { url = "https://files.pythonhosted.org/packages/22/c3/b386b832f209fee8073c8138ec50f27b4460db2fdae9ffe022df89a57f9b/tomli-2.4.0-cp313-cp313-win_arm64.whl", hash = "sha256:d20b797a5c1ad80c516e41bc1fb0443ddb5006e9aaa7bda2d71978346aeb9132", size = 94748, upload-time = "2026-01-11T11:22:16.009Z" }, + { url = "https://files.pythonhosted.org/packages/f3/c4/84047a97eb1004418bc10bdbcfebda209fca6338002eba2dc27cc6d13563/tomli-2.4.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:26ab906a1eb794cd4e103691daa23d95c6919cc2fa9160000ac02370cc9dd3f6", size = 154725, upload-time = "2026-01-11T11:22:17.269Z" }, + { url = "https://files.pythonhosted.org/packages/a8/5d/d39038e646060b9d76274078cddf146ced86dc2b9e8bbf737ad5983609a0/tomli-2.4.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:20cedb4ee43278bc4f2fee6cb50daec836959aadaf948db5172e776dd3d993fc", size = 148901, upload-time = "2026-01-11T11:22:18.287Z" }, + { url = "https://files.pythonhosted.org/packages/73/e5/383be1724cb30f4ce44983d249645684a48c435e1cd4f8b5cded8a816d3c/tomli-2.4.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:39b0b5d1b6dd03684b3fb276407ebed7090bbec989fa55838c98560c01113b66", size = 243375, upload-time = "2026-01-11T11:22:19.154Z" }, + { url = "https://files.pythonhosted.org/packages/31/f0/bea80c17971c8d16d3cc109dc3585b0f2ce1036b5f4a8a183789023574f2/tomli-2.4.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a26d7ff68dfdb9f87a016ecfd1e1c2bacbe3108f4e0f8bcd2228ef9a766c787d", size = 250639, upload-time = "2026-01-11T11:22:20.168Z" }, + { url = "https://files.pythonhosted.org/packages/2c/8f/2853c36abbb7608e3f945d8a74e32ed3a74ee3a1f468f1ffc7d1cb3abba6/tomli-2.4.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:20ffd184fb1df76a66e34bd1b36b4a4641bd2b82954befa32fe8163e79f1a702", size = 246897, upload-time = "2026-01-11T11:22:21.544Z" }, + { url = "https://files.pythonhosted.org/packages/49/f0/6c05e3196ed5337b9fe7ea003e95fd3819a840b7a0f2bf5a408ef1dad8ed/tomli-2.4.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:75c2f8bbddf170e8effc98f5e9084a8751f8174ea6ccf4fca5398436e0320bc8", size = 254697, upload-time = "2026-01-11T11:22:23.058Z" }, + { url = "https://files.pythonhosted.org/packages/f3/f5/2922ef29c9f2951883525def7429967fc4d8208494e5ab524234f06b688b/tomli-2.4.0-cp314-cp314-win32.whl", hash = "sha256:31d556d079d72db7c584c0627ff3a24c5d3fb4f730221d3444f3efb1b2514776", size = 98567, upload-time = "2026-01-11T11:22:24.033Z" }, + { url = "https://files.pythonhosted.org/packages/7b/31/22b52e2e06dd2a5fdbc3ee73226d763b184ff21fc24e20316a44ccc4d96b/tomli-2.4.0-cp314-cp314-win_amd64.whl", hash = "sha256:43e685b9b2341681907759cf3a04e14d7104b3580f808cfde1dfdb60ada85475", size = 108556, upload-time = "2026-01-11T11:22:25.378Z" }, + { url = "https://files.pythonhosted.org/packages/48/3d/5058dff3255a3d01b705413f64f4306a141a8fd7a251e5a495e3f192a998/tomli-2.4.0-cp314-cp314-win_arm64.whl", hash = "sha256:3d895d56bd3f82ddd6faaff993c275efc2ff38e52322ea264122d72729dca2b2", size = 96014, upload-time = "2026-01-11T11:22:26.138Z" }, + { url = "https://files.pythonhosted.org/packages/b8/4e/75dab8586e268424202d3a1997ef6014919c941b50642a1682df43204c22/tomli-2.4.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:5b5807f3999fb66776dbce568cc9a828544244a8eb84b84b9bafc080c99597b9", size = 163339, upload-time = "2026-01-11T11:22:27.143Z" }, + { url = "https://files.pythonhosted.org/packages/06/e3/b904d9ab1016829a776d97f163f183a48be6a4deb87304d1e0116a349519/tomli-2.4.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c084ad935abe686bd9c898e62a02a19abfc9760b5a79bc29644463eaf2840cb0", size = 159490, upload-time = "2026-01-11T11:22:28.399Z" }, + { url = "https://files.pythonhosted.org/packages/e3/5a/fc3622c8b1ad823e8ea98a35e3c632ee316d48f66f80f9708ceb4f2a0322/tomli-2.4.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0f2e3955efea4d1cfbcb87bc321e00dc08d2bcb737fd1d5e398af111d86db5df", size = 269398, upload-time = "2026-01-11T11:22:29.345Z" }, + { url = "https://files.pythonhosted.org/packages/fd/33/62bd6152c8bdd4c305ad9faca48f51d3acb2df1f8791b1477d46ff86e7f8/tomli-2.4.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0e0fe8a0b8312acf3a88077a0802565cb09ee34107813bba1c7cd591fa6cfc8d", size = 276515, upload-time = "2026-01-11T11:22:30.327Z" }, + { url = "https://files.pythonhosted.org/packages/4b/ff/ae53619499f5235ee4211e62a8d7982ba9e439a0fb4f2f351a93d67c1dd2/tomli-2.4.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:413540dce94673591859c4c6f794dfeaa845e98bf35d72ed59636f869ef9f86f", size = 273806, upload-time = "2026-01-11T11:22:32.56Z" }, + { url = "https://files.pythonhosted.org/packages/47/71/cbca7787fa68d4d0a9f7072821980b39fbb1b6faeb5f5cf02f4a5559fa28/tomli-2.4.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:0dc56fef0e2c1c470aeac5b6ca8cc7b640bb93e92d9803ddaf9ea03e198f5b0b", size = 281340, upload-time = "2026-01-11T11:22:33.505Z" }, + { url = "https://files.pythonhosted.org/packages/f5/00/d595c120963ad42474cf6ee7771ad0d0e8a49d0f01e29576ee9195d9ecdf/tomli-2.4.0-cp314-cp314t-win32.whl", hash = "sha256:d878f2a6707cc9d53a1be1414bbb419e629c3d6e67f69230217bb663e76b5087", size = 108106, upload-time = "2026-01-11T11:22:34.451Z" }, + { url = "https://files.pythonhosted.org/packages/de/69/9aa0c6a505c2f80e519b43764f8b4ba93b5a0bbd2d9a9de6e2b24271b9a5/tomli-2.4.0-cp314-cp314t-win_amd64.whl", hash = "sha256:2add28aacc7425117ff6364fe9e06a183bb0251b03f986df0e78e974047571fd", size = 120504, upload-time = "2026-01-11T11:22:35.764Z" }, + { url = "https://files.pythonhosted.org/packages/b3/9f/f1668c281c58cfae01482f7114a4b88d345e4c140386241a1a24dcc9e7bc/tomli-2.4.0-cp314-cp314t-win_arm64.whl", hash = "sha256:2b1e3b80e1d5e52e40e9b924ec43d81570f0e7d09d11081b797bc4692765a3d4", size = 99561, upload-time = "2026-01-11T11:22:36.624Z" }, + { url = "https://files.pythonhosted.org/packages/23/d1/136eb2cb77520a31e1f64cbae9d33ec6df0d78bdf4160398e86eec8a8754/tomli-2.4.0-py3-none-any.whl", hash = "sha256:1f776e7d669ebceb01dee46484485f43a4048746235e683bcdffacdf1fb4785a", size = 14477, upload-time = "2026-01-11T11:22:37.446Z" }, +] + +[[package]] +name = "tornado" +version = "6.5.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/37/1d/0a336abf618272d53f62ebe274f712e213f5a03c0b2339575430b8362ef2/tornado-6.5.4.tar.gz", hash = "sha256:a22fa9047405d03260b483980635f0b041989d8bcc9a313f8fe18b411d84b1d7", size = 513632, upload-time = "2025-12-15T19:21:03.836Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ab/a9/e94a9d5224107d7ce3cc1fab8d5dc97f5ea351ccc6322ee4fb661da94e35/tornado-6.5.4-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:d6241c1a16b1c9e4cc28148b1cda97dd1c6cb4fb7068ac1bedc610768dff0ba9", size = 443909, upload-time = "2025-12-15T19:20:48.382Z" }, + { url = "https://files.pythonhosted.org/packages/db/7e/f7b8d8c4453f305a51f80dbb49014257bb7d28ccb4bbb8dd328ea995ecad/tornado-6.5.4-cp39-abi3-macosx_10_9_x86_64.whl", hash = "sha256:2d50f63dda1d2cac3ae1fa23d254e16b5e38153758470e9956cbc3d813d40843", size = 442163, upload-time = "2025-12-15T19:20:49.791Z" }, + { url = "https://files.pythonhosted.org/packages/ba/b5/206f82d51e1bfa940ba366a8d2f83904b15942c45a78dd978b599870ab44/tornado-6.5.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d1cf66105dc6acb5af613c054955b8137e34a03698aa53272dbda4afe252be17", size = 445746, upload-time = "2025-12-15T19:20:51.491Z" }, + { url = "https://files.pythonhosted.org/packages/8e/9d/1a3338e0bd30ada6ad4356c13a0a6c35fbc859063fa7eddb309183364ac1/tornado-6.5.4-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:50ff0a58b0dc97939d29da29cd624da010e7f804746621c78d14b80238669335", size = 445083, upload-time = "2025-12-15T19:20:52.778Z" }, + { url = "https://files.pythonhosted.org/packages/50/d4/e51d52047e7eb9a582da59f32125d17c0482d065afd5d3bc435ff2120dc5/tornado-6.5.4-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e5fb5e04efa54cf0baabdd10061eb4148e0be137166146fff835745f59ab9f7f", size = 445315, upload-time = "2025-12-15T19:20:53.996Z" }, + { url = "https://files.pythonhosted.org/packages/27/07/2273972f69ca63dbc139694a3fc4684edec3ea3f9efabf77ed32483b875c/tornado-6.5.4-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:9c86b1643b33a4cd415f8d0fe53045f913bf07b4a3ef646b735a6a86047dda84", size = 446003, upload-time = "2025-12-15T19:20:56.101Z" }, + { url = "https://files.pythonhosted.org/packages/d1/83/41c52e47502bf7260044413b6770d1a48dda2f0246f95ee1384a3cd9c44a/tornado-6.5.4-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:6eb82872335a53dd063a4f10917b3efd28270b56a33db69009606a0312660a6f", size = 445412, upload-time = "2025-12-15T19:20:57.398Z" }, + { url = "https://files.pythonhosted.org/packages/10/c7/bc96917f06cbee182d44735d4ecde9c432e25b84f4c2086143013e7b9e52/tornado-6.5.4-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:6076d5dda368c9328ff41ab5d9dd3608e695e8225d1cd0fd1e006f05da3635a8", size = 445392, upload-time = "2025-12-15T19:20:58.692Z" }, + { url = "https://files.pythonhosted.org/packages/0c/1a/d7592328d037d36f2d2462f4bc1fbb383eec9278bc786c1b111cbbd44cfa/tornado-6.5.4-cp39-abi3-win32.whl", hash = "sha256:1768110f2411d5cd281bac0a090f707223ce77fd110424361092859e089b38d1", size = 446481, upload-time = "2025-12-15T19:21:00.008Z" }, + { url = "https://files.pythonhosted.org/packages/d6/6d/c69be695a0a64fd37a97db12355a035a6d90f79067a3cf936ec2b1dc38cd/tornado-6.5.4-cp39-abi3-win_amd64.whl", hash = "sha256:fa07d31e0cd85c60713f2b995da613588aa03e1303d75705dca6af8babc18ddc", size = 446886, upload-time = "2025-12-15T19:21:01.287Z" }, + { url = "https://files.pythonhosted.org/packages/50/49/8dc3fd90902f70084bd2cd059d576ddb4f8bb44c2c7c0e33a11422acb17e/tornado-6.5.4-cp39-abi3-win_arm64.whl", hash = "sha256:053e6e16701eb6cbe641f308f4c1a9541f91b6261991160391bfc342e8a551a1", size = 445910, upload-time = "2025-12-15T19:21:02.571Z" }, +] + +[[package]] +name = "typing-extensions" +version = "4.15.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, +] + +[[package]] +name = "zope-event" +version = "6.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/46/33/d3eeac228fc14de76615612ee208be2d8a5b5b0fada36bf9b62d6b40600c/zope_event-6.1.tar.gz", hash = "sha256:6052a3e0cb8565d3d4ef1a3a7809336ac519bc4fe38398cb8d466db09adef4f0", size = 18739, upload-time = "2025-11-07T08:05:49.934Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c2/b0/956902e5e1302f8c5d124e219c6bf214e2649f92ad5fce85b05c039a04c9/zope_event-6.1-py3-none-any.whl", hash = "sha256:0ca78b6391b694272b23ec1335c0294cc471065ed10f7f606858fc54566c25a0", size = 6414, upload-time = "2025-11-07T08:05:48.874Z" }, +] + +[[package]] +name = "zope-interface" +version = "8.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/86/a4/77daa5ba398996d16bb43fc721599d27d03eae68fe3c799de1963c72e228/zope_interface-8.2.tar.gz", hash = "sha256:afb20c371a601d261b4f6edb53c3c418c249db1a9717b0baafc9a9bb39ba1224", size = 254019, upload-time = "2026-01-09T07:51:07.253Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b1/fa/6d9eb3a33998a3019d7eb4fa1802d01d6602fad90e0aea443e6e0fe8e49a/zope_interface-8.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:788c293f3165964ec6527b2d861072c68eef53425213f36d3893ebee89a89623", size = 207541, upload-time = "2026-01-09T08:04:55.378Z" }, + { url = "https://files.pythonhosted.org/packages/19/8c/ad23c96fdee84cb1f768f6695dac187cc26e9038e01c69713ba0f7dc46ab/zope_interface-8.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9a4e785097e741a1c953b3970ce28f2823bd63c00adc5d276f2981dd66c96c15", size = 208075, upload-time = "2026-01-09T08:04:57.118Z" }, + { url = "https://files.pythonhosted.org/packages/dd/35/1bfd5fec31a307f0cf4065ee74ade63858ded3e2a71e248f1508118fcc95/zope_interface-8.2-cp310-cp310-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:16c69da19a06566664ddd4785f37cad5693a51d48df1515d264c20d005d322e2", size = 249528, upload-time = "2026-01-09T08:04:59.074Z" }, + { url = "https://files.pythonhosted.org/packages/c6/3a/5d50b5fdb0f8226a2edff6adb7efdd3762ec95dff827dbab1761cb9a9e85/zope_interface-8.2-cp310-cp310-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:c31acfa3d7cde48bec45701b0e1f4698daffc378f559bfb296837d8c834732f6", size = 254646, upload-time = "2026-01-09T08:05:00.964Z" }, + { url = "https://files.pythonhosted.org/packages/2f/2a/ee7d675e151578eaf77828b8faac2b7ed9a69fead350bf5cf0e4afe7c73d/zope_interface-8.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:0723507127f8269b8f3f22663168f717e9c9742107d1b6c9f419df561b71aa6d", size = 255083, upload-time = "2026-01-09T08:05:02.857Z" }, + { url = "https://files.pythonhosted.org/packages/5d/07/99e2342f976c3700e142eddc01524e375a9e9078869a6885d9c72f3a3659/zope_interface-8.2-cp310-cp310-win_amd64.whl", hash = "sha256:3bf73a910bb27344def2d301a03329c559a79b308e1e584686b74171d736be4e", size = 211924, upload-time = "2026-01-09T08:05:04.702Z" }, + { url = "https://files.pythonhosted.org/packages/98/97/9c2aa8caae79915ed64eb114e18816f178984c917aa9adf2a18345e4f2e5/zope_interface-8.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c65ade7ea85516e428651048489f5e689e695c79188761de8c622594d1e13322", size = 208081, upload-time = "2026-01-09T08:05:06.623Z" }, + { url = "https://files.pythonhosted.org/packages/34/86/4e2fcb01a8f6780ac84923748e450af0805531f47c0956b83065c99ab543/zope_interface-8.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a1ef4b43659e1348f35f38e7d1a6bbc1682efde239761f335ffc7e31e798b65b", size = 208522, upload-time = "2026-01-09T08:05:07.986Z" }, + { url = "https://files.pythonhosted.org/packages/f6/eb/08e277da32ddcd4014922854096cf6dcb7081fad415892c2da1bedefbf02/zope_interface-8.2-cp311-cp311-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:dfc4f44e8de2ff4eba20af4f0a3ca42d3c43ab24a08e49ccd8558b7a4185b466", size = 255198, upload-time = "2026-01-09T08:05:09.532Z" }, + { url = "https://files.pythonhosted.org/packages/ea/a1/b32484f3281a5dc83bc713ad61eca52c543735cdf204543172087a074a74/zope_interface-8.2-cp311-cp311-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:8f094bfb49179ec5dc9981cb769af1275702bd64720ef94874d9e34da1390d4c", size = 259970, upload-time = "2026-01-09T08:05:11.477Z" }, + { url = "https://files.pythonhosted.org/packages/f6/81/bca0e8ae1e487d4093a8a7cfed2118aa2d4758c8cfd66e59d2af09d71f1c/zope_interface-8.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:d2bb8e7364e18f083bf6744ccf30433b2a5f236c39c95df8514e3c13007098ce", size = 261153, upload-time = "2026-01-09T08:05:13.402Z" }, + { url = "https://files.pythonhosted.org/packages/40/1e/e3ff2a708011e56b10b271b038d4cb650a8ad5b7d24352fe2edf6d6b187a/zope_interface-8.2-cp311-cp311-win_amd64.whl", hash = "sha256:6f4b4dfcfdfaa9177a600bb31cebf711fdb8c8e9ed84f14c61c420c6aa398489", size = 212330, upload-time = "2026-01-09T08:05:15.267Z" }, + { url = "https://files.pythonhosted.org/packages/e0/a0/1e1fabbd2e9c53ef92b69df6d14f4adc94ec25583b1380336905dc37e9a0/zope_interface-8.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:624b6787fc7c3e45fa401984f6add2c736b70a7506518c3b537ffaacc4b29d4c", size = 208785, upload-time = "2026-01-09T08:05:17.348Z" }, + { url = "https://files.pythonhosted.org/packages/c3/2a/88d098a06975c722a192ef1fb7d623d1b57c6a6997cf01a7aabb45ab1970/zope_interface-8.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bc9ded9e97a0ed17731d479596ed1071e53b18e6fdb2fc33af1e43f5fd2d3aaa", size = 208976, upload-time = "2026-01-09T08:05:18.792Z" }, + { url = "https://files.pythonhosted.org/packages/e9/e8/757398549fdfd2f8c89f32c82ae4d2f0537ae2a5d2f21f4a2f711f5a059f/zope_interface-8.2-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:532367553e4420c80c0fc0cabcc2c74080d495573706f66723edee6eae53361d", size = 259411, upload-time = "2026-01-09T08:05:20.567Z" }, + { url = "https://files.pythonhosted.org/packages/91/af/502601f0395ce84dff622f63cab47488657a04d0065547df42bee3a680ff/zope_interface-8.2-cp312-cp312-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:2bf9cf275468bafa3c72688aad8cfcbe3d28ee792baf0b228a1b2d93bd1d541a", size = 264859, upload-time = "2026-01-09T08:05:22.234Z" }, + { url = "https://files.pythonhosted.org/packages/89/0c/d2f765b9b4814a368a7c1b0ac23b68823c6789a732112668072fe596945d/zope_interface-8.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:0009d2d3c02ea783045d7804da4fd016245e5c5de31a86cebba66dd6914d59a2", size = 264398, upload-time = "2026-01-09T08:05:23.853Z" }, + { url = "https://files.pythonhosted.org/packages/4a/81/2f171fbc4222066957e6b9220c4fb9146792540102c37e6d94e5d14aad97/zope_interface-8.2-cp312-cp312-win_amd64.whl", hash = "sha256:845d14e580220ae4544bd4d7eb800f0b6034fe5585fc2536806e0a26c2ee6640", size = 212444, upload-time = "2026-01-09T08:05:25.148Z" }, + { url = "https://files.pythonhosted.org/packages/66/47/45188fb101fa060b20e6090e500682398ab415e516a0c228fbb22bc7def2/zope_interface-8.2-cp313-cp313-macosx_10_9_x86_64.whl", hash = "sha256:6068322004a0158c80dfd4708dfb103a899635408c67c3b10e9acec4dbacefec", size = 209170, upload-time = "2026-01-09T08:05:26.616Z" }, + { url = "https://files.pythonhosted.org/packages/09/03/f6b9336c03c2b48403c4eb73a1ec961d94dc2fb5354c583dfb5fa05fd41f/zope_interface-8.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2499de92e8275d0dd68f84425b3e19e9268cd1fa8507997900fa4175f157733c", size = 209229, upload-time = "2026-01-09T08:05:28.521Z" }, + { url = "https://files.pythonhosted.org/packages/07/b1/65fe1dca708569f302ade02e6cdca309eab6752bc9f80105514f5b708651/zope_interface-8.2-cp313-cp313-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:f777e68c76208503609c83ca021a6864902b646530a1a39abb9ed310d1100664", size = 259393, upload-time = "2026-01-09T08:05:29.897Z" }, + { url = "https://files.pythonhosted.org/packages/eb/a5/97b49cfceb6ed53d3dcfb3f3ebf24d83b5553194f0337fbbb3a9fec6cf78/zope_interface-8.2-cp313-cp313-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:9b05a919fdb0ed6ea942e5a7800e09a8b6cdae6f98fee1bef1c9d1a3fc43aaa0", size = 264863, upload-time = "2026-01-09T08:05:31.501Z" }, + { url = "https://files.pythonhosted.org/packages/cb/02/0b7a77292810efe3a0586a505b077ebafd5114e10c6e6e659f0c8e387e1f/zope_interface-8.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:ccc62b5712dd7bd64cfba3ee63089fb11e840f5914b990033beeae3b2180b6cb", size = 264369, upload-time = "2026-01-09T08:05:32.941Z" }, + { url = "https://files.pythonhosted.org/packages/fb/1d/0d1ff3846302ed1b5bbf659316d8084b30106770a5f346b7ff4e9f540f80/zope_interface-8.2-cp313-cp313-win_amd64.whl", hash = "sha256:34f877d1d3bb7565c494ed93828fa6417641ca26faf6e8f044e0d0d500807028", size = 212447, upload-time = "2026-01-09T08:05:35.064Z" }, + { url = "https://files.pythonhosted.org/packages/1a/da/3c89de3917751446728b8898b4d53318bc2f8f6bf8196e150a063c59905e/zope_interface-8.2-cp314-cp314-macosx_10_9_x86_64.whl", hash = "sha256:46c7e4e8cbc698398a67e56ca985d19cb92365b4aafbeb6a712e8c101090f4cb", size = 209223, upload-time = "2026-01-09T08:05:36.449Z" }, + { url = "https://files.pythonhosted.org/packages/00/7f/62d00ec53f0a6e5df0c984781e6f3999ed265129c4c3413df8128d1e0207/zope_interface-8.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:a87fc7517f825a97ff4a4ca4c8a950593c59e0f8e7bfe1b6f898a38d5ba9f9cf", size = 209366, upload-time = "2026-01-09T08:05:38.197Z" }, + { url = "https://files.pythonhosted.org/packages/ef/a2/f241986315174be8e00aabecfc2153cf8029c1327cab8ed53a9d979d7e08/zope_interface-8.2-cp314-cp314-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:ccf52f7d44d669203c2096c1a0c2c15d52e36b2e7a9413df50f48392c7d4d080", size = 261037, upload-time = "2026-01-09T08:05:39.568Z" }, + { url = "https://files.pythonhosted.org/packages/02/cc/b321c51d6936ede296a1b8860cf173bee2928357fe1fff7f97234899173f/zope_interface-8.2-cp314-cp314-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:aae807efc7bd26302eb2fea05cd6de7d59269ed6ae23a6de1ee47add6de99b8c", size = 264219, upload-time = "2026-01-09T08:05:41.624Z" }, + { url = "https://files.pythonhosted.org/packages/ab/fb/5f5e7b40a2f4efd873fe173624795ca47eaa22e29051270c981361b45209/zope_interface-8.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:05a0e42d6d830f547e114de2e7cd15750dc6c0c78f8138e6c5035e51ddfff37c", size = 264390, upload-time = "2026-01-09T08:05:42.936Z" }, + { url = "https://files.pythonhosted.org/packages/f9/82/3f2bc594370bc3abd58e5f9085d263bf682a222f059ed46275cde0570810/zope_interface-8.2-cp314-cp314-win_amd64.whl", hash = "sha256:561ce42390bee90bae51cf1c012902a8033b2aaefbd0deed81e877562a116d48", size = 212585, upload-time = "2026-01-09T08:05:44.419Z" }, +] From 0a697cde7f3a950a4e8c048f16c0165419b9deff Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 22:11:55 +0100 Subject: [PATCH 037/356] docs: Add ASGI worker and uWSGI protocol documentation --- docs/content/asgi.md | 241 ++++++++++++++++++++++++++++++++++++++ docs/content/uwsgi.md | 266 ++++++++++++++++++++++++++++++++++++++++++ mkdocs.yml | 2 + 3 files changed, 509 insertions(+) create mode 100644 docs/content/asgi.md create mode 100644 docs/content/uwsgi.md diff --git a/docs/content/asgi.md b/docs/content/asgi.md new file mode 100644 index 000000000..8cc51b4b0 --- /dev/null +++ b/docs/content/asgi.md @@ -0,0 +1,241 @@ +# ASGI Worker + +!!! warning "Beta Feature" + The ASGI worker is a beta feature introduced in Gunicorn 24.0.0. While it has been tested, + the API and behavior may change in future releases. Please report any issues on + [GitHub](https://github.com/benoitc/gunicorn/issues). + +Gunicorn includes a native ASGI worker that enables running async Python web frameworks +like FastAPI, Starlette, and Quart without external dependencies like Uvicorn. + +## Quick Start + +```bash +# Install gunicorn +pip install gunicorn + +# Run an ASGI application +gunicorn myapp:app --worker-class asgi --workers 4 +``` + +For FastAPI applications: + +```bash +gunicorn main:app --worker-class asgi --bind 0.0.0.0:8000 +``` + +## Features + +The ASGI worker provides: + +- **HTTP/1.1** with keepalive connections +- **WebSocket** support for real-time applications +- **Lifespan protocol** for startup/shutdown hooks +- **Optional uvloop** for improved performance +- **SSL/TLS** support + +## Configuration + +### Worker Class + +Set the worker class to `asgi`: + +```bash +gunicorn myapp:app --worker-class asgi +``` + +Or in a configuration file: + +```python +# gunicorn.conf.py +worker_class = "asgi" +``` + +### Event Loop + +Control which asyncio event loop implementation to use: + +| Value | Description | +|----------|-------------| +| `auto` | Use uvloop if available, otherwise asyncio (default) | +| `asyncio`| Use Python's built-in asyncio event loop | +| `uvloop` | Use uvloop (must be installed separately) | + +```bash +gunicorn myapp:app --worker-class asgi --asgi-loop uvloop +``` + +To use uvloop, install it first: + +```bash +pip install uvloop +``` + +### Lifespan Protocol + +The lifespan protocol lets your application run code at startup and shutdown. +This is essential for frameworks that need to initialize database connections, +caches, or background tasks. + +| Value | Description | +|--------|-------------| +| `auto` | Detect if app supports lifespan, enable if so (default) | +| `on` | Always run lifespan protocol (fail if unsupported) | +| `off` | Never run lifespan protocol | + +```bash +gunicorn myapp:app --worker-class asgi --asgi-lifespan on +``` + +Example FastAPI application using lifespan: + +```python +from contextlib import asynccontextmanager +from fastapi import FastAPI + +@asynccontextmanager +async def lifespan(app: FastAPI): + # Startup: initialize resources + print("Starting up...") + yield + # Shutdown: cleanup resources + print("Shutting down...") + +app = FastAPI(lifespan=lifespan) +``` + +### Root Path + +When running behind a reverse proxy that mounts your application at a subpath, +set `root_path` so your application knows its mount point: + +```bash +gunicorn myapp:app --worker-class asgi --root-path /api +``` + +This is equivalent to the `SCRIPT_NAME` in WSGI applications. + +### Worker Connections + +Control the maximum number of concurrent connections per worker: + +```bash +gunicorn myapp:app --worker-class asgi --worker-connections 1000 +``` + +!!! note + Unlike sync workers, the `--threads` option has no effect on ASGI workers. + Use `--worker-connections` to control concurrency. + +## WebSocket Support + +The ASGI worker supports WebSocket connections out of the box. No additional +configuration is required. + +Example with Starlette: + +```python +from starlette.applications import Starlette +from starlette.routing import WebSocketRoute + +async def websocket_endpoint(websocket): + await websocket.accept() + while True: + data = await websocket.receive_text() + await websocket.send_text(f"Echo: {data}") + +app = Starlette(routes=[ + WebSocketRoute("/ws", websocket_endpoint), +]) +``` + +## Production Deployment + +### With Nginx + +```nginx +upstream gunicorn { + server 127.0.0.1:8000; +} + +server { + listen 80; + server_name example.com; + + location / { + proxy_pass http://gunicorn; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + # WebSocket support + location /ws { + proxy_pass http://gunicorn; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + } +} +``` + +### Recommended Settings + +For production ASGI deployments: + +```python +# gunicorn.conf.py +worker_class = "asgi" +workers = 4 # Number of worker processes +worker_connections = 1000 # Max connections per worker +keepalive = 5 # Keepalive timeout +timeout = 120 # Worker timeout +graceful_timeout = 30 # Graceful shutdown timeout + +# Performance tuning +asgi_loop = "auto" # Use uvloop if available +asgi_lifespan = "auto" # Auto-detect lifespan support +``` + +## Comparison with Other ASGI Servers + +| Feature | Gunicorn ASGI | Uvicorn | Hypercorn | +|---------|---------------|---------|-----------| +| Process management | Built-in | External | Built-in | +| HTTP/2 | No | No | Yes | +| WebSocket | Yes | Yes | Yes | +| Lifespan | Yes | Yes | Yes | +| uvloop support | Yes | Yes | Yes | + +Gunicorn's ASGI worker provides the same process management, logging, and +configuration capabilities you're familiar with from WSGI deployments. + +## Troubleshooting + +### Lifespan startup failed + +If you see "ASGI lifespan startup failed", your application may not properly +implement the lifespan protocol. Either fix the application or set +`--asgi-lifespan off`. + +### Connection limits + +If you're hitting connection limits, increase `--worker-connections` or add +more workers with `--workers`. + +### Slow responses under load + +Try using uvloop for better performance: + +```bash +pip install uvloop +gunicorn myapp:app --worker-class asgi --asgi-loop uvloop +``` + +## See Also + +- [Settings Reference](reference/settings.md#asgi_loop) - All ASGI-related settings +- [Deploy](deploy.md) - General deployment guidance +- [Design](design.md) - Worker architecture overview diff --git a/docs/content/uwsgi.md b/docs/content/uwsgi.md new file mode 100644 index 000000000..af2b0c75b --- /dev/null +++ b/docs/content/uwsgi.md @@ -0,0 +1,266 @@ +# uWSGI Protocol + +Gunicorn supports the uWSGI binary protocol, allowing it to receive requests from +nginx using the `uwsgi_pass` directive. This provides efficient communication +between nginx and Gunicorn without HTTP overhead. + +!!! note + This is the **uWSGI binary protocol**, not the uWSGI server. Gunicorn + implements the protocol to receive requests from nginx, similar to how + the uWSGI server would. + +## Quick Start + +Enable uWSGI protocol support: + +```bash +gunicorn myapp:app --protocol uwsgi --bind 127.0.0.1:8000 +``` + +Configure nginx to forward requests: + +```nginx +upstream gunicorn { + server 127.0.0.1:8000; +} + +server { + listen 80; + server_name example.com; + + location / { + uwsgi_pass gunicorn; + include uwsgi_params; + } +} +``` + +## Why Use uWSGI Protocol? + +The uWSGI binary protocol offers several advantages over HTTP proxying: + +- **Lower overhead** - Binary format is more compact than HTTP headers +- **Better integration** - nginx's native uwsgi module is highly optimized +- **Simpler configuration** - No need to reconstruct HTTP headers + +## Configuration + +### Protocol Setting + +Switch from HTTP to uWSGI protocol: + +```bash +gunicorn myapp:app --protocol uwsgi +``` + +Or in a configuration file: + +```python +# gunicorn.conf.py +protocol = "uwsgi" +``` + +### Allowed IPs + +By default, uWSGI protocol requests are only accepted from localhost +(`127.0.0.1` and `::1`). This prevents unauthorized hosts from sending +requests directly to Gunicorn. + +To allow additional IPs: + +```bash +gunicorn myapp:app --protocol uwsgi --uwsgi-allow-from 10.0.0.1,10.0.0.2 +``` + +To allow all IPs (not recommended for production): + +```bash +gunicorn myapp:app --protocol uwsgi --uwsgi-allow-from '*' +``` + +!!! warning + Only allow IPs from trusted sources. The uWSGI protocol does not provide + authentication, so anyone who can connect can send requests. + +!!! note + UNIX socket connections are always allowed regardless of this setting. + +### Using UNIX Sockets + +For better performance and security, use UNIX sockets instead of TCP: + +```bash +gunicorn myapp:app --protocol uwsgi --bind unix:/run/gunicorn.sock +``` + +Nginx configuration: + +```nginx +upstream gunicorn { + server unix:/run/gunicorn.sock; +} + +server { + listen 80; + + location / { + uwsgi_pass gunicorn; + include uwsgi_params; + } +} +``` + +## Nginx Configuration + +### Basic Setup + +Create or verify the `uwsgi_params` file exists (usually at `/etc/nginx/uwsgi_params`): + +```nginx +uwsgi_param QUERY_STRING $query_string; +uwsgi_param REQUEST_METHOD $request_method; +uwsgi_param CONTENT_TYPE $content_type; +uwsgi_param CONTENT_LENGTH $content_length; + +uwsgi_param REQUEST_URI $request_uri; +uwsgi_param PATH_INFO $document_uri; +uwsgi_param DOCUMENT_ROOT $document_root; +uwsgi_param SERVER_PROTOCOL $server_protocol; +uwsgi_param REQUEST_SCHEME $scheme; +uwsgi_param HTTPS $https if_not_empty; + +uwsgi_param REMOTE_ADDR $remote_addr; +uwsgi_param REMOTE_PORT $remote_port; +uwsgi_param SERVER_PORT $server_port; +uwsgi_param SERVER_NAME $server_name; +``` + +### With SSL Termination + +When nginx handles SSL and forwards to Gunicorn: + +```nginx +server { + listen 443 ssl; + server_name example.com; + + ssl_certificate /path/to/cert.pem; + ssl_certificate_key /path/to/key.pem; + + location / { + uwsgi_pass gunicorn; + include uwsgi_params; + uwsgi_param HTTPS on; + } +} +``` + +### Load Balancing + +Distribute requests across multiple Gunicorn instances: + +```nginx +upstream gunicorn { + least_conn; + server 127.0.0.1:8000; + server 127.0.0.1:8001; + server 127.0.0.1:8002; +} + +server { + listen 80; + + location / { + uwsgi_pass gunicorn; + include uwsgi_params; + } +} +``` + +### Static Files + +Serve static files directly from nginx: + +```nginx +server { + listen 80; + + location /static/ { + alias /path/to/static/; + } + + location / { + uwsgi_pass gunicorn; + include uwsgi_params; + } +} +``` + +## Protocol Details + +The uWSGI protocol uses a compact binary format: + +| Bytes | Field | Description | +|-------|-------|-------------| +| 0 | modifier1 | Packet type (0 = WSGI request) | +| 1-2 | datasize | Size of vars block (little-endian) | +| 3 | modifier2 | Additional flags (usually 0) | + +After the header, the vars block contains CGI-style key-value pairs: + +``` +[2-byte key_size][key][2-byte val_size][value]... +``` + +Standard CGI variables like `REQUEST_METHOD`, `PATH_INFO`, and `QUERY_STRING` +are extracted from this block to construct the WSGI environ. + +## Combining with HTTP + +You can run Gunicorn with both HTTP and uWSGI protocol support by running +separate instances: + +```bash +# HTTP for direct access +gunicorn myapp:app --bind 127.0.0.1:8080 + +# uWSGI for nginx +gunicorn myapp:app --protocol uwsgi --bind 127.0.0.1:8000 +``` + +## Troubleshooting + +### ForbiddenUWSGIRequest Error + +If you see "Forbidden uWSGI request from IP", the connecting IP is not in +the allowed list. Either: + +1. Add the IP to `--uwsgi-allow-from` +2. Use UNIX sockets instead +3. Ensure nginx is connecting from an allowed IP + +### Invalid uWSGI Header + +This usually means: + +1. HTTP traffic is being sent to a uWSGI endpoint +2. The packet is malformed or truncated +3. Network issues caused data corruption + +Verify that nginx is using `uwsgi_pass` (not `proxy_pass`) and that the +`uwsgi_params` file is being included. + +### Headers Missing + +If certain headers aren't reaching your application, verify they're included +in `uwsgi_params`. Custom headers should be passed as: + +```nginx +uwsgi_param HTTP_X_CUSTOM_HEADER $http_x_custom_header; +``` + +## See Also + +- [Settings Reference](reference/settings.md#protocol) - Protocol and uWSGI settings +- [Deploy](deploy.md) - General deployment guidance +- [Design](design.md) - Worker architecture overview diff --git a/mkdocs.yml b/mkdocs.yml index d6945086c..6a5caf1a8 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -12,6 +12,8 @@ nav: - Run: run.md - Configure: configure.md - Deploy: deploy.md + - ASGI Worker: asgi.md + - uWSGI Protocol: uwsgi.md - Signals: signals.md - Instrumentation: instrumentation.md - Custom: custom.md From 819d2a2490a15d93c8b8940341399f44886cb58f Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 22:20:43 +0100 Subject: [PATCH 038/356] docs: Add quickstart guide and Docker deployment --- docs/content/guides/docker.md | 339 ++++++++++++++++++++++++++++++++++ docs/content/install.md | 206 ++++++++++++--------- docs/content/quickstart.md | 115 ++++++++++++ mkdocs.yml | 10 +- 4 files changed, 581 insertions(+), 89 deletions(-) create mode 100644 docs/content/guides/docker.md create mode 100644 docs/content/quickstart.md diff --git a/docs/content/guides/docker.md b/docs/content/guides/docker.md new file mode 100644 index 000000000..036b38b1a --- /dev/null +++ b/docs/content/guides/docker.md @@ -0,0 +1,339 @@ +# Docker Deployment + +Running Gunicorn in Docker containers is the most common deployment pattern +for modern Python applications. This guide covers best practices for +containerizing Gunicorn applications. + +## Basic Dockerfile + +```dockerfile +FROM python:3.12-slim + +WORKDIR /app + +# Install dependencies +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Copy application +COPY . . + +# Run gunicorn +CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:8000"] +``` + +Build and run: + +```bash +docker build -t myapp . +docker run -p 8000:8000 myapp +``` + +## Production Configuration + +### Environment Variables + +Use environment variables for configuration: + +```dockerfile +FROM python:3.12-slim + +WORKDIR /app + +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +# Configuration via environment +ENV GUNICORN_WORKERS=4 +ENV GUNICORN_BIND=0.0.0.0:8000 + +CMD gunicorn app:app \ + --workers ${GUNICORN_WORKERS} \ + --bind ${GUNICORN_BIND} +``` + +Or use `GUNICORN_CMD_ARGS`: + +```dockerfile +ENV GUNICORN_CMD_ARGS="--workers=4 --bind=0.0.0.0:8000" +CMD ["gunicorn", "app:app"] +``` + +### Worker Count + +In containers, determine workers based on available CPU: + +```python +# gunicorn.conf.py +import multiprocessing + +workers = multiprocessing.cpu_count() * 2 + 1 +bind = "0.0.0.0:8000" +``` + +Or let Kubernetes/Docker limit CPU and calculate accordingly: + +```bash +# At runtime +gunicorn app:app --workers $(( 2 * $(nproc) + 1 )) +``` + +### Non-Root User + +Run as a non-root user for security: + +```dockerfile +FROM python:3.12-slim + +# Create non-root user +RUN useradd --create-home appuser +WORKDIR /home/appuser/app + +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY --chown=appuser:appuser . . + +USER appuser + +CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:8000"] +``` + +### Health Checks + +Add a health check endpoint and Docker health check: + +```dockerfile +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ + CMD curl -f http://localhost:8000/health || exit 1 +``` + +## Multi-Stage Build + +Reduce image size with multi-stage builds: + +```dockerfile +# Build stage +FROM python:3.12 AS builder + +WORKDIR /app +COPY requirements.txt . +RUN pip wheel --no-cache-dir --wheel-dir /wheels -r requirements.txt + +# Runtime stage +FROM python:3.12-slim + +WORKDIR /app + +# Copy wheels and install +COPY --from=builder /wheels /wheels +RUN pip install --no-cache-dir /wheels/* && rm -rf /wheels + +COPY . . + +CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:8000", "--workers", "4"] +``` + +## Docker Compose + +Example `docker-compose.yml`: + +```yaml +services: + web: + build: . + ports: + - "8000:8000" + environment: + - DATABASE_URL=postgres://db:5432/myapp + depends_on: + - db + deploy: + resources: + limits: + cpus: '2' + memory: 512M + + db: + image: postgres:15 + environment: + - POSTGRES_DB=myapp + - POSTGRES_PASSWORD=secret + volumes: + - postgres_data:/var/lib/postgresql/data + + nginx: + image: nginx:alpine + ports: + - "80:80" + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf:ro + depends_on: + - web + +volumes: + postgres_data: +``` + +## Kubernetes Deployment + +Example Kubernetes deployment: + +```yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: myapp +spec: + replicas: 3 + selector: + matchLabels: + app: myapp + template: + metadata: + labels: + app: myapp + spec: + containers: + - name: myapp + image: myapp:latest + ports: + - containerPort: 8000 + env: + - name: GUNICORN_WORKERS + value: "4" + resources: + limits: + cpu: "1" + memory: "512Mi" + requests: + cpu: "500m" + memory: "256Mi" + livenessProbe: + httpGet: + path: /health + port: 8000 + initialDelaySeconds: 10 + periodSeconds: 10 + readinessProbe: + httpGet: + path: /health + port: 8000 + initialDelaySeconds: 5 + periodSeconds: 5 +--- +apiVersion: v1 +kind: Service +metadata: + name: myapp +spec: + selector: + app: myapp + ports: + - port: 80 + targetPort: 8000 +``` + +## Graceful Shutdown + +Gunicorn handles `SIGTERM` gracefully by default. Configure the timeout: + +```dockerfile +CMD ["gunicorn", "app:app", \ + "--bind", "0.0.0.0:8000", \ + "--graceful-timeout", "30", \ + "--timeout", "120"] +``` + +Match Docker's stop timeout: + +```yaml +# docker-compose.yml +services: + web: + stop_grace_period: 30s +``` + +## Logging + +Log to stdout/stderr for Docker log collection: + +```python +# gunicorn.conf.py +accesslog = "-" +errorlog = "-" +loglevel = "info" +``` + +Use JSON logging for log aggregation: + +```python +# gunicorn.conf.py +import json +import datetime + +class JsonFormatter: + def format(self, record): + return json.dumps({ + "timestamp": datetime.datetime.utcnow().isoformat(), + "level": record.levelname, + "message": record.getMessage(), + }) + +logconfig_dict = { + "version": 1, + "formatters": { + "json": {"()": JsonFormatter} + }, + "handlers": { + "console": { + "class": "logging.StreamHandler", + "formatter": "json", + "stream": "ext://sys.stdout" + } + }, + "root": { + "handlers": ["console"], + "level": "INFO" + } +} +``` + +## Troubleshooting + +### Worker Timeout + +If workers are killed with `[CRITICAL] WORKER TIMEOUT`, increase the timeout: + +```bash +gunicorn app:app --timeout 120 +``` + +Or investigate slow requests in your application. + +### Out of Memory + +If containers are OOM-killed: + +1. Reduce worker count +2. Use `--max-requests` to restart workers periodically +3. Increase container memory limits + +```bash +gunicorn app:app --workers 2 --max-requests 1000 --max-requests-jitter 100 +``` + +### Connection Reset + +If you see connection resets, ensure: + +1. Load balancer health checks match your `/health` endpoint +2. Graceful timeout is sufficient for in-flight requests +3. Keepalive settings match between Gunicorn and upstream proxy + +## See Also + +- [Deploy](../deploy.md) - General deployment patterns +- [Settings](../reference/settings.md) - All configuration options diff --git a/docs/content/install.md b/docs/content/install.md index df69e64fa..27c73fed5 100644 --- a/docs/content/install.md +++ b/docs/content/install.md @@ -3,140 +3,174 @@ !!! note Gunicorn requires **Python 3.12 or newer**. +## Quick Install +=== "pip" + + ```bash + pip install gunicorn + ``` + +=== "pipx" + + ```bash + pipx install gunicorn + ``` + +=== "Docker" + + ```bash + docker run -p 8000:8000 -v $(pwd):/app -w /app \ + python:3.12-slim sh -c "pip install gunicorn && gunicorn app:app" + ``` + + See the [Docker guide](guides/docker.md) for production configurations. + +=== "System Packages" + + **Debian/Ubuntu:** + ```bash + sudo apt-get update + sudo apt-get install gunicorn + ``` + + **Fedora:** + ```bash + sudo dnf install python3-gunicorn + ``` + + **Arch Linux:** + ```bash + sudo pacman -S gunicorn + ``` + + !!! warning + System packages may lag behind the latest release. For production, + prefer pip installation in a virtual environment. + +## Virtual Environment (Recommended) + +Always install Gunicorn inside a virtual environment to isolate dependencies: ```bash +# Create virtual environment +python -m venv venv + +# Activate it +source venv/bin/activate # Linux/macOS +# or: venv\Scripts\activate # Windows + +# Install gunicorn pip install gunicorn ``` -## From source +## From Source -Install Gunicorn from GitHub if you want the latest development version: +Install the latest development version from GitHub: ```bash pip install git+https://github.com/benoitc/gunicorn.git ``` -Stay current by upgrading in place: +Upgrade to the latest commit: ```bash pip install -U git+https://github.com/benoitc/gunicorn.git ``` -## Async workers +## Extra Packages -Install Eventlet or Gevent if your application benefits from cooperative I/O. -Both rely on `greenlet`, so make sure the Python headers are available (for -example, install the `python-dev` package on Ubuntu). +Gunicorn provides optional extras for additional worker types and features. +Install them with pip's bracket syntax: ```bash -pip install greenlet # Required for both -pip install eventlet # For eventlet workers -pip install gunicorn[eventlet] # Or, using extra -pip install gevent # For gevent workers -pip install gunicorn[gevent] # Or, using extra +pip install gunicorn[gevent,setproctitle] ``` -!!! note - Gevent also needs `libevent` 1.4.x or 2.0.4+. Install it from your package - manager or build it manually if the packaged version is too old. +### Worker Types +| Extra | Description | +|-------|-------------| +| `gunicorn[eventlet]` | Eventlet-based greenlet workers | +| `gunicorn[gevent]` | Gevent-based greenlet workers | +| `gunicorn[gthread]` | Threaded workers | +| `gunicorn[tornado]` | Tornado-based workers (not recommended) | +See the [design docs](design.md) for guidance on choosing worker types. -## Extra packages +### Utilities -Some Gunicorn options require additional dependencies. Install them via -extras to pull everything in with one command. +| Extra | Description | +|-------|-------------| +| `gunicorn[setproctitle]` | Set process name in `ps`/`top` output | -Most extras enable alternative worker types—see the -[design docs](design.md) for when each worker makes sense. +!!! tip + If running multiple Gunicorn instances, use `setproctitle` with the + [`proc_name`](reference/settings.md#proc_name) setting to distinguish them. -- `gunicorn[eventlet]` — Eventlet-based greenlet workers -- `gunicorn[gevent]` — Gevent-based greenlet workers -- `gunicorn[gthread]` — Threaded workers -- `gunicorn[tornado]` — Tornado-based workers (not recommended) +## Async Workers -If you run more than one Gunicorn instance, the -[`proc_name`](reference/settings.md#proc_name) setting helps distinguish them in tools such -as `ps` and `top`. +For applications using async I/O patterns, install the appropriate greenlet +library: -- `gunicorn[setproctitle]` — Enables setting the process name +=== "Gevent" -You can combine multiple extras, for example: + ```bash + pip install gunicorn[gevent] + ``` -```bash -pip install gunicorn[gevent,setproctitle] -``` + Run with: + ```bash + gunicorn app:app --worker-class gevent + ``` -## Debian GNU/Linux +=== "Eventlet" -On Debian systems prefer the distribution packages unless you need per-project -virtual environments: + ```bash + pip install gunicorn[eventlet] + ``` -- Zero-effort installation: automatically starts multiple instances based on - configs in `/etc/gunicorn.d`. -- Sensible log locations (`/var/log/gunicorn`) with `logrotate` support. -- Improved security: run each instance with a dedicated UNIX user/group. -- Safe upgrades: minimal downtime, reversible changes, and easy package purge. + Run with: + ```bash + gunicorn app:app --worker-class eventlet + ``` -### stable ("buster") +=== "ASGI (asyncio)" -The Debian [stable](https://www.debian.org/releases/stable/) release ships -Gunicorn 19.9.0 (December 2020): + No extra installation required: -```bash -sudo apt-get install gunicorn3 -``` - -Install Gunicorn 20.0.4 from [Debian Backports](https://backports.debian.org/) -by adding this line to `/etc/apt/sources.list`: - -```text -deb http://ftp.debian.org/debian buster-backports main -``` - -Refresh package metadata and install: - -```bash -sudo apt-get update -sudo apt-get -t buster-backports install gunicorn -``` - -### oldstable ("stretch") + ```bash + gunicorn app:app --worker-class asgi + ``` -Stretch provides Gunicorn 19.6.0 (December 2020). Install the Python 3 version: + For better performance, install uvloop: + ```bash + pip install uvloop + gunicorn app:app --worker-class asgi --asgi-loop uvloop + ``` -```bash -sudo apt-get install gunicorn3 -``` - -To upgrade to 19.7.1 from backports, add: +!!! note + Greenlet-based workers require the Python development headers. On Ubuntu: + `sudo apt-get install python3-dev` -```text -deb http://ftp.debian.org/debian stretch-backports main -``` +## Verify Installation -Then update and install: +Check the installed version: ```bash -sudo apt-get update -sudo apt-get -t stretch-backports install gunicorn3 +gunicorn --version ``` -### testing ("bullseye") and unstable ("sid") - -Both distributions include Gunicorn 20.0.4. Install it in the usual way: +Test with a simple application: ```bash -sudo apt-get install gunicorn +echo 'def app(e, s): s("200 OK", []); return [b"OK"]' > test_app.py +gunicorn test_app:app +# Visit http://127.0.0.1:8000 ``` -## Ubuntu - -Ubuntu 20.04 LTS (Focal Fossa) and newer include Gunicorn 20.0.4. Keep it -current through the package manager: +## Next Steps -```bash -sudo apt-get update -sudo apt-get install gunicorn -``` +- [Quickstart](quickstart.md) - Get running in 5 minutes +- [Run](run.md) - CLI usage and framework integration +- [Configure](configure.md) - Configuration options diff --git a/docs/content/quickstart.md b/docs/content/quickstart.md new file mode 100644 index 000000000..5457483ae --- /dev/null +++ b/docs/content/quickstart.md @@ -0,0 +1,115 @@ +# Quickstart + +Get a Python web application running with Gunicorn in 5 minutes. + +## Install + +```bash +pip install gunicorn +``` + +## Create an Application + +Create `app.py`: + +=== "Flask" + + ```python + from flask import Flask + + app = Flask(__name__) + + @app.route("/") + def hello(): + return "Hello, World!" + ``` + +=== "FastAPI" + + ```python + from fastapi import FastAPI + + app = FastAPI() + + @app.get("/") + def hello(): + return {"message": "Hello, World!"} + ``` + +=== "Django" + + Django projects already have a WSGI application at `myproject/wsgi.py`. + No additional code is needed. + +=== "Plain WSGI" + + ```python + def app(environ, start_response): + data = b"Hello, World!" + start_response("200 OK", [ + ("Content-Type", "text/plain"), + ("Content-Length", str(len(data))) + ]) + return [data] + ``` + +## Run + +```bash +gunicorn app:app +``` + +For Django: + +```bash +gunicorn myproject.wsgi +``` + +For FastAPI (ASGI): + +```bash +gunicorn app:app --worker-class asgi +``` + +## Add Workers + +Use multiple workers to handle concurrent requests: + +```bash +gunicorn app:app --workers 4 +``` + +A good starting point is `2 * CPU_CORES + 1` workers. + +## Bind to a Port + +By default Gunicorn binds to `127.0.0.1:8000`. Change it with: + +```bash +gunicorn app:app --bind 0.0.0.0:8080 +``` + +## Configuration File + +Create `gunicorn.conf.py` for reusable settings: + +```python +bind = "0.0.0.0:8000" +workers = 4 +accesslog = "-" +``` + +Then run: + +```bash +gunicorn app:app +``` + +Gunicorn automatically loads `gunicorn.conf.py` from the current directory. + +## Next Steps + +- [Run](run.md) - Full CLI reference and framework integration +- [Configure](configure.md) - Configuration file options +- [Deploy](deploy.md) - Production deployment with nginx and process managers +- [Settings](reference/settings.md) - Complete settings reference diff --git a/mkdocs.yml b/mkdocs.yml index 6a5caf1a8..2cf23a680 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -7,19 +7,23 @@ use_directory_urls: true nav: - Home: index.md - - Guides: + - Getting Started: + - Quickstart: quickstart.md - Install: install.md - Run: run.md - Configure: configure.md + - Guides: - Deploy: deploy.md + - Docker: guides/docker.md - ASGI Worker: asgi.md - uWSGI Protocol: uwsgi.md - Signals: signals.md - Instrumentation: instrumentation.md - Custom: custom.md - - Community: community.md - - FAQ: faq.md - Design: design.md + - Community: + - Overview: community.md + - FAQ: faq.md - Reference: - Settings: reference/settings.md - News: From e9bc51cce43c57020522f10ce2353d4aab99b81b Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 22:26:18 +0100 Subject: [PATCH 039/356] docs: Modernize landing page with hero, pillars, and framework cards --- docs/content/index.md | 121 ++++++++++++------ docs/content/styles/overrides.css | 203 ++++++++++++++++++++++++++---- 2 files changed, 262 insertions(+), 62 deletions(-) diff --git a/docs/content/index.md b/docs/content/index.md index c9a7079a0..fbd095446 100644 --- a/docs/content/index.md +++ b/docs/content/index.md @@ -4,65 +4,114 @@
-

Production-ready Python web services

-

Gunicorn is a dependable WSGI HTTP server for UNIX that keeps Python applications running fast and resilient in production. Built on a pre-fork worker model and trusted in countless deployments, it pairs clean configuration with flexible worker strategies so you can meet any traffic pattern.

+

The Python WSGI Server
for Production

+

Fast, reliable, and battle-tested. Gunicorn runs your Python web applications with the stability and performance you need in production.

-
$ pip install gunicorn
-$ gunicorn example:app --workers 3
-
Latest release: {{ release }}
+
pip install gunicorn
+gunicorn myapp:app --workers 4
+
v{{ release }}
-## Quickstart +
+
+
🚀
+

Production-Proven

+

Trusted by thousands of companies worldwide. The pre-fork worker model handles traffic spikes gracefully.

+
+
+
+

Lightweight

+

Minimal dependencies, simple configuration. Runs efficiently from containers to bare metal servers.

+
+
+
🔌
+

Compatible

+

Works with any WSGI framework. Django, Flask, Pyramid—your app just runs. Now with ASGI support.

+
+
-1. Install Gunicorn into your application environment. -2. Point Gunicorn at your WSGI app: `gunicorn myproject.wsgi`. -3. Tune worker type, concurrency, and hooks using the rich [settings](reference/settings.md). +## Works With Your Stack -Need a longer walkthrough? Jump into the [install guide](install.md). +
+
+ Django +
+
+ Flask +
+
+ FastAPI +
+
+ Pyramid +
+
+ Starlette +
+
+ Falcon +
+
-## Why teams choose Gunicorn +## Choose Your Worker
-

Works with your framework

-

Django, Flask, FastAPI, Pyramid, you name it—Gunicorn speaks WSGI so your stack just runs.

- Running Gunicorn → +

Sync Workers

+

The default. One request per worker. Simple, predictable, and perfect for most applications.

+ Learn more
-

Flexible workers

-

Sync, async, gevent, eventlet—choose the concurrency model that fits.

- Worker classes → +

Async Workers

+

Gevent or Eventlet for thousands of concurrent connections. Ideal for I/O-bound workloads.

+ Learn more
-

Battle-tested hooks

-

Lifecycle hooks let you instrument, reload, and extend Gunicorn to match your deployment requirements.

- Server hooks → +

Thread Workers

+

Multiple threads per worker. Balance between concurrency and simplicity.

+ Learn more
-

Containers to bare metal

-

Deploy with systemd, Kubernetes, Heroku, or Docker—the configuration stays predictable everywhere.

- Deployment patterns → +

ASGI Workers Beta

+

Native asyncio support for FastAPI, Starlette, and other async frameworks.

+ Learn more
-## Documentation map +## Quick Links -- [Install](install.md): Set up Gunicorn in a clean environment. -- [Run](run.md): CLI usage and integration with frameworks. -- [Configure](configure.md): Combine CLI flags and config files effectively. -- [Settings reference](reference/settings.md): Generated from the Gunicorn source of truth. -- [Signals](signals.md): Manage worker lifecycle in production. -- [Instrumentation](instrumentation.md): Monitor metrics and logs. + -## Community & support +## Community -- Report bugs or request features on [GitHub Issues](https://github.com/benoitc/gunicorn/issues). -- Discuss strategies with maintainers in `#gunicorn` on [Libera Chat](https://libera.chat/). -- Contributions are welcome—see the [contributing guide](community.md#contributing) and say hi to the maintainers. + diff --git a/docs/content/styles/overrides.css b/docs/content/styles/overrides.css index 7cf82930d..72ee06748 100644 --- a/docs/content/styles/overrides.css +++ b/docs/content/styles/overrides.css @@ -21,6 +21,7 @@ height: 1.8rem; } +/* Hero Section */ .md-typeset .hero { margin: 2rem 0 3rem; padding: 3.5rem; @@ -52,11 +53,17 @@ .md-typeset .hero__copy h1 { margin: 0 0 1rem; - font-size: 2.6rem; + font-size: 2.4rem; font-weight: 700; line-height: 1.2; } +.md-typeset .hero__tagline { + font-size: 1.1rem; + opacity: 0.95; + margin-bottom: 0; +} + .md-typeset .hero__cta { margin-top: 1.75rem; display: flex; @@ -66,7 +73,7 @@ .md-typeset .hero__code { flex: 1 1 260px; - max-width: 420px; + max-width: 380px; background: rgba(255, 255, 255, 0.08); border-radius: 14px; padding: 1.5rem; @@ -92,8 +99,85 @@ .md-typeset .hero__version { font-weight: 600; letter-spacing: 0.01em; + font-size: 0.9rem; + opacity: 0.9; +} + +.md-typeset .hero__logo { + height: 64px; + margin-bottom: 1.25rem; +} + +[data-md-color-scheme="slate"] .md-typeset .hero__logo { + filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.35)); +} + +/* Pillars Section */ +.md-typeset .pillars { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); + gap: 1.5rem; + margin: 3rem 0; +} + +.md-typeset .pillar { + text-align: center; + padding: 1.5rem; +} + +.md-typeset .pillar__icon { + font-size: 2.5rem; + margin-bottom: 0.75rem; +} + +.md-typeset .pillar h3 { + margin: 0 0 0.5rem; + font-size: 1.25rem; + color: var(--gunicorn-green-dark); +} + +[data-md-color-scheme="slate"] .md-typeset .pillar h3 { + color: var(--gunicorn-green-light); } +.md-typeset .pillar p { + margin: 0; + font-size: 0.95rem; + opacity: 0.85; +} + +/* Frameworks Section */ +.md-typeset .frameworks { + display: flex; + flex-wrap: wrap; + gap: 1rem; + justify-content: center; + margin: 2rem 0 3rem; +} + +.md-typeset .framework { + background: var(--gunicorn-cream); + border: 1px solid rgba(0, 0, 0, 0.08); + border-radius: 10px; + padding: 0.75rem 1.5rem; + font-weight: 600; + font-size: 0.95rem; + color: var(--gunicorn-green-dark); + transition: transform 0.2s ease, box-shadow 0.2s ease; +} + +[data-md-color-scheme="slate"] .md-typeset .framework { + background: rgba(45, 48, 45, 0.9); + border-color: rgba(255, 255, 255, 0.08); + color: #e8f5ea; +} + +.md-typeset .framework:hover { + transform: translateY(-2px); + box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); +} + +/* Feature Grid */ .md-typeset .feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); @@ -118,12 +202,20 @@ .md-typeset .feature-card h3 { margin-top: 0; - font-size: 1.3rem; + font-size: 1.2rem; color: var(--gunicorn-green-dark); + display: flex; + align-items: center; + gap: 0.5rem; } [data-md-color-scheme="slate"] .md-typeset .feature-card h3 { - color: var(--gunicorn-cream); + color: #e8f5ea; +} + +.md-typeset .feature-card p { + font-size: 0.95rem; + opacity: 0.85; } .md-typeset .feature-card a { @@ -139,26 +231,94 @@ box-shadow: 0 18px 36px rgba(0, 0, 0, 0.12); } -.md-typeset .feature-card:hover a::after { - content: '\\2192'; - opacity: 1; - transform: translateX(4px); +/* Badge */ +.md-typeset .badge { + display: inline-block; + font-size: 0.65rem; + font-weight: 700; + text-transform: uppercase; + padding: 0.2rem 0.5rem; + border-radius: 4px; + vertical-align: middle; +} + +.md-typeset .badge--new { + background: var(--gunicorn-green); + color: #fff; +} + +/* Quick Links */ +.md-typeset .quick-links { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); + gap: 1rem; + margin: 2rem 0; +} + +.md-typeset .quick-link { + display: block; + padding: 1.25rem; + background: var(--gunicorn-cream); + border-radius: 12px; + border: 1px solid rgba(0, 0, 0, 0.05); + text-decoration: none; + transition: transform 0.2s ease, box-shadow 0.2s ease; +} + +[data-md-color-scheme="slate"] .md-typeset .quick-link { + background: rgba(45, 48, 45, 0.9); + border-color: rgba(255, 255, 255, 0.05); +} + +.md-typeset .quick-link:hover { + transform: translateY(-2px); + box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); +} + +.md-typeset .quick-link strong { + display: block; + font-size: 1.1rem; + color: var(--gunicorn-green-dark); + margin-bottom: 0.25rem; +} + +[data-md-color-scheme="slate"] .md-typeset .quick-link strong { + color: var(--gunicorn-green-light); +} + +.md-typeset .quick-link span { + font-size: 0.9rem; + opacity: 0.75; +} + +/* Community Links */ +.md-typeset .community-links { + margin: 1.5rem 0; +} + +.md-typeset .community-links ul { + list-style: none; + padding: 0; + margin: 0; +} + +.md-typeset .community-links li { + margin-bottom: 0.75rem; } -.md-typeset .feature-card a::after { - content: '\\2192'; - opacity: 0; - transition: opacity 0.2s ease, transform 0.2s ease; - transform: translateX(0); +/* Footer */ +.md-footer-meta__inner { + flex-wrap: wrap; } +/* Responsive */ @media (max-width: 960px) { .md-typeset .hero { padding: 2.25rem; } .md-typeset .hero__copy h1 { - font-size: 2.2rem; + font-size: 2rem; } } @@ -176,17 +336,8 @@ .md-typeset .hero__code { width: 100%; } -} -.md-footer-meta__inner { - flex-wrap: wrap; -} - -.md-typeset .hero__logo { - height: 64px; - margin-bottom: 1.25rem; -} - -[data-md-color-scheme="slate"] .md-typeset .hero__logo { - filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.35)); + .md-typeset .pillars { + grid-template-columns: 1fr; + } } From 0b961036b7dc756632fc97676eb71aea3f682ca6 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 22:30:37 +0100 Subject: [PATCH 040/356] docs: Configure GitHub Pages deployment with custom domain --- .github/workflows/docs.yml | 14 +++++++++++--- docs/content/404.md | 22 ++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 docs/content/404.md diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 65098c18a..0f6aef184 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,18 +2,23 @@ name: Docs on: push: - branches: [ main ] + branches: [ master ] paths: - 'docs/**' - 'mkdocs.yml' + - 'scripts/build_settings_doc.py' + - 'gunicorn/config.py' - 'requirements_dev.txt' - '.github/workflows/docs.yml' pull_request: paths: - 'docs/**' - 'mkdocs.yml' + - 'scripts/build_settings_doc.py' + - 'gunicorn/config.py' - 'requirements_dev.txt' - '.github/workflows/docs.yml' + workflow_dispatch: jobs: build: @@ -29,6 +34,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip + pip install -e . pip install -r requirements_dev.txt - name: Build documentation @@ -42,7 +48,7 @@ jobs: retention-days: 7 deploy: - if: github.event_name == 'push' && github.ref == 'refs/heads/main' + if: github.event_name == 'push' && github.ref == 'refs/heads/master' needs: build runs-on: ubuntu-latest permissions: @@ -58,6 +64,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip + pip install -e . pip install -r requirements_dev.txt - name: Build documentation @@ -69,4 +76,5 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: site publish_branch: gh-pages - commit_message: "docs: deploy {sha}" + cname: gunicorn.org + commit_message: "docs: deploy ${{ github.sha }}" diff --git a/docs/content/404.md b/docs/content/404.md new file mode 100644 index 000000000..211fcad00 --- /dev/null +++ b/docs/content/404.md @@ -0,0 +1,22 @@ +# Page Not Found + +The page you're looking for doesn't exist or has moved. + + From 5ea4eb340a2d0a8b5c7b963007f7b414910a64f3 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 22:33:58 +0100 Subject: [PATCH 041/356] docs: Add 2026 changelog and modernize README --- README.rst | 64 +++++++++++++++++++-------------------- docs/content/2026-news.md | 37 ++++++++++++++++++++++ docs/content/news.md | 23 ++++++++++++++ mkdocs.yml | 1 + 4 files changed, 92 insertions(+), 33 deletions(-) create mode 100644 docs/content/2026-news.md diff --git a/README.rst b/README.rst index ddb22b4d3..f87cc4a6d 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ Gunicorn --------- +======== .. image:: https://img.shields.io/pypi/v/gunicorn.svg?style=flat :alt: PyPI version @@ -13,60 +13,58 @@ Gunicorn :alt: Build Status :target: https://github.com/benoitc/gunicorn/actions/workflows/tox.yml -.. image:: https://github.com/benoitc/gunicorn/actions/workflows/lint.yml/badge.svg - :alt: Lint Status - :target: https://github.com/benoitc/gunicorn/actions/workflows/lint.yml - Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX. It's a pre-fork worker model ported from Ruby's Unicorn_ project. The Gunicorn server is broadly compatible with various web frameworks, simply implemented, light on server resource usage, and fairly speedy. -Feel free to join us in `#gunicorn`_ on `Libera.chat`_. - -Documentation -------------- - -The documentation is hosted at https://docs.gunicorn.org. +**New in v24**: Native ASGI support (beta) for async frameworks like FastAPI! -Installation ------------- +Quick Start +----------- -Gunicorn requires **Python 3.x >= 3.10**. +.. code-block:: bash -Install from PyPI:: + pip install gunicorn + gunicorn myapp:app --workers 4 - $ pip install gunicorn +For ASGI applications (FastAPI, Starlette): +.. code-block:: bash -Usage ------ + gunicorn myapp:app --worker-class asgi -Basic usage:: - - $ gunicorn [OPTIONS] APP_MODULE - -Where ``APP_MODULE`` is of the pattern ``$(MODULE_NAME):$(VARIABLE_NAME)``. The -module name can be a full dotted path. The variable name refers to a WSGI -callable that should be found in the specified module. +Features +-------- -Example with test app:: +- WSGI support for Django, Flask, Pyramid, and any WSGI framework +- **ASGI support** (beta) for FastAPI, Starlette, Quart +- uWSGI binary protocol for nginx integration +- Multiple worker types: sync, gthread, gevent, eventlet, asgi +- Graceful worker process management +- Compatible with Python 3.12+ - $ cd examples - $ gunicorn --workers=2 test:app +Documentation +------------- +Full documentation at https://gunicorn.org -Contributing ------------- +- `Quickstart `_ +- `Configuration `_ +- `Deployment `_ +- `Settings Reference `_ -See `our complete contributor's guide `_ for more details. +Community +--------- +- Report bugs on `GitHub Issues `_ +- Chat in `#gunicorn`_ on `Libera.chat`_ +- See `CONTRIBUTING.md `_ for contribution guidelines License ------- -Gunicorn is released under the MIT License. See the LICENSE_ file for more -details. +Gunicorn is released under the MIT License. See the LICENSE_ file for details. .. _Unicorn: https://bogomips.org/unicorn/ .. _`#gunicorn`: https://web.libera.chat/?channels=#gunicorn diff --git a/docs/content/2026-news.md b/docs/content/2026-news.md new file mode 100644 index 000000000..8a935dba7 --- /dev/null +++ b/docs/content/2026-news.md @@ -0,0 +1,37 @@ + +# Changelog - 2026 + +## 24.0.0 - 2026-XX-XX + +### New Features + +- **ASGI Worker (Beta)**: Native asyncio-based ASGI support for running async Python + frameworks like FastAPI, Starlette, and Quart without external dependencies + ([PR #3444](https://github.com/benoitc/gunicorn/pull/3444)) + - HTTP/1.1 with keepalive connections + - WebSocket support + - Lifespan protocol for startup/shutdown hooks + - Optional uvloop for improved performance + - New settings: `--asgi-loop`, `--asgi-lifespan`, `--root-path` + +- **uWSGI Binary Protocol**: Support for receiving requests from nginx via + `uwsgi_pass` directive, enabling efficient binary protocol communication + ([PR #3444](https://github.com/benoitc/gunicorn/pull/3444)) + - New settings: `--protocol uwsgi`, `--uwsgi-allow-from` + +- **Documentation Migration**: Migrated documentation from Sphinx to MkDocs + with Material theme for improved navigation and mobile experience + ([PR #3426](https://github.com/benoitc/gunicorn/pull/3426)) + +### Changes + +- Minimum Python version is now 3.12 +- Documentation now hosted at https://gunicorn.org + +### Breaking changes + +- Dropped support for Python versions before 3.12 + +!!! warning "ASGI Worker Beta" + The ASGI worker is a beta feature. While tested, the API and behavior + may change in future releases. Please report any issues on GitHub. diff --git a/docs/content/news.md b/docs/content/news.md index 1b7f07229..59e27c0a0 100644 --- a/docs/content/news.md +++ b/docs/content/news.md @@ -1,6 +1,28 @@ # Changelog +## 24.0.0 - 2026-XX-XX + +### New Features + +- **ASGI Worker (Beta)**: Native asyncio-based ASGI support for running async Python + frameworks like FastAPI, Starlette, and Quart without external dependencies + - HTTP/1.1 with keepalive connections + - WebSocket support + - Lifespan protocol for startup/shutdown hooks + - Optional uvloop for improved performance + +- **uWSGI Binary Protocol**: Support for receiving requests from nginx via + `uwsgi_pass` directive + +- **Documentation Migration**: Migrated to MkDocs with Material theme + +### Breaking changes + +- Minimum Python version is now 3.12 + +--- + ## 23.0.0 - 2024-08-10 - minor docs fixes ([PR #3217](https://github.com/benoitc/gunicorn/pull/3217), [PR #3089](https://github.com/benoitc/gunicorn/pull/3089), [PR #3167](https://github.com/benoitc/gunicorn/pull/3167)) @@ -59,6 +81,7 @@ ## History +- [2026](2026-news.md) - [2024](2024-news.md) - [2023](2023-news.md) - [2021](2021-news.md) diff --git a/mkdocs.yml b/mkdocs.yml index 2cf23a680..ccf27e75f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -28,6 +28,7 @@ nav: - Settings: reference/settings.md - News: - Latest: news.md + - '2026': 2026-news.md - '2024': 2024-news.md - '2023': 2023-news.md - '2021': 2021-news.md From dcec6e701a22a63fa8ac1a68e47627eec724b3e8 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 23:06:01 +0100 Subject: [PATCH 042/356] docs: Modern landing page with custom template - Add custom home.html template to break out of MkDocs constraints - Create Caddy-inspired minimal CSS for landing page - Redesign hero section with terminal demo - Add framework tags and worker type cards - Full-width sections with vertical narrative flow - Dark mode support --- docs/content/assets/stylesheets/home.css | 435 +++++++++++++++++++++++ docs/content/index.md | 218 ++++++------ mkdocs.yml | 2 + overrides/home.html | 30 ++ 4 files changed, 581 insertions(+), 104 deletions(-) create mode 100644 docs/content/assets/stylesheets/home.css create mode 100644 overrides/home.html diff --git a/docs/content/assets/stylesheets/home.css b/docs/content/assets/stylesheets/home.css new file mode 100644 index 000000000..d6e498549 --- /dev/null +++ b/docs/content/assets/stylesheets/home.css @@ -0,0 +1,435 @@ +/* ============================================ + Gunicorn Landing Page + Inspired by Caddy: minimal, spacious, clean + ============================================ */ + +.home { + --accent: #499848; + --accent-hover: #3d8040; + --text: #333; + --text-muted: #666; + --bg: #fff; + --bg-alt: #f6f8fa; + --border: #e1e4e8; + --code-bg: #0d1117; + --max-width: 900px; + + width: 100%; + max-width: none; + margin: 0; + padding: 0; + font-size: 1.0625rem; + line-height: 1.7; + color: var(--text); +} + +[data-md-color-scheme="slate"] .home { + --text: #e6e6e6; + --text-muted: #999; + --bg: #1a1a1a; + --bg-alt: #242424; + --border: #333; +} + +/* Remove MkDocs constraints */ +.md-main__inner { margin: 0; max-width: none; } +.md-content { max-width: none; } +.md-content__inner { margin: 0; padding: 0; } + +/* ============================================ + Sections - Caddy-style vertical flow + ============================================ */ +.home section { + padding: 5rem 2rem; +} + +.home section:nth-child(even) { + background: var(--bg-alt); +} + +.home .container { + max-width: var(--max-width); + margin: 0 auto; +} + +/* ============================================ + Hero + ============================================ */ +.hero { + text-align: center; + padding: 6rem 2rem 5rem; +} + +.hero .container { + max-width: 700px; +} + +.hero__logo { + width: 350px !important; + max-width: 350px !important; + min-width: 350px; + height: auto; + margin-bottom: 2rem; +} + +.hero h1 { + font-size: 3rem; + font-weight: 700; + line-height: 1.15; + margin: 0 0 1.5rem 0; + letter-spacing: -0.02em; + white-space: nowrap; +} + +.hero__tagline { + font-size: 1.25rem; + color: var(--text-muted); + margin: 0 0 2.5rem 0; + max-width: 550px; + margin-left: auto; + margin-right: auto; +} + +.hero__buttons { + display: flex; + gap: 1rem; + justify-content: center; + flex-wrap: wrap; + margin-bottom: 3rem; +} + +.btn { + display: inline-flex; + align-items: center; + gap: 0.5rem; + padding: 0.875rem 1.75rem; + font-size: 1rem; + font-weight: 500; + text-decoration: none; + border-radius: 6px; + transition: all 0.15s ease; +} + +.btn--primary { + background: var(--accent); + color: #fff; +} + +.btn--primary:hover { + background: var(--accent-hover); +} + +.btn--secondary { + background: transparent; + color: var(--text); + border: 1px solid var(--border); +} + +.btn--secondary:hover { + border-color: var(--accent); + color: var(--accent); +} + +/* Terminal */ +.terminal { + background: var(--code-bg); + border-radius: 8px; + overflow: hidden; + text-align: left; + max-width: 500px; + margin: 0 auto; + box-shadow: 0 8px 30px rgba(0,0,0,0.12); +} + +.terminal__header { + background: #161b22; + padding: 0.75rem 1rem; + display: flex; + gap: 6px; +} + +.terminal__dot { + width: 12px; + height: 12px; + border-radius: 50%; +} + +.terminal__dot--red { background: #ff5f56; } +.terminal__dot--yellow { background: #ffbd2e; } +.terminal__dot--green { background: #27c93f; } + +.terminal__body { + padding: 1.25rem 1.5rem; + font-family: 'SF Mono', Monaco, Consolas, monospace; + font-size: 0.9rem; + line-height: 1.8; + color: #c9d1d9; +} + +.terminal__line { + display: block; +} + +.terminal__prompt { + color: var(--accent); + user-select: none; +} + +.terminal__comment { + color: #6e7681; +} + +/* ============================================ + Why Gunicorn - 3 pillars + ============================================ */ +.why h2 { + text-align: center; + font-size: 2rem; + margin: 0 0 3rem 0; +} + +.pillars { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 2rem; +} + +.pillar h3 { + font-size: 1.125rem; + margin: 0 0 0.5rem 0; +} + +.pillar p { + color: var(--text-muted); + margin: 0; + font-size: 0.9375rem; +} + +/* ============================================ + Frameworks + ============================================ */ +.frameworks h2 { + text-align: center; + font-size: 1.75rem; + margin: 0 0 0.5rem 0; +} + +.frameworks__subtitle { + text-align: center; + color: var(--text-muted); + margin: 0 0 2rem 0; +} + +.frameworks__list { + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: 0.75rem; +} + +.framework-tag { + padding: 0.5rem 1rem; + background: var(--bg); + border: 1px solid var(--border); + border-radius: 100px; + font-size: 0.875rem; + font-weight: 500; + transition: all 0.15s ease; +} + +[data-md-color-scheme="slate"] .framework-tag { + background: var(--bg-alt); +} + +.framework-tag:hover { + border-color: var(--accent); + color: var(--accent); +} + +.framework-tag--new { + background: var(--accent); + color: #fff; + border-color: var(--accent); +} + +/* ============================================ + Workers + ============================================ */ +.workers h2 { + font-size: 1.75rem; + margin: 0 0 2rem 0; +} + +.workers__grid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 1rem; +} + +.worker { + padding: 1.5rem; + background: var(--bg); + border: 1px solid var(--border); + border-radius: 8px; + text-decoration: none; + color: inherit; + transition: border-color 0.15s ease; +} + +[data-md-color-scheme="slate"] .worker { + background: var(--bg-alt); +} + +.worker:hover { + border-color: var(--accent); +} + +.worker h3 { + font-size: 1rem; + margin: 0 0 0.25rem 0; + display: flex; + align-items: center; + gap: 0.5rem; +} + +.worker p { + color: var(--text-muted); + font-size: 0.875rem; + margin: 0; +} + +.badge { + font-size: 0.625rem; + font-weight: 700; + padding: 0.125rem 0.375rem; + background: var(--accent); + color: #fff; + border-radius: 3px; + text-transform: uppercase; + letter-spacing: 0.05em; +} + +/* ============================================ + Quick Links + ============================================ */ +.quick-links { + text-align: center; +} + +.quick-links h2 { + font-size: 1.75rem; + margin: 0 0 2rem 0; +} + +.quick-links__grid { + display: grid; + grid-template-columns: repeat(4, 1fr); + gap: 1rem; + text-align: left; +} + +.quick-link { + padding: 1.25rem; + background: var(--bg); + border: 1px solid var(--border); + border-radius: 8px; + text-decoration: none; + color: inherit; + transition: border-color 0.15s ease; +} + +[data-md-color-scheme="slate"] .quick-link { + background: var(--bg-alt); +} + +.quick-link:hover { + border-color: var(--accent); +} + +.quick-link strong { + display: block; + margin-bottom: 0.25rem; +} + +.quick-link span { + font-size: 0.875rem; + color: var(--text-muted); +} + +/* ============================================ + Footer CTA + ============================================ */ +.home-footer { + text-align: center; +} + +.home-footer h2 { + font-size: 1.75rem; + margin: 0 0 1rem 0; +} + +.home-footer p { + color: var(--text-muted); + margin: 0 0 2rem 0; +} + +.home-footer__links { + display: flex; + justify-content: center; + gap: 2rem; +} + +.home-footer__links a { + color: var(--text-muted); + text-decoration: none; + font-size: 0.9375rem; +} + +.home-footer__links a:hover { + color: var(--accent); +} + +/* ============================================ + Responsive + ============================================ */ +@media (max-width: 768px) { + .home section { + padding: 3.5rem 1.5rem; + } + + .hero h1 { + font-size: 2.25rem; + } + + .pillars { + grid-template-columns: 1fr; + gap: 1.5rem; + } + + .workers__grid { + grid-template-columns: 1fr; + } + + .quick-links__grid { + grid-template-columns: 1fr 1fr; + } +} + +@media (max-width: 480px) { + .hero h1 { + font-size: 1.875rem; + } + + .hero__buttons { + flex-direction: column; + } + + .btn { + width: 100%; + justify-content: center; + } + + .quick-links__grid { + grid-template-columns: 1fr; + } +} diff --git a/docs/content/index.md b/docs/content/index.md index fbd095446..7a9136b59 100644 --- a/docs/content/index.md +++ b/docs/content/index.md @@ -1,117 +1,127 @@ -# Gunicorn +--- +template: home.html +title: Gunicorn - Python WSGI HTTP Server +--- -
-
-
- -

The Python WSGI Server
for Production

-

Fast, reliable, and battle-tested. Gunicorn runs your Python web applications with the stability and performance you need in production.

- +
+
+ +

The Python WSGI Server

+

+ Battle-tested. Production-ready. One command to serve your Python apps. +

+ -
-
pip install gunicorn
-gunicorn myapp:app --workers 4
-
v{{ release }}
+
+
+ + + +
+
+ $ pip install gunicorn + $ gunicorn myapp:app + # Listening at http://127.0.0.1:8000 +
-
+
-
-
-
🚀
-

Production-Proven

-

Trusted by thousands of companies worldwide. The pre-fork worker model handles traffic spikes gracefully.

-
-
-
-

Lightweight

-

Minimal dependencies, simple configuration. Runs efficiently from containers to bare metal servers.

-
-
-
🔌
-

Compatible

-

Works with any WSGI framework. Django, Flask, Pyramid—your app just runs. Now with ASGI support.

+
+
+

Why Gunicorn?

+
+
+

Production-Proven

+

Trusted by thousands of companies. The pre-fork worker model handles traffic spikes gracefully.

+
+
+

Lightweight

+

Minimal dependencies, simple configuration. Efficient from containers to bare metal.

+
+
+

Compatible

+

Works with any WSGI or ASGI framework. Django, Flask, FastAPI—it just runs.

+
+
-## Works With Your Stack - -
-
- Django -
-
- Flask -
-
- FastAPI -
-
- Pyramid -
-
- Starlette -
-
- Falcon +
+
+

Works With Your Stack

+

WSGI and ASGI frameworks, no changes needed

+
+ Django + Flask + FastAPI + Pyramid + Starlette + Falcon + Bottle + Quart +
-
- -## Choose Your Worker - -
-
-

Sync Workers

-

The default. One request per worker. Simple, predictable, and perfect for most applications.

- Learn more -
-
-

Async Workers

-

Gevent or Eventlet for thousands of concurrent connections. Ideal for I/O-bound workloads.

- Learn more -
-
-

Thread Workers

-

Multiple threads per worker. Balance between concurrency and simplicity.

- Learn more -
-
-

ASGI Workers Beta

-

Native asyncio support for FastAPI, Starlette, and other async frameworks.

- Learn more -
-## Quick Links - - - -## Community - - + diff --git a/mkdocs.yml b/mkdocs.yml index ccf27e75f..955c2079b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -46,6 +46,7 @@ nav: theme: name: material + custom_dir: overrides language: en logo: assets/gunicorn.svg favicon: assets/gunicorn.svg @@ -92,6 +93,7 @@ markdown_extensions: extra_css: - styles/overrides.css + - assets/stylesheets/home.css extra: social: diff --git a/overrides/home.html b/overrides/home.html new file mode 100644 index 000000000..8defc14c8 --- /dev/null +++ b/overrides/home.html @@ -0,0 +1,30 @@ +{% extends "main.html" %} + +{% block tabs %} +{{ super() }} +{% endblock %} + +{% block htmltitle %} +Gunicorn - Python WSGI HTTP Server for UNIX +{% endblock %} + +{% block styles %} +{{ super() }} + +{% endblock %} + +{% block hero %}{% endblock %} + +{% block content %}{% endblock %} + +{% block site_nav %}{% endblock %} + +{% block container %} +
+ {{ page.content }} +
+{% endblock %} + +{% block footer %} +{{ super() }} +{% endblock %} From 73adc7cb298e2339d7de14bd7b07502ac826f843 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 23:27:32 +0100 Subject: [PATCH 043/356] docs: Add collapsible TOC for settings reference - Change settings headers to h2 sections / h3 settings for TOC visibility - Enable toc.integrate to show TOC in left sidebar - Add JavaScript for collapsible section toggles on settings page --- .../assets/javascripts/toc-collapse.js | 79 +++++++ docs/content/reference/settings.md | 216 +++++++++--------- mkdocs.yml | 4 + scripts/build_settings_doc.py | 4 +- 4 files changed, 193 insertions(+), 110 deletions(-) create mode 100644 docs/content/assets/javascripts/toc-collapse.js diff --git a/docs/content/assets/javascripts/toc-collapse.js b/docs/content/assets/javascripts/toc-collapse.js new file mode 100644 index 000000000..6b2dc6f9f --- /dev/null +++ b/docs/content/assets/javascripts/toc-collapse.js @@ -0,0 +1,79 @@ +// Collapsible TOC for settings page +(function() { + function initCollapsibleTOC() { + // Only apply to pages with many TOC items (like settings) + var tocNav = document.querySelector('.md-nav--secondary'); + if (!tocNav) return; + + // Skip if already initialized + if (tocNav.dataset.tocCollapse === 'true') return; + tocNav.dataset.tocCollapse = 'true'; + + var tocItems = tocNav.querySelectorAll('.md-nav__item'); + if (tocItems.length < 20) return; + + // Find all top-level TOC items that have nested lists + var topList = tocNav.querySelector('.md-nav__list'); + if (!topList) return; + + var sections = topList.children; + + for (var i = 0; i < sections.length; i++) { + (function(section) { + var nestedNav = section.querySelector('.md-nav'); + if (!nestedNav) return; + + var link = section.querySelector('.md-nav__link'); + if (!link) return; + + // Skip if already has toggle + if (link.querySelector('.toc-toggle')) return; + + // Collapse by default + nestedNav.style.display = 'none'; + + // Create toggle button + var toggle = document.createElement('span'); + toggle.className = 'toc-toggle'; + toggle.innerHTML = '+'; + toggle.style.float = 'right'; + toggle.style.marginRight = '0.5rem'; + toggle.style.fontWeight = 'bold'; + toggle.style.cursor = 'pointer'; + toggle.style.userSelect = 'none'; + link.appendChild(toggle); + + // Toggle function for this specific section + function toggleSection(e) { + if (e) { + e.preventDefault(); + e.stopPropagation(); + } + + if (nestedNav.style.display === 'none') { + nestedNav.style.display = 'block'; + toggle.innerHTML = '−'; + } else { + nestedNav.style.display = 'none'; + toggle.innerHTML = '+'; + } + } + + // Click on toggle button + toggle.onclick = toggleSection; + })(sections[i]); + } + } + + // Run on DOM ready + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', initCollapsibleTOC); + } else { + initCollapsibleTOC(); + } + + // Re-run on instant navigation (MkDocs Material) + if (typeof document$ !== 'undefined') { + document$.subscribe(initCollapsibleTOC); + } +})(); diff --git a/docs/content/reference/settings.md b/docs/content/reference/settings.md index d320fcf46..e24227bfd 100644 --- a/docs/content/reference/settings.md +++ b/docs/content/reference/settings.md @@ -18,9 +18,9 @@ regenerated during every documentation build. -# Config File +## Config File -## `config` +### `config` **Command line:** `-c CONFIG`, `--config CONFIG` @@ -40,7 +40,7 @@ directory where gunicorn is being run. Loading the config from a Python module requires the ``python:`` prefix. -## `wsgi_app` +### `wsgi_app` **Default:** `None` @@ -48,9 +48,9 @@ A WSGI application path in pattern ``$(MODULE_NAME):$(VARIABLE_NAME)``. !!! info "Added in 20.1.0" -# Debugging +## Debugging -## `reload` +### `reload` **Command line:** `--reload` @@ -73,7 +73,7 @@ because it consumes less system resources. In order to use the inotify reloader, you must have the ``inotify`` package installed. -## `reload_engine` +### `reload_engine` **Command line:** `--reload-engine STRING` @@ -89,7 +89,7 @@ Valid engines are: !!! info "Added in 19.7" -## `reload_extra_files` +### `reload_extra_files` **Command line:** `--reload-extra-file FILES` @@ -100,7 +100,7 @@ Extends [reload](#reload) option to also watch and reload on additional files !!! info "Added in 19.8" -## `spew` +### `spew` **Command line:** `--spew` @@ -110,7 +110,7 @@ Install a trace function that spews every line executed by the server. This is the nuclear option. -## `check_config` +### `check_config` **Command line:** `--check-config` @@ -119,7 +119,7 @@ This is the nuclear option. Check the configuration and exit. The exit status is 0 if the configuration is correct, and 1 if the configuration is incorrect. -## `print_config` +### `print_config` **Command line:** `--print-config` @@ -127,9 +127,9 @@ configuration is correct, and 1 if the configuration is incorrect. Print the configuration settings as fully resolved. Implies [check-config](#check_config). -# Logging +## Logging -## `accesslog` +### `accesslog` **Command line:** `--access-logfile FILE` @@ -139,7 +139,7 @@ The Access log file to write to. ``'-'`` means log to stdout. -## `disable_redirect_access_to_syslog` +### `disable_redirect_access_to_syslog` **Command line:** `--disable-redirect-access-to-syslog` @@ -149,7 +149,7 @@ Disable redirect access logs to syslog. !!! info "Added in 19.8" -## `access_log_format` +### `access_log_format` **Command line:** `--access-logformat STRING` @@ -189,7 +189,7 @@ Use lowercase for header and environment variable names, and put %({x-forwarded-for}i)s -## `errorlog` +### `errorlog` **Command line:** `--error-logfile FILE`, `--log-file FILE` @@ -202,7 +202,7 @@ Using ``'-'`` for FILE makes gunicorn log to stderr. !!! info "Changed in 19.2" Log to stderr by default. -## `loglevel` +### `loglevel` **Command line:** `--log-level LEVEL` @@ -218,7 +218,7 @@ Valid level names are: * ``'error'`` * ``'critical'`` -## `capture_output` +### `capture_output` **Command line:** `--capture-output` @@ -228,7 +228,7 @@ Redirect stdout/stderr to specified file in [errorlog](#errorlog). !!! info "Added in 19.6" -## `logger_class` +### `logger_class` **Command line:** `--logger-class STRING` @@ -242,7 +242,7 @@ normal usages in logging. It provides error and access logging. You can provide your own logger by giving Gunicorn a Python path to a class that quacks like ``gunicorn.glogging.Logger``. -## `logconfig` +### `logconfig` **Command line:** `--log-config FILE` @@ -252,7 +252,7 @@ The log config file to use. Gunicorn uses the standard Python logging module's Configuration file format. -## `logconfig_dict` +### `logconfig_dict` **Default:** `{}` @@ -269,7 +269,7 @@ which can be found at ``gunicorn.glogging.CONFIG_DEFAULTS``. !!! info "Added in 19.8" -## `logconfig_json` +### `logconfig_json` **Command line:** `--log-config-json FILE` @@ -281,7 +281,7 @@ Format: https://docs.python.org/3/library/logging.config.html#logging.config.jso !!! info "Added in 20.0" -## `syslog_addr` +### `syslog_addr` **Command line:** `--log-syslog-to SYSLOG_ADDR` @@ -297,7 +297,7 @@ Address is a string of the form: * ``udp://HOST:PORT`` : for UDP sockets * ``tcp://HOST:PORT`` : for TCP sockets -## `syslog` +### `syslog` **Command line:** `--log-syslog` @@ -309,7 +309,7 @@ Send *Gunicorn* logs to syslog. You can now disable sending access logs by using the disable-redirect-access-to-syslog setting. -## `syslog_prefix` +### `syslog_prefix` **Command line:** `--log-syslog-prefix SYSLOG_PREFIX` @@ -320,7 +320,7 @@ Makes Gunicorn use the parameter as program-name in the syslog entries. All entries will be prefixed by ``gunicorn.``. By default the program name is the name of the process. -## `syslog_facility` +### `syslog_facility` **Command line:** `--log-syslog-facility SYSLOG_FACILITY` @@ -328,7 +328,7 @@ program name is the name of the process. Syslog facility name -## `enable_stdio_inheritance` +### `enable_stdio_inheritance` **Command line:** `-R`, `--enable-stdio-inheritance` @@ -341,7 +341,7 @@ Enable inheritance for stdio file descriptors in daemon mode. Note: To disable the Python stdout buffering, you can to set the user environment variable ``PYTHONUNBUFFERED`` . -## `statsd_host` +### `statsd_host` **Command line:** `--statsd-host STATSD_ADDR` @@ -356,7 +356,7 @@ Address is a string of the form: !!! info "Added in 19.1" -## `dogstatsd_tags` +### `dogstatsd_tags` **Command line:** `--dogstatsd-tags DOGSTATSD_TAGS` @@ -367,7 +367,7 @@ statsd metrics. !!! info "Added in 20" -## `statsd_prefix` +### `statsd_prefix` **Command line:** `--statsd-prefix STATSD_PREFIX` @@ -378,9 +378,9 @@ if not provided). !!! info "Added in 19.2" -# Process Naming +## Process Naming -## `proc_name` +### `proc_name` **Command line:** `-n STRING`, `--name STRING` @@ -395,15 +395,15 @@ module. If not set, the *default_proc_name* setting will be used. -## `default_proc_name` +### `default_proc_name` **Default:** `'gunicorn'` Internal setting that is adjusted for each type of application. -# SSL +## SSL -## `keyfile` +### `keyfile` **Command line:** `--keyfile FILE` @@ -411,7 +411,7 @@ Internal setting that is adjusted for each type of application. SSL key file -## `certfile` +### `certfile` **Command line:** `--certfile FILE` @@ -419,7 +419,7 @@ SSL key file SSL certificate file -## `ssl_version` +### `ssl_version` **Command line:** `--ssl-version` @@ -457,7 +457,7 @@ TLS_SERVER Auto-negotiate the highest protocol version like TLS, The default value has been changed from ``ssl.PROTOCOL_SSLv23`` to ``ssl.PROTOCOL_TLS`` when Python >= 3.6 . -## `cert_reqs` +### `cert_reqs` **Command line:** `--cert-reqs` @@ -473,7 +473,7 @@ Whether client certificate is required (see stdlib ssl module's) `2` ssl.CERT_REQUIRED =========== =========================== -## `ca_certs` +### `ca_certs` **Command line:** `--ca-certs FILE` @@ -481,7 +481,7 @@ Whether client certificate is required (see stdlib ssl module's) CA certificates file -## `suppress_ragged_eofs` +### `suppress_ragged_eofs` **Command line:** `--suppress-ragged-eofs` @@ -489,7 +489,7 @@ CA certificates file Suppress ragged EOFs (see stdlib ssl module's) -## `do_handshake_on_connect` +### `do_handshake_on_connect` **Command line:** `--do-handshake-on-connect` @@ -497,7 +497,7 @@ Suppress ragged EOFs (see stdlib ssl module's) Whether to perform SSL handshake on socket connect (see stdlib ssl module's) -## `ciphers` +### `ciphers` **Command line:** `--ciphers` @@ -518,9 +518,9 @@ See the `OpenSSL Cipher List Format Documentation `_ for details on the format of an OpenSSL cipher list. -# Security +## Security -## `limit_request_line` +### `limit_request_line` **Command line:** `--limit-request-line INT` @@ -539,7 +539,7 @@ from 0 (unlimited) to 8190. This parameter can be used to prevent any DDOS attack. -## `limit_request_fields` +### `limit_request_fields` **Command line:** `--limit-request-fields INT` @@ -552,7 +552,7 @@ prevent DDOS attack. Used with the *limit_request_field_size* it allows more safety. By default this value is 100 and can't be larger than 32768. -## `limit_request_field_size` +### `limit_request_field_size` **Command line:** `--limit-request-field_size INT` @@ -567,9 +567,9 @@ header field sizes. Setting this parameter to a very high or unlimited value can open up for DDOS attacks. -# Server Hooks +## Server Hooks -## `on_starting` +### `on_starting` **Default:** @@ -582,7 +582,7 @@ Called just before the master process is initialized. The callable needs to accept a single instance variable for the Arbiter. -## `on_reload` +### `on_reload` **Default:** @@ -595,7 +595,7 @@ Called to recycle workers during a reload via SIGHUP. The callable needs to accept a single instance variable for the Arbiter. -## `when_ready` +### `when_ready` **Default:** @@ -608,7 +608,7 @@ Called just after the server is started. The callable needs to accept a single instance variable for the Arbiter. -## `pre_fork` +### `pre_fork` **Default:** @@ -622,7 +622,7 @@ Called just before a worker is forked. The callable needs to accept two instance variables for the Arbiter and new Worker. -## `post_fork` +### `post_fork` **Default:** @@ -636,7 +636,7 @@ Called just after a worker has been forked. The callable needs to accept two instance variables for the Arbiter and new Worker. -## `post_worker_init` +### `post_worker_init` **Default:** @@ -650,7 +650,7 @@ Called just after a worker has initialized the application. The callable needs to accept one instance variable for the initialized Worker. -## `worker_int` +### `worker_int` **Default:** @@ -664,7 +664,7 @@ Called just after a worker exited on SIGINT or SIGQUIT. The callable needs to accept one instance variable for the initialized Worker. -## `worker_abort` +### `worker_abort` **Default:** @@ -680,7 +680,7 @@ This call generally happens on timeout. The callable needs to accept one instance variable for the initialized Worker. -## `pre_exec` +### `pre_exec` **Default:** @@ -693,7 +693,7 @@ Called just before a new master process is forked. The callable needs to accept a single instance variable for the Arbiter. -## `pre_request` +### `pre_request` **Default:** @@ -707,7 +707,7 @@ Called just before a worker processes the request. The callable needs to accept two instance variables for the Worker and the Request. -## `post_request` +### `post_request` **Default:** @@ -721,7 +721,7 @@ Called after a worker processes the request. The callable needs to accept two instance variables for the Worker and the Request. -## `child_exit` +### `child_exit` **Default:** @@ -737,7 +737,7 @@ the just-exited Worker. !!! info "Added in 19.7" -## `worker_exit` +### `worker_exit` **Default:** @@ -751,7 +751,7 @@ Called just after a worker has been exited, in the worker process. The callable needs to accept two instance variables for the Arbiter and the just-exited Worker. -## `nworkers_changed` +### `nworkers_changed` **Default:** @@ -768,7 +768,7 @@ two integers of number of workers after and before change. If the number of workers is set for the first time, *old_value* would be ``None``. -## `on_exit` +### `on_exit` **Default:** @@ -781,7 +781,7 @@ Called just before exiting Gunicorn. The callable needs to accept a single instance variable for the Arbiter. -## `ssl_context` +### `ssl_context` **Default:** @@ -812,9 +812,9 @@ def ssl_context(conf, default_ssl_context_factory): !!! info "Added in 21.0" -# Server Mechanics +## Server Mechanics -## `preload_app` +### `preload_app` **Command line:** `--preload` @@ -827,7 +827,7 @@ speed up server boot times. Although, if you defer application loading to each worker process, you can reload your application code easily by restarting workers. -## `sendfile` +### `sendfile` **Command line:** `--no-sendfile` @@ -847,7 +847,7 @@ to enable or disable its usage. !!! info "Changed in 19.6" added support for the ``SENDFILE`` environment variable -## `reuse_port` +### `reuse_port` **Command line:** `--reuse-port` @@ -857,7 +857,7 @@ Set the ``SO_REUSEPORT`` flag on the listening socket. !!! info "Added in 19.8" -## `chdir` +### `chdir` **Command line:** `--chdir` @@ -867,7 +867,7 @@ Set the ``SO_REUSEPORT`` flag on the listening socket. Change directory to specified directory before loading apps. -## `daemon` +### `daemon` **Command line:** `-D`, `--daemon` @@ -878,7 +878,7 @@ Daemonize the Gunicorn process. Detaches the server from the controlling terminal and enters the background. -## `raw_env` +### `raw_env` **Command line:** `-e ENV`, `--env ENV` @@ -900,7 +900,7 @@ Or in the configuration file: raw_env = ["FOO=1"] ``` -## `pidfile` +### `pidfile` **Command line:** `-p FILE`, `--pid FILE` @@ -910,7 +910,7 @@ A filename to use for the PID file. If not set, no PID file will be written. -## `worker_tmp_dir` +### `worker_tmp_dir` **Command line:** `--worker-tmp-dir DIR` @@ -928,7 +928,7 @@ If not set, the default temporary directory will be used. See [blocking-os-fchmod](#blocking_os_fchmod) for more detailed information and a solution for avoiding this problem. -## `user` +### `user` **Command line:** `-u USER`, `--user USER` @@ -942,7 +942,7 @@ A valid user id (as an integer) or the name of a user that can be retrieved with a call to ``pwd.getpwnam(value)`` or ``None`` to not change the worker process user. -## `group` +### `group` **Command line:** `-g GROUP`, `--group GROUP` @@ -956,7 +956,7 @@ A valid group id (as an integer) or the name of a user that can be retrieved with a call to ``grp.getgrnam(value)`` or ``None`` to not change the worker processes group. -## `umask` +### `umask` **Command line:** `-m INT`, `--umask INT` @@ -971,7 +971,7 @@ with ``int(value, 0)`` (``0`` means Python guesses the base, so values like ``0``, ``0xFF``, ``0022`` are valid for decimal, hex, and octal representations) -## `initgroups` +### `initgroups` **Command line:** `--initgroups` @@ -983,7 +983,7 @@ group id. !!! info "Added in 19.7" -## `tmp_upload_dir` +### `tmp_upload_dir` **Default:** `None` @@ -995,7 +995,7 @@ This path should be writable by the process permissions set for Gunicorn workers. If not specified, Gunicorn will choose a system generated temporary directory. -## `secure_scheme_headers` +### `secure_scheme_headers` **Default:** `{'X-FORWARDED-PROTOCOL': 'ssl', 'X-FORWARDED-PROTO': 'https', 'X-FORWARDED-SSL': 'on'}` @@ -1018,7 +1018,7 @@ when handling HTTPS requests. It is important that your front-end proxy configuration ensures that the headers defined here can not be passed directly from the client. -## `forwarded_allow_ips` +### `forwarded_allow_ips` **Command line:** `--forwarded-allow-ips STRING` @@ -1100,7 +1100,7 @@ variable. If it is not defined, the default is ``"127.0.0.1,::1"``. - ``InvalidSchemeHeaders()`` raised - IP address allowed, but the two secure headers disagreed on if HTTPS was used -## `pythonpath` +### `pythonpath` **Command line:** `--pythonpath STRING` @@ -1111,7 +1111,7 @@ A comma-separated list of directories to add to the Python path. e.g. ``'/home/djangoprojects/myproject,/home/python/mylibrary'``. -## `paste` +### `paste` **Command line:** `--paste STRING`, `--paster STRING` @@ -1124,7 +1124,7 @@ e.g. ``production.ini#admin``. At this time, using alternate server blocks is not supported. Use the command line arguments to control server configuration instead. -## `proxy_protocol` +### `proxy_protocol` **Command line:** `--proxy-protocol` @@ -1146,7 +1146,7 @@ Example for stunnel config:: cert = /etc/ssl/certs/stunnel.pem key = /etc/ssl/certs/stunnel.key -## `proxy_allow_ips` +### `proxy_allow_ips` **Command line:** `--proxy-allow-from` @@ -1163,7 +1163,7 @@ authorized front-ends can access Gunicorn. This option does not affect UNIX socket connections. Connections not associated with an IP address are treated as allowed, unconditionally. -## `protocol` +### `protocol` **Command line:** `--protocol STRING` @@ -1185,7 +1185,7 @@ nginx using the uwsgi_pass directive:: include uwsgi_params; } -## `uwsgi_allow_ips` +### `uwsgi_allow_ips` **Command line:** `--uwsgi-allow-from` @@ -1202,7 +1202,7 @@ access Gunicorn. This option does not affect UNIX socket connections. Connections not associated with an IP address are treated as allowed, unconditionally. -## `raw_paste_global_conf` +### `raw_paste_global_conf` **Command line:** `--paste-global CONF` @@ -1218,7 +1218,7 @@ The variables are passed to the PasteDeploy entrypoint. Example:: !!! info "Added in 19.7" -## `permit_obsolete_folding` +### `permit_obsolete_folding` **Command line:** `--permit-obsolete-folding` @@ -1235,7 +1235,7 @@ change in a future version, or it may be removed altogether. !!! info "Added in 23.0.0" -## `strip_header_spaces` +### `strip_header_spaces` **Command line:** `--strip-header-spaces` @@ -1250,7 +1250,7 @@ Use with care and only if necessary. Deprecated; scheduled for removal in 25.0.0 !!! info "Added in 20.0.1" -## `permit_unconventional_http_method` +### `permit_unconventional_http_method` **Command line:** `--permit-unconventional-http-method` @@ -1272,7 +1272,7 @@ Use with care and only if necessary. Temporary; scheduled for removal in 24.0.0 !!! info "Added in 22.0.0" -## `permit_unconventional_http_version` +### `permit_unconventional_http_version` **Command line:** `--permit-unconventional-http-version` @@ -1289,7 +1289,7 @@ change in a future version, or it may be removed altogether. !!! info "Added in 22.0.0" -## `casefold_http_method` +### `casefold_http_method` **Command line:** `--casefold-http-method` @@ -1305,7 +1305,7 @@ Use with care and only if necessary. Deprecated; scheduled for removal in 24.0.0 !!! info "Added in 22.0.0" -## `forwarder_headers` +### `forwarder_headers` **Command line:** `--forwarder-headers` @@ -1322,7 +1322,7 @@ and ``REMOTE_USER``. It is important that your front-end proxy configuration ensures that the headers defined here can not be passed directly from the client. -## `header_map` +### `header_map` **Command line:** `--header-map` @@ -1349,7 +1349,7 @@ on a proxy in front of Gunicorn. !!! info "Added in 22.0.0" -## `root_path` +### `root_path` **Command line:** `--root-path STRING` @@ -1366,9 +1366,9 @@ this to ``/api``. !!! info "Added in 24.0.0" -# Server Socket +## Server Socket -## `bind` +### `bind` **Command line:** `-b ADDRESS`, `--bind ADDRESS` @@ -1393,7 +1393,7 @@ If the ``PORT`` environment variable is defined, the default is ``['0.0.0.0:$PORT']``. If it is not defined, the default is ``['127.0.0.1:8000']``. -## `backlog` +### `backlog` **Command line:** `--backlog INT` @@ -1408,9 +1408,9 @@ load. Must be a positive integer. Generally set in the 64-2048 range. -# Worker Processes +## Worker Processes -## `workers` +### `workers` **Command line:** `-w INT`, `--workers INT` @@ -1426,7 +1426,7 @@ By default, the value of the ``WEB_CONCURRENCY`` environment variable, which is set by some Platform-as-a-Service providers such as Heroku. If it is not defined, the default is ``1``. -## `worker_class` +### `worker_class` **Command line:** `-k STRING`, `--worker-class STRING` @@ -1456,7 +1456,7 @@ Python path to a subclass of ``gunicorn.workers.base.Worker``. This alternative syntax will load the gevent class: ``gunicorn.workers.ggevent.GeventWorker``. -## `threads` +### `threads` **Command line:** `--threads INT` @@ -1479,7 +1479,7 @@ This setting only affects the Gthread worker type. setting to more than 1, the ``gthread`` worker type will be used instead. -## `worker_connections` +### `worker_connections` **Command line:** `--worker-connections INT` @@ -1489,7 +1489,7 @@ The maximum number of simultaneous clients. This setting only affects the ``gthread``, ``eventlet`` and ``gevent`` worker types. -## `max_requests` +### `max_requests` **Command line:** `--max-requests INT` @@ -1504,7 +1504,7 @@ to help limit the damage of memory leaks. If this is set to zero (the default) then the automatic worker restarts are disabled. -## `max_requests_jitter` +### `max_requests_jitter` **Command line:** `--max-requests-jitter INT` @@ -1518,7 +1518,7 @@ restarts to avoid all workers restarting at the same time. !!! info "Added in 19.2" -## `timeout` +### `timeout` **Command line:** `-t INT`, `--timeout INT` @@ -1535,7 +1535,7 @@ For the non sync workers it just means that the worker process is still communicating and is not tied to the length of time required to handle a single request. -## `graceful_timeout` +### `graceful_timeout` **Command line:** `--graceful-timeout INT` @@ -1547,7 +1547,7 @@ After receiving a restart signal, workers have this much time to finish serving requests. Workers still alive after the timeout (starting from the receipt of the restart signal) are force killed. -## `keepalive` +### `keepalive` **Command line:** `--keep-alive INT` @@ -1564,7 +1564,7 @@ set this to a higher value. ``sync`` worker does not support persistent connections and will ignore this option. -## `asgi_loop` +### `asgi_loop` **Command line:** `--asgi-loop STRING` @@ -1583,7 +1583,7 @@ installing the uvloop package. !!! info "Added in 24.0.0" -## `asgi_lifespan` +### `asgi_lifespan` **Command line:** `--asgi-lifespan STRING` diff --git a/mkdocs.yml b/mkdocs.yml index 955c2079b..3ee153fb6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -60,6 +60,7 @@ theme: - search.highlight - search.suggest - toc.follow + - toc.integrate plugins: - search @@ -95,6 +96,9 @@ extra_css: - styles/overrides.css - assets/stylesheets/home.css +extra_javascript: + - assets/javascripts/toc-collapse.js + extra: social: - icon: fontawesome/brands/github diff --git a/scripts/build_settings_doc.py b/scripts/build_settings_doc.py index eb370f090..75174defb 100644 --- a/scripts/build_settings_doc.py +++ b/scripts/build_settings_doc.py @@ -189,7 +189,7 @@ def _convert_desc(desc: str) -> str: def _format_setting(setting: guncfg.Setting) -> str: - lines: list[str] = [f"## `{setting.name}`", ""] + lines: list[str] = [f"### `{setting.name}`", ""] cli = _format_cli(setting) if cli: @@ -220,7 +220,7 @@ def render_settings() -> str: for setting in known_settings: if setting.section != current_section: current_section = setting.section - sections.append(f"# {current_section}\n") + sections.append(f"## {current_section}\n") sections.append(_format_setting(setting)) return "\n".join(sections).strip() + "\n" From 571bc121d1f75ff45f559b662ad4de1a705097d3 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Thu, 22 Jan 2026 23:32:07 +0100 Subject: [PATCH 044/356] docs: Add punchy theme with vibrant colors and modern features - Brighter green palette (#00a650, #00c853) with teal accent - Dark/light mode toggle with system preference detection - Gradient header, tabs, buttons, and footer - Inter font for text, JetBrains Mono for code - Sticky navigation tabs, auto-hide header - Progress indicator, search sharing, breadcrumbs - Custom scrollbars and selection highlighting - Enhanced code blocks, tables, and admonitions --- docs/content/assets/stylesheets/home.css | 30 +- docs/content/styles/overrides.css | 347 +++++++++++++++++------ mkdocs.yml | 24 ++ 3 files changed, 295 insertions(+), 106 deletions(-) diff --git a/docs/content/assets/stylesheets/home.css b/docs/content/assets/stylesheets/home.css index d6e498549..5f1748ef7 100644 --- a/docs/content/assets/stylesheets/home.css +++ b/docs/content/assets/stylesheets/home.css @@ -4,13 +4,15 @@ ============================================ */ .home { - --accent: #499848; - --accent-hover: #3d8040; - --text: #333; - --text-muted: #666; + --accent: #00a650; + --accent-hover: #00c853; + --accent-dark: #008542; + --teal: #00bfa5; + --text: #1a1a2e; + --text-muted: #555; --bg: #fff; - --bg-alt: #f6f8fa; - --border: #e1e4e8; + --bg-alt: #f8faf8; + --border: #e0e6e0; --code-bg: #0d1117; --max-width: 900px; @@ -25,10 +27,10 @@ [data-md-color-scheme="slate"] .home { --text: #e6e6e6; - --text-muted: #999; - --bg: #1a1a1a; - --bg-alt: #242424; - --border: #333; + --text-muted: #aaa; + --bg: #0d1117; + --bg-alt: #161b22; + --border: #30363d; } /* Remove MkDocs constraints */ @@ -111,12 +113,14 @@ } .btn--primary { - background: var(--accent); + background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%); color: #fff; + box-shadow: 0 4px 12px rgba(0, 166, 80, 0.3); } .btn--primary:hover { - background: var(--accent-hover); + box-shadow: 0 6px 20px rgba(0, 166, 80, 0.4); + transform: translateY(-2px); } .btn--secondary { @@ -171,7 +175,7 @@ } .terminal__prompt { - color: var(--accent); + color: var(--accent-hover); user-select: none; } diff --git a/docs/content/styles/overrides.css b/docs/content/styles/overrides.css index 72ee06748..f4b328e80 100644 --- a/docs/content/styles/overrides.css +++ b/docs/content/styles/overrides.css @@ -1,39 +1,184 @@ +/* Gunicorn Punchy Theme */ :root { - --gunicorn-green: #1d692d; - --gunicorn-green-dark: #14501f; - --gunicorn-green-light: #2a8729; - --gunicorn-cream: #f6f6f1; - --md-primary-fg-color: var(--gunicorn-green-light); - --md-primary-fg-color--light: #3da843; + --gunicorn-green: #00a650; + --gunicorn-green-dark: #008542; + --gunicorn-green-light: #00c853; + --gunicorn-teal: #00bfa5; + --gunicorn-bg: #fafafa; + --gunicorn-card: #ffffff; + + --md-primary-fg-color: var(--gunicorn-green); + --md-primary-fg-color--light: var(--gunicorn-green-light); --md-primary-fg-color--dark: var(--gunicorn-green-dark); - --md-accent-fg-color: var(--gunicorn-green); + --md-accent-fg-color: var(--gunicorn-teal); + --md-typeset-a-color: var(--gunicorn-green); } [data-md-color-scheme="slate"] { - --gunicorn-cream: #1d1f1d; - --md-primary-fg-color: var(--gunicorn-green); - --md-primary-fg-color--light: #3da843; - --md-primary-fg-color--dark: var(--gunicorn-green-dark); - --md-accent-fg-color: var(--gunicorn-green-light); + --gunicorn-bg: #0d1117; + --gunicorn-card: #161b22; + --md-default-bg-color: #0d1117; + --md-default-bg-color--light: #161b22; +} + +/* Header - punchy gradient */ +.md-header { + background: linear-gradient(135deg, var(--gunicorn-green-dark) 0%, var(--gunicorn-green) 100%); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); +} + +.md-tabs { + background: linear-gradient(135deg, var(--gunicorn-green) 0%, var(--gunicorn-green-light) 100%); } +/* Logo bigger */ +.md-header__button.md-logo img, .md-header__button.md-logo svg { - height: 1.8rem; + height: 2rem; +} + +/* Navigation styling */ +.md-nav__link:hover { + color: var(--gunicorn-green); +} + +.md-nav__link--active { + color: var(--gunicorn-green); + font-weight: 600; +} + +/* Code blocks - punchy */ +.md-typeset code { + background: rgba(0, 166, 80, 0.08); + color: var(--gunicorn-green-dark); + border-radius: 4px; +} + +[data-md-color-scheme="slate"] .md-typeset code { + background: rgba(0, 200, 83, 0.12); + color: var(--gunicorn-green-light); +} + +.md-typeset pre { + border-radius: 8px; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); +} + +[data-md-color-scheme="slate"] .md-typeset pre { + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); +} + +/* Admonitions - punchy colors */ +.md-typeset .admonition, +.md-typeset details { + border-radius: 8px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); +} + +.md-typeset .admonition.note, +.md-typeset details.note { + border-color: var(--gunicorn-teal); +} + +.md-typeset .note > .admonition-title, +.md-typeset .note > summary { + background-color: rgba(0, 191, 165, 0.1); +} + +.md-typeset .admonition.tip, +.md-typeset details.tip { + border-color: var(--gunicorn-green); +} + +.md-typeset .tip > .admonition-title, +.md-typeset .tip > summary { + background-color: rgba(0, 166, 80, 0.1); +} + +/* Tables - cleaner */ +.md-typeset table:not([class]) { + border-radius: 8px; + overflow: hidden; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); +} + +.md-typeset table:not([class]) th { + background: var(--gunicorn-green); + color: white; + font-weight: 600; +} + +/* Buttons - punchy */ +.md-typeset .md-button { + border-radius: 8px; + font-weight: 600; + text-transform: none; + letter-spacing: 0; + transition: all 0.2s ease; +} + +.md-typeset .md-button--primary { + background: linear-gradient(135deg, var(--gunicorn-green) 0%, var(--gunicorn-green-light) 100%); + border: none; + box-shadow: 0 4px 12px rgba(0, 166, 80, 0.3); +} + +.md-typeset .md-button--primary:hover { + box-shadow: 0 6px 20px rgba(0, 166, 80, 0.4); + transform: translateY(-2px); +} + +/* Search */ +.md-search__form { + border-radius: 8px; +} + +/* Footer */ +.md-footer { + background: linear-gradient(135deg, var(--gunicorn-green-dark) 0%, #1a1a2e 100%); +} + +.md-footer-meta { + background: rgba(0, 0, 0, 0.2); } -/* Hero Section */ +/* Scrollbar */ +::-webkit-scrollbar { + width: 8px; + height: 8px; +} + +::-webkit-scrollbar-thumb { + background: var(--gunicorn-green); + border-radius: 4px; +} + +::-webkit-scrollbar-thumb:hover { + background: var(--gunicorn-green-light); +} + +/* Selection */ +::selection { + background: rgba(0, 166, 80, 0.3); +} + +/* ================================ + Homepage Specific Styles + ================================ */ + +/* These are for the non-custom template pages */ .md-typeset .hero { margin: 2rem 0 3rem; padding: 3.5rem; - background: linear-gradient(135deg, rgba(29, 105, 45, 0.96), rgba(42, 135, 41, 0.85)); + background: linear-gradient(135deg, var(--gunicorn-green-dark) 0%, var(--gunicorn-green) 50%, var(--gunicorn-teal) 100%); color: #fff; - border-radius: 18px; - box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12); + border-radius: 16px; + box-shadow: 0 20px 60px rgba(0, 166, 80, 0.25); } [data-md-color-scheme="slate"] .md-typeset .hero { - background: linear-gradient(135deg, rgba(20, 80, 31, 0.95), rgba(29, 105, 45, 0.88)); - box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4); + background: linear-gradient(135deg, #0d1117 0%, var(--gunicorn-green-dark) 50%, var(--gunicorn-green) 100%); + box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); } .md-typeset .hero__inner { @@ -53,86 +198,91 @@ .md-typeset .hero__copy h1 { margin: 0 0 1rem; - font-size: 2.4rem; - font-weight: 700; - line-height: 1.2; + font-size: 2.6rem; + font-weight: 800; + line-height: 1.15; + letter-spacing: -0.02em; } .md-typeset .hero__tagline { - font-size: 1.1rem; + font-size: 1.15rem; opacity: 0.95; margin-bottom: 0; } .md-typeset .hero__cta { - margin-top: 1.75rem; + margin-top: 2rem; display: flex; flex-wrap: wrap; - gap: 0.75rem; + gap: 1rem; } .md-typeset .hero__code { flex: 1 1 260px; - max-width: 380px; - background: rgba(255, 255, 255, 0.08); - border-radius: 14px; + max-width: 400px; + background: rgba(0, 0, 0, 0.25); + border-radius: 12px; padding: 1.5rem; - backdrop-filter: blur(4px); - font-size: 0.95rem; -} - -[data-md-color-scheme="slate"] .md-typeset .hero__code { - background: rgba(0, 0, 0, 0.35); + backdrop-filter: blur(8px); + border: 1px solid rgba(255, 255, 255, 0.1); } .md-typeset .hero__code pre { margin: 0 0 1rem; border: none; - background: rgba(0, 0, 0, 0.35); + background: rgba(0, 0, 0, 0.4); color: #e8f5ea; -} - -[data-md-color-scheme="slate"] .md-typeset .hero__code pre { - background: rgba(0, 0, 0, 0.55); + box-shadow: none; } .md-typeset .hero__version { - font-weight: 600; - letter-spacing: 0.01em; + font-weight: 700; font-size: 0.9rem; opacity: 0.9; } .md-typeset .hero__logo { - height: 64px; - margin-bottom: 1.25rem; + height: 72px; + margin-bottom: 1.5rem; + filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2)); } -[data-md-color-scheme="slate"] .md-typeset .hero__logo { - filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.35)); -} - -/* Pillars Section */ +/* Pillars */ .md-typeset .pillars { display: grid; - grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); - gap: 1.5rem; + grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); + gap: 2rem; margin: 3rem 0; } .md-typeset .pillar { text-align: center; - padding: 1.5rem; + padding: 2rem; + background: var(--gunicorn-card); + border-radius: 12px; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06); + transition: transform 0.2s ease, box-shadow 0.2s ease; +} + +[data-md-color-scheme="slate"] .md-typeset .pillar { + background: var(--gunicorn-card); + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); +} + +.md-typeset .pillar:hover { + transform: translateY(-4px); + box-shadow: 0 12px 32px rgba(0, 166, 80, 0.15); } .md-typeset .pillar__icon { - font-size: 2.5rem; - margin-bottom: 0.75rem; + font-size: 3rem; + margin-bottom: 1rem; } .md-typeset .pillar h3 { margin: 0 0 0.5rem; - font-size: 1.25rem; + font-size: 1.3rem; + font-weight: 700; color: var(--gunicorn-green-dark); } @@ -143,10 +293,10 @@ .md-typeset .pillar p { margin: 0; font-size: 0.95rem; - opacity: 0.85; + opacity: 0.8; } -/* Frameworks Section */ +/* Frameworks */ .md-typeset .frameworks { display: flex; flex-wrap: wrap; @@ -156,53 +306,61 @@ } .md-typeset .framework { - background: var(--gunicorn-cream); - border: 1px solid rgba(0, 0, 0, 0.08); - border-radius: 10px; - padding: 0.75rem 1.5rem; + background: var(--gunicorn-card); + border: 2px solid transparent; + border-radius: 50px; + padding: 0.75rem 1.75rem; font-weight: 600; font-size: 0.95rem; color: var(--gunicorn-green-dark); - transition: transform 0.2s ease, box-shadow 0.2s ease; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); + transition: all 0.2s ease; } [data-md-color-scheme="slate"] .md-typeset .framework { - background: rgba(45, 48, 45, 0.9); - border-color: rgba(255, 255, 255, 0.08); + background: var(--gunicorn-card); color: #e8f5ea; } .md-typeset .framework:hover { + border-color: var(--gunicorn-green); transform: translateY(-2px); - box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); + box-shadow: 0 8px 24px rgba(0, 166, 80, 0.2); } /* Feature Grid */ .md-typeset .feature-grid { display: grid; - grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); - gap: 1.6rem; + grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); + gap: 1.5rem; margin: 2.5rem 0 3rem; } .md-typeset .feature-card { - background: var(--gunicorn-cream); - border-radius: 14px; - padding: 1.5rem; - border: 1px solid rgba(0, 0, 0, 0.05); - box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); - transition: transform 0.2s ease, box-shadow 0.2s ease; + background: var(--gunicorn-card); + border-radius: 12px; + padding: 1.75rem; + border: 1px solid rgba(0, 166, 80, 0.1); + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06); + transition: all 0.2s ease; } [data-md-color-scheme="slate"] .md-typeset .feature-card { - background: rgba(45, 48, 45, 0.9); - border: 1px solid rgba(255, 255, 255, 0.05); - box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35); + background: var(--gunicorn-card); + border-color: rgba(0, 200, 83, 0.15); + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); +} + +.md-typeset .feature-card:hover { + transform: translateY(-4px); + border-color: var(--gunicorn-green); + box-shadow: 0 12px 32px rgba(0, 166, 80, 0.15); } .md-typeset .feature-card h3 { margin-top: 0; font-size: 1.2rem; + font-weight: 700; color: var(--gunicorn-green-dark); display: flex; align-items: center; @@ -210,12 +368,13 @@ } [data-md-color-scheme="slate"] .md-typeset .feature-card h3 { - color: #e8f5ea; + color: var(--gunicorn-green-light); } .md-typeset .feature-card p { font-size: 0.95rem; - opacity: 0.85; + opacity: 0.8; + margin-bottom: 1rem; } .md-typeset .feature-card a { @@ -226,9 +385,8 @@ color: var(--gunicorn-green); } -.md-typeset .feature-card:hover { - transform: translateY(-4px); - box-shadow: 0 18px 36px rgba(0, 0, 0, 0.12); +.md-typeset .feature-card a:hover { + color: var(--gunicorn-green-light); } /* Badge */ @@ -237,13 +395,14 @@ font-size: 0.65rem; font-weight: 700; text-transform: uppercase; - padding: 0.2rem 0.5rem; - border-radius: 4px; + padding: 0.2rem 0.6rem; + border-radius: 50px; vertical-align: middle; + letter-spacing: 0.05em; } .md-typeset .badge--new { - background: var(--gunicorn-green); + background: linear-gradient(135deg, var(--gunicorn-green) 0%, var(--gunicorn-teal) 100%); color: #fff; } @@ -257,27 +416,29 @@ .md-typeset .quick-link { display: block; - padding: 1.25rem; - background: var(--gunicorn-cream); + padding: 1.5rem; + background: var(--gunicorn-card); border-radius: 12px; - border: 1px solid rgba(0, 0, 0, 0.05); + border: 2px solid transparent; text-decoration: none; - transition: transform 0.2s ease, box-shadow 0.2s ease; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); + transition: all 0.2s ease; } [data-md-color-scheme="slate"] .md-typeset .quick-link { - background: rgba(45, 48, 45, 0.9); - border-color: rgba(255, 255, 255, 0.05); + background: var(--gunicorn-card); } .md-typeset .quick-link:hover { + border-color: var(--gunicorn-green); transform: translateY(-2px); - box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); + box-shadow: 0 8px 24px rgba(0, 166, 80, 0.15); } .md-typeset .quick-link strong { display: block; font-size: 1.1rem; + font-weight: 700; color: var(--gunicorn-green-dark); margin-bottom: 0.25rem; } @@ -288,7 +449,7 @@ .md-typeset .quick-link span { font-size: 0.9rem; - opacity: 0.75; + opacity: 0.7; } /* Community Links */ @@ -314,7 +475,7 @@ /* Responsive */ @media (max-width: 960px) { .md-typeset .hero { - padding: 2.25rem; + padding: 2.5rem; } .md-typeset .hero__copy h1 { @@ -325,7 +486,7 @@ @media (max-width: 720px) { .md-typeset .hero { margin-top: 1.5rem; - padding: 1.75rem; + padding: 2rem; } .md-typeset .hero__cta { diff --git a/mkdocs.yml b/mkdocs.yml index 3ee153fb6..abe6ea3ec 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -50,17 +50,41 @@ theme: language: en logo: assets/gunicorn.svg favicon: assets/gunicorn.svg + palette: + - media: "(prefers-color-scheme: light)" + scheme: default + primary: green + accent: teal + toggle: + icon: material/brightness-7 + name: Switch to dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + primary: green + accent: teal + toggle: + icon: material/brightness-4 + name: Switch to light mode + font: + text: Inter + code: JetBrains Mono features: - content.code.copy + - content.code.annotate - navigation.instant + - navigation.instant.progress - navigation.tracking - navigation.sections - navigation.tabs + - navigation.tabs.sticky - navigation.top + - navigation.path - search.highlight - search.suggest + - search.share - toc.follow - toc.integrate + - header.autohide plugins: - search From c959daeb82dc5b5eafa463b5fb96857935dc9da0 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 00:00:17 +0100 Subject: [PATCH 045/356] docs: Redesign architecture page with visual components Add tabbed worker types, comparison table, decision guide admonitions, and scaling callouts. Rename master to arbiter throughout. --- docs/content/design.md | 228 +++++++++++++++++++++++++++++++---------- 1 file changed, 174 insertions(+), 54 deletions(-) diff --git a/docs/content/design.md b/docs/content/design.md index eda92ebb5..922cb5b09 100644 --- a/docs/content/design.md +++ b/docs/content/design.md @@ -3,81 +3,201 @@ A brief look at Gunicorn's architecture. -## Server model +## Server Model -Gunicorn uses a pre-fork worker model: a master process manages worker -processes, while the workers handle requests and responses. The master never +Gunicorn uses a **pre-fork worker model**: an arbiter process manages worker +processes, while the workers handle requests and responses. The arbiter never touches individual client sockets. -### Master +
-The master process listens for signals (TTIN, TTOU, CHLD, etc.) and adjusts the -worker pool accordingly. `TTIN`/`TTOU` change the number of workers; `CHLD` -indicates a worker exited and must be restarted. +
+
⚖️
-### Sync workers +### Arbiter -The default `sync` worker handles one request at a time. Errors affect only the -current request. Because connections close after each response, persistent -connections are not supported even if you set `Keep-Alive` headers manually. +Orchestrates the worker pool. Listens for signals (`TTIN`, `TTOU`, `CHLD`, +`HUP`) to adjust workers, restart them on failure, or reload configuration. +
-### Async workers +
+
⚙️
-Async workers are powered by [greenlets](https://github.com/python-greenlet/greenlet) -through [Eventlet](http://eventlet.net/) or [Gevent](http://www.gevent.org/). -Most apps work without modification, though full compatibility may require -patches (for example installing [`psycogreen`](https://github.com/psycopg/psycogreen/) -when using [Psycopg](http://initd.org/psycopg/)). Some apps that depend on the -original blocking behaviour may not be compatible. +### Worker Pool -### Gthread workers +Each worker handles requests independently. Worker types determine +concurrency model: sync, threaded, or async via greenlets/asyncio. +
-`gthread` is a threaded worker. The main loop accepts connections and places -them in a thread pool. Keep-alive connections return to the pool to await -further events; idle connections close after the keepalive timeout. +
+
📡
-### Tornado workers +### Signal Communication -A Tornado worker class exists for Tornado-based applications. While it can -serve WSGI apps, this configuration is not recommended. +`TTIN`/`TTOU` adjust worker count. `CHLD` triggers restart of crashed +workers. `HUP` reloads configuration. See [Signals](signals.md). +
- -### AsyncIO workers +
+ +## Worker Types + +Choose a worker type based on your application's needs. + +=== "Sync" + + The **default** worker. Handles one request at a time per worker. + + - Simple and predictable + - Errors affect only the current request + - No keep-alive support (connections close after response) + - Requires a buffering proxy (nginx, HAProxy) for production + + ```bash + gunicorn myapp:app + ``` + +=== "Gthread" + + Threaded worker with a **thread pool** per worker process. + + - Supports keep-alive connections + - Good balance of concurrency and simplicity + - Threads share memory (lower footprint than workers) + - Idle connections close after keepalive timeout + + ```bash + gunicorn myapp:app -k gthread --threads 4 + ``` + +=== "Gevent" + + **Greenlet-based** async worker using [Gevent](http://www.gevent.org/). + + - Handles thousands of concurrent connections + - Supports keep-alive, WebSockets, long-polling + - May require patches for some libraries (e.g., `psycogreen` for Psycopg) + - Not compatible with code that relies on blocking behavior + + ```bash + gunicorn myapp:app -k gevent --worker-connections 1000 + ``` + +=== "Eventlet" + + **Greenlet-based** async worker using [Eventlet](http://eventlet.net/). + + - Similar capabilities to Gevent + - Handles high concurrency for I/O-bound apps + - Some libraries may need compatibility patches + + ```bash + gunicorn myapp:app -k eventlet --worker-connections 1000 + ``` + +=== "ASGI" + + Native **asyncio** support for modern async frameworks. + + - For FastAPI, Starlette, Quart, and other ASGI apps + - Full async/await support + - See the [ASGI Guide](asgi.md) for details + + ```bash + gunicorn myapp:app -k uvicorn.workers.UvicornWorker + ``` -Use third-party workers to pair Gunicorn with asyncio frameworks (see the -[aiohttp deployment guide](https://docs.aiohttp.org/en/stable/deployment.html#nginx-gunicorn) -or the [Flask aiohttp example](https://github.com/benoitc/gunicorn/blob/master/examples/frameworks/flaskapp_aiohttp_wsgi.py)). +## Comparison -## Choosing a worker type +| Worker | Concurrency Model | Keep-Alive | Best For | +|--------|-------------------|------------|----------| +| `sync` | 1 request/worker | ❌ | CPU-bound apps behind a proxy | +| `gthread` | Thread pool | ✅ | Mixed workloads, moderate concurrency | +| `gevent` | Greenlets | ✅ | I/O-bound, WebSockets, streaming | +| `eventlet` | Greenlets | ✅ | I/O-bound, long-polling | +| ASGI workers | AsyncIO | ✅ | Modern async frameworks (FastAPI, etc.) | -Synchronous workers assume your app is CPU/network bound and avoids indefinite -operations. Any outbound HTTP calls or other blocking behaviour benefit from an -async worker. Because synchronous workers are vulnerable to slow clients, -Gunicorn requires a buffering proxy in front of the default configuration. Tools -like [Hey](https://github.com/rakyll/hey) can simulate slow responses to test -this scenario. +!!! tip "Quick Decision Guide" -Examples that need async workers: + - **Simple app behind nginx?** → `sync` (default) + - **Need keep-alive or moderate concurrency?** → `gthread` + - **WebSockets, streaming, long-polling?** → `gevent` or `eventlet` + - **FastAPI, Starlette, or async framework?** → ASGI worker -- Long blocking calls (outbound web services) -- Direct internet traffic (no buffering proxy) +## When to Use Async Workers + +Synchronous workers assume your app is CPU or network bound and avoids +indefinite blocking operations. Use async workers when you have: + +- Long blocking calls (external APIs, slow databases) +- Direct internet traffic without a buffering proxy - Streaming request/response bodies -- Long polling -- WebSockets / Comet +- Long polling or Comet patterns +- WebSockets + +!!! info "Testing Slow Clients" + + Tools like [Hey](https://github.com/rakyll/hey) can simulate slow responses + to test how your configuration handles them. + +## Scaling + +### How Many Workers? + +!!! warning "Don't Over-Scale" + + Workers ≠ clients. Gunicorn typically needs only **4–12 workers** to handle + heavy traffic. Too many workers waste resources and can reduce throughput. + +Start with this formula and adjust under load: + +``` +workers = (2 × CPU cores) + 1 +``` + +Use `TTIN`/`TTOU` signals to adjust the worker count at runtime. -## How many workers? +### How Many Threads? -Do **not** scale workers to match client count. Gunicorn usually needs only 4–12 -workers to handle heavy traffic. Start with `(2 * num_cores) + 1` and adjust -under load using `TTIN`/`TTOU`. +With the `gthread` worker, you can combine workers and threads: -Too many workers waste resources and can reduce throughput. +```bash +gunicorn myapp:app -k gthread --workers 4 --threads 2 +``` + +!!! info "Threads vs Workers" + + - **Threads** share memory → lower footprint + - **Workers** isolate failures → better fault tolerance + - Combine both for the best of both worlds + +Threads can extend request time beyond the worker timeout while still +notifying the arbiter. The optimal mix depends on your runtime (CPython vs +PyPy) and workload. + +## Configuration Examples + +```bash +# Sync (default) - simple apps behind nginx +gunicorn myapp:app + +# Gthread - keep-alive and thread concurrency +gunicorn myapp:app -k gthread --workers 4 --threads 4 + +# Gevent - high concurrency for I/O-bound apps +gunicorn myapp:app -k gevent --workers 4 --worker-connections 1000 + +# Eventlet - alternative async worker +gunicorn myapp:app -k eventlet --workers 4 --worker-connections 1000 + +# ASGI - FastAPI/Starlette with Uvicorn worker +gunicorn myapp:app -k uvicorn.workers.UvicornWorker --workers 4 +``` + + -## How many threads? +!!! note "Third-Party AsyncIO Workers" -Since Gunicorn 19 you can set `--threads` (with the `gthread` worker) to process -requests concurrently. Threads can extend request time beyond the worker -timeout while still notifying the master. The optimal mix of threads and worker -processes depends on the runtime (for example CPython vs. Jython). Threads share -memory, lowering footprint, and still allow reloads because application code is -loaded in worker processes. + For asyncio frameworks, you can also use third-party workers. See the + [aiohttp deployment guide](https://docs.aiohttp.org/en/stable/deployment.html#nginx-gunicorn) + for examples. From c6b115948315108780c851f78ca643f373c4939f Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 00:03:07 +0100 Subject: [PATCH 046/356] docs: Add Tornado worker to design page --- docs/content/design.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/content/design.md b/docs/content/design.md index 922cb5b09..4f6c03c46 100644 --- a/docs/content/design.md +++ b/docs/content/design.md @@ -95,6 +95,18 @@ Choose a worker type based on your application's needs. gunicorn myapp:app -k eventlet --worker-connections 1000 ``` +=== "Tornado" + + Worker for [Tornado](https://www.tornadoweb.org/) applications. + + - Designed for Tornado's async framework + - Can serve WSGI apps, but not recommended for that use case + - Use when running native Tornado applications + + ```bash + gunicorn myapp:app -k tornado + ``` + === "ASGI" Native **asyncio** support for modern async frameworks. @@ -115,6 +127,7 @@ Choose a worker type based on your application's needs. | `gthread` | Thread pool | ✅ | Mixed workloads, moderate concurrency | | `gevent` | Greenlets | ✅ | I/O-bound, WebSockets, streaming | | `eventlet` | Greenlets | ✅ | I/O-bound, long-polling | +| `tornado` | Tornado IOLoop | ✅ | Native Tornado applications | | ASGI workers | AsyncIO | ✅ | Modern async frameworks (FastAPI, etc.) | !!! tip "Quick Decision Guide" From 066e6d8bb307acdbe70fb7f0902feb03bacb6c95 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 00:05:21 +0100 Subject: [PATCH 047/356] docs: Move ASGI worker tab after Gthread --- docs/content/design.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/content/design.md b/docs/content/design.md index 4f6c03c46..ec2cce27c 100644 --- a/docs/content/design.md +++ b/docs/content/design.md @@ -70,6 +70,18 @@ Choose a worker type based on your application's needs. gunicorn myapp:app -k gthread --threads 4 ``` +=== "ASGI" + + Native **asyncio** support for modern async frameworks. + + - For FastAPI, Starlette, Quart, and other ASGI apps + - Full async/await support + - See the [ASGI Guide](asgi.md) for details + + ```bash + gunicorn myapp:app -k uvicorn.workers.UvicornWorker + ``` + === "Gevent" **Greenlet-based** async worker using [Gevent](http://www.gevent.org/). @@ -107,28 +119,16 @@ Choose a worker type based on your application's needs. gunicorn myapp:app -k tornado ``` -=== "ASGI" - - Native **asyncio** support for modern async frameworks. - - - For FastAPI, Starlette, Quart, and other ASGI apps - - Full async/await support - - See the [ASGI Guide](asgi.md) for details - - ```bash - gunicorn myapp:app -k uvicorn.workers.UvicornWorker - ``` - ## Comparison | Worker | Concurrency Model | Keep-Alive | Best For | |--------|-------------------|------------|----------| | `sync` | 1 request/worker | ❌ | CPU-bound apps behind a proxy | | `gthread` | Thread pool | ✅ | Mixed workloads, moderate concurrency | +| ASGI workers | AsyncIO | ✅ | Modern async frameworks (FastAPI, etc.) | | `gevent` | Greenlets | ✅ | I/O-bound, WebSockets, streaming | | `eventlet` | Greenlets | ✅ | I/O-bound, long-polling | | `tornado` | Tornado IOLoop | ✅ | Native Tornado applications | -| ASGI workers | AsyncIO | ✅ | Modern async frameworks (FastAPI, etc.) | !!! tip "Quick Decision Guide" From d34d3de01ba9e618b47849fed1c2db740737dd66 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 01:12:00 +0100 Subject: [PATCH 048/356] docs: Set release date for 24.0.0 --- docs/content/2026-news.md | 2 +- docs/content/news.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/2026-news.md b/docs/content/2026-news.md index 8a935dba7..55f6a1811 100644 --- a/docs/content/2026-news.md +++ b/docs/content/2026-news.md @@ -1,7 +1,7 @@ # Changelog - 2026 -## 24.0.0 - 2026-XX-XX +## 24.0.0 - 2026-01-23 ### New Features diff --git a/docs/content/news.md b/docs/content/news.md index 59e27c0a0..7a855fa2f 100644 --- a/docs/content/news.md +++ b/docs/content/news.md @@ -1,7 +1,7 @@ # Changelog -## 24.0.0 - 2026-XX-XX +## 24.0.0 - 2026-01-23 ### New Features From e021e3e93fe17b8b78872dc4c6086cc885694e83 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 01:39:23 +0100 Subject: [PATCH 049/356] docs: Update 24.0.0 changelog with security fixes --- docs/content/2026-news.md | 20 +++++++++++++++----- docs/content/news.md | 6 ++++-- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/docs/content/2026-news.md b/docs/content/2026-news.md index 55f6a1811..2c9bd8d66 100644 --- a/docs/content/2026-news.md +++ b/docs/content/2026-news.md @@ -23,14 +23,24 @@ with Material theme for improved navigation and mobile experience ([PR #3426](https://github.com/benoitc/gunicorn/pull/3426)) -### Changes +### Security -- Minimum Python version is now 3.12 -- Documentation now hosted at https://gunicorn.org +- **eventlet**: Require eventlet >= 0.40.3 to address CVE-2021-21419 (websocket + memory exhaustion) and CVE-2025-58068 (HTTP request smuggling) + ([PR #3445](https://github.com/benoitc/gunicorn/pull/3445)) + +- **gevent**: Require gevent >= 24.10.1 to address CVE-2023-41419 (HTTP request + smuggling) and CVE-2024-3219 (socket.socketpair vulnerability) + ([PR #3445](https://github.com/benoitc/gunicorn/pull/3445)) -### Breaking changes +- **tornado**: Require tornado >= 6.5.0 to address CVE-2025-47287 (HTTP request + smuggling) and other security fixes + ([PR #3445](https://github.com/benoitc/gunicorn/pull/3445)) -- Dropped support for Python versions before 3.12 +### Changes + +- Documentation now hosted at https://gunicorn.org +- Updated license configuration to PEP 639 format for uv compatibility !!! warning "ASGI Worker Beta" The ASGI worker is a beta feature. While tested, the API and behavior diff --git a/docs/content/news.md b/docs/content/news.md index 7a855fa2f..11d0e34cb 100644 --- a/docs/content/news.md +++ b/docs/content/news.md @@ -17,9 +17,11 @@ - **Documentation Migration**: Migrated to MkDocs with Material theme -### Breaking changes +### Security -- Minimum Python version is now 3.12 +- **eventlet**: Require eventlet >= 0.40.3 (CVE-2021-21419, CVE-2025-58068) +- **gevent**: Require gevent >= 24.10.1 (CVE-2023-41419, CVE-2024-3219) +- **tornado**: Require tornado >= 6.5.0 (CVE-2025-47287) --- From 6a46d66a56cf0919fcd2e947271a4201720999cc Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 02:13:34 +0100 Subject: [PATCH 050/356] github: Add discussions-first triage workflow Redirect issue creation to GitHub Discussions for proper triage: - Disable blank issues, redirect to discussion categories - Add structured discussion templates for bugs, features, questions - Add preapproved issue template for maintainer use only - Update CONTRIBUTING.md to reflect new workflow --- .github/DISCUSSION_TEMPLATE/bug-report.yml | 120 ++++++++++++++++++ .../DISCUSSION_TEMPLATE/feature-request.yml | 74 +++++++++++ .github/DISCUSSION_TEMPLATE/question.yml | 50 ++++++++ .github/ISSUE_TEMPLATE/config.yml | 11 ++ .github/ISSUE_TEMPLATE/preapproved.md | 16 +++ CONTRIBUTING.md | 24 ++-- 6 files changed, 282 insertions(+), 13 deletions(-) create mode 100644 .github/DISCUSSION_TEMPLATE/bug-report.yml create mode 100644 .github/DISCUSSION_TEMPLATE/feature-request.yml create mode 100644 .github/DISCUSSION_TEMPLATE/question.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/preapproved.md diff --git a/.github/DISCUSSION_TEMPLATE/bug-report.yml b/.github/DISCUSSION_TEMPLATE/bug-report.yml new file mode 100644 index 000000000..4a178f120 --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/bug-report.yml @@ -0,0 +1,120 @@ +title: "[Bug] " +labels: + - bug + - triage +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to report a bug! + + Before submitting, please: + - Search [existing discussions](https://github.com/benoitc/gunicorn/discussions) and [issues](https://github.com/benoitc/gunicorn/issues) for duplicates + - Check the [FAQ](https://docs.gunicorn.org/en/latest/faq.html) and [documentation](https://docs.gunicorn.org/) + + - type: textarea + id: description + attributes: + label: Bug Description + description: A clear description of what the bug is + placeholder: What happened? What did you expect to happen? + validations: + required: true + + - type: textarea + id: reproduce + attributes: + label: Steps to Reproduce + description: Minimal steps to reproduce the behavior + placeholder: | + 1. Create a simple app with... + 2. Run gunicorn with... + 3. Send request... + 4. See error... + validations: + required: true + + - type: textarea + id: config + attributes: + label: Configuration + description: Your gunicorn configuration (command line or config file) + render: bash + placeholder: | + gunicorn --workers 4 --bind 0.0.0.0:8000 myapp:app + + # Or config file contents + validations: + required: true + + - type: textarea + id: logs + attributes: + label: Logs / Error Output + description: Relevant logs or error messages (use --log-level debug for more detail) + render: text + validations: + required: false + + - type: input + id: gunicorn-version + attributes: + label: Gunicorn Version + description: Output of `gunicorn --version` + placeholder: gunicorn 24.0.0 + validations: + required: true + + - type: input + id: python-version + attributes: + label: Python Version + description: Output of `python --version` + placeholder: Python 3.12.0 + validations: + required: true + + - type: dropdown + id: worker-class + attributes: + label: Worker Class + description: Which worker type are you using? + options: + - sync (default) + - gthread + - gevent + - eventlet + - tornado + - asgi (beta) + - custom + validations: + required: true + + - type: input + id: os + attributes: + label: Operating System + description: Your OS and version + placeholder: Ubuntu 22.04, macOS 14.0, etc. + validations: + required: true + + - type: textarea + id: additional + attributes: + label: Additional Context + description: Any other context about the problem (proxy setup, Docker, etc.) + validations: + required: false + + - type: checkboxes + id: checklist + attributes: + label: Checklist + options: + - label: I have searched existing discussions and issues for duplicates + required: true + - label: I have checked the documentation and FAQ + required: true + - label: I have included the minimal configuration to reproduce this issue + required: true diff --git a/.github/DISCUSSION_TEMPLATE/feature-request.yml b/.github/DISCUSSION_TEMPLATE/feature-request.yml new file mode 100644 index 000000000..56f711ab2 --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/feature-request.yml @@ -0,0 +1,74 @@ +title: "[Feature] " +labels: + - enhancement +body: + - type: markdown + attributes: + value: | + Thanks for suggesting a feature! + + Before submitting, please: + - Search [existing discussions](https://github.com/benoitc/gunicorn/discussions) and [issues](https://github.com/benoitc/gunicorn/issues) for similar requests + - Check if this is already possible with existing configuration + + - type: textarea + id: problem + attributes: + label: Problem Statement + description: What problem does this feature solve? What's the use case? + placeholder: I'm trying to... but currently... + validations: + required: true + + - type: textarea + id: solution + attributes: + label: Proposed Solution + description: How would you like this to work? + placeholder: | + I'd like a new setting `--my-option` that... + + Example usage: + gunicorn --my-option value myapp:app + validations: + required: true + + - type: textarea + id: alternatives + attributes: + label: Alternatives Considered + description: What other solutions have you considered or tried? + validations: + required: false + + - type: dropdown + id: scope + attributes: + label: Feature Scope + description: What area does this feature affect? + options: + - Configuration / Settings + - Worker behavior + - HTTP handling + - Logging / Instrumentation + - Signals / Process management + - Documentation + - Other + validations: + required: true + + - type: checkboxes + id: contribution + attributes: + label: Contribution + options: + - label: I would be willing to contribute a PR for this feature + required: false + + - type: checkboxes + id: checklist + attributes: + label: Checklist + options: + - label: I have searched existing discussions and issues for similar requests + required: true diff --git a/.github/DISCUSSION_TEMPLATE/question.yml b/.github/DISCUSSION_TEMPLATE/question.yml new file mode 100644 index 000000000..2e3436324 --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/question.yml @@ -0,0 +1,50 @@ +title: "[Question] " +body: + - type: markdown + attributes: + value: | + Have a question about Gunicorn? + + Before asking, please check: + - [Documentation](https://docs.gunicorn.org/) + - [FAQ](https://docs.gunicorn.org/en/latest/faq.html) + - [Settings Reference](https://docs.gunicorn.org/en/latest/settings.html) + - [Existing discussions](https://github.com/benoitc/gunicorn/discussions) + + - type: textarea + id: question + attributes: + label: Question + description: What would you like to know? + validations: + required: true + + - type: textarea + id: context + attributes: + label: Context + description: Any relevant context (your setup, what you've tried, etc.) + placeholder: | + I'm running gunicorn with... + I've tried... + validations: + required: false + + - type: textarea + id: config + attributes: + label: Configuration (if relevant) + description: Your gunicorn configuration + render: bash + validations: + required: false + + - type: checkboxes + id: checklist + attributes: + label: Checklist + options: + - label: I have checked the documentation and FAQ + required: true + - label: I have searched existing discussions + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..2401ed30d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: false +contact_links: + - name: Bug Report + url: https://github.com/benoitc/gunicorn/discussions/new?category=q-a + about: Report a bug or unexpected behavior (starts as a discussion for triage) + - name: Feature Request + url: https://github.com/benoitc/gunicorn/discussions/new?category=ideas + about: Suggest a new feature or improvement + - name: Question + url: https://github.com/benoitc/gunicorn/discussions/new?category=q-a + about: Ask a question about configuration, deployment, or usage diff --git a/.github/ISSUE_TEMPLATE/preapproved.md b/.github/ISSUE_TEMPLATE/preapproved.md new file mode 100644 index 000000000..ec428a7eb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/preapproved.md @@ -0,0 +1,16 @@ +--- +name: Pre-Discussed and Approved Topics +about: Only for topics already discussed and approved in GitHub Discussions +title: '' +labels: '' +assignees: '' +--- + +**Only for topics already discussed and approved in the GitHub Discussions section.** + +DO NOT OPEN A NEW ISSUE. PLEASE USE THE DISCUSSIONS SECTION. + +Link to approved discussion: + +--- + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0ef79de3d..a73295957 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,24 +21,22 @@ to do everything for everybody. This means that we might decide against incorporating a new feature. However, there might be a way to implement that feature *on top of* Gunicorn. -### Discuss your design on the mailing list +### Start with a Discussion -We recommend discussing your plans [on the mailing -list](http://gunicorn.org/#community) before starting to code - -especially for more ambitious contributions. This gives other -contributors a chance to point you in the right direction, give feedback -on your design, and maybe point out if someone else is working on the -same thing. +We use [GitHub Discussions](https://github.com/benoitc/gunicorn/discussions) +as the starting point for all bug reports, feature requests, and questions. +This allows for proper triage before creating formal issues. -### Create issues... +- **Bug reports**: Start in [Q&A](https://github.com/benoitc/gunicorn/discussions/categories/q-a) +- **Feature requests**: Start in [Ideas](https://github.com/benoitc/gunicorn/discussions/categories/ideas) +- **Questions**: Start in [Q&A](https://github.com/benoitc/gunicorn/discussions/categories/q-a) -Any significant improvement should be documented as [a github -issue](https://github.com/benoitc/gunicorn/issues) before anybody starts -working on it. +After discussion and triage, maintainers will create issues for confirmed +bugs and approved features. -### ...but check for existing issues first! +### Check for existing discussions first! -Please take a moment to check that an issue doesn't already exist +Please take a moment to check that a discussion or issue doesn't already exist documenting your bug report or improvement proposal. If it does, it never hurts to add a quick "+1" or "I have this problem too". This will help prioritize the most common problems and requests. From cae2ef4fe42b5736b518d7d905fb65372364e013 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 02:23:31 +0100 Subject: [PATCH 051/356] github: Consolidate triage into single Issue Triage category --- .../DISCUSSION_TEMPLATE/feature-request.yml | 74 ------------------- .../{bug-report.yml => issue-triage.yml} | 41 ++++++---- .github/ISSUE_TEMPLATE/config.yml | 9 +-- 3 files changed, 29 insertions(+), 95 deletions(-) delete mode 100644 .github/DISCUSSION_TEMPLATE/feature-request.yml rename .github/DISCUSSION_TEMPLATE/{bug-report.yml => issue-triage.yml} (76%) diff --git a/.github/DISCUSSION_TEMPLATE/feature-request.yml b/.github/DISCUSSION_TEMPLATE/feature-request.yml deleted file mode 100644 index 56f711ab2..000000000 --- a/.github/DISCUSSION_TEMPLATE/feature-request.yml +++ /dev/null @@ -1,74 +0,0 @@ -title: "[Feature] " -labels: - - enhancement -body: - - type: markdown - attributes: - value: | - Thanks for suggesting a feature! - - Before submitting, please: - - Search [existing discussions](https://github.com/benoitc/gunicorn/discussions) and [issues](https://github.com/benoitc/gunicorn/issues) for similar requests - - Check if this is already possible with existing configuration - - - type: textarea - id: problem - attributes: - label: Problem Statement - description: What problem does this feature solve? What's the use case? - placeholder: I'm trying to... but currently... - validations: - required: true - - - type: textarea - id: solution - attributes: - label: Proposed Solution - description: How would you like this to work? - placeholder: | - I'd like a new setting `--my-option` that... - - Example usage: - gunicorn --my-option value myapp:app - validations: - required: true - - - type: textarea - id: alternatives - attributes: - label: Alternatives Considered - description: What other solutions have you considered or tried? - validations: - required: false - - - type: dropdown - id: scope - attributes: - label: Feature Scope - description: What area does this feature affect? - options: - - Configuration / Settings - - Worker behavior - - HTTP handling - - Logging / Instrumentation - - Signals / Process management - - Documentation - - Other - validations: - required: true - - - type: checkboxes - id: contribution - attributes: - label: Contribution - options: - - label: I would be willing to contribute a PR for this feature - required: false - - - type: checkboxes - id: checklist - attributes: - label: Checklist - options: - - label: I have searched existing discussions and issues for similar requests - required: true diff --git a/.github/DISCUSSION_TEMPLATE/bug-report.yml b/.github/DISCUSSION_TEMPLATE/issue-triage.yml similarity index 76% rename from .github/DISCUSSION_TEMPLATE/bug-report.yml rename to .github/DISCUSSION_TEMPLATE/issue-triage.yml index 4a178f120..aad41527e 100644 --- a/.github/DISCUSSION_TEMPLATE/bug-report.yml +++ b/.github/DISCUSSION_TEMPLATE/issue-triage.yml @@ -1,30 +1,44 @@ -title: "[Bug] " +title: "[Triage] " labels: - - bug - triage body: - type: markdown attributes: value: | - Thanks for taking the time to report a bug! + Thanks for taking the time to report an issue or suggest a feature! - Before submitting, please: + **Before submitting, please:** - Search [existing discussions](https://github.com/benoitc/gunicorn/discussions) and [issues](https://github.com/benoitc/gunicorn/issues) for duplicates - Check the [FAQ](https://docs.gunicorn.org/en/latest/faq.html) and [documentation](https://docs.gunicorn.org/) + - type: dropdown + id: type + attributes: + label: Type + description: What type of issue is this? + options: + - Bug Report + - Feature Request + - Performance Issue + - Documentation Issue + validations: + required: true + - type: textarea id: description attributes: - label: Bug Description - description: A clear description of what the bug is - placeholder: What happened? What did you expect to happen? + label: Description + description: A clear description of the issue or feature request + placeholder: | + For bugs: What happened? What did you expect? + For features: What problem does this solve? validations: required: true - type: textarea id: reproduce attributes: - label: Steps to Reproduce + label: Steps to Reproduce (for bugs) description: Minimal steps to reproduce the behavior placeholder: | 1. Create a simple app with... @@ -32,7 +46,7 @@ body: 3. Send request... 4. See error... validations: - required: true + required: false - type: textarea id: config @@ -42,10 +56,8 @@ body: render: bash placeholder: | gunicorn --workers 4 --bind 0.0.0.0:8000 myapp:app - - # Or config file contents validations: - required: true + required: false - type: textarea id: logs @@ -87,6 +99,7 @@ body: - tornado - asgi (beta) - custom + - N/A (feature request) validations: required: true @@ -103,7 +116,7 @@ body: id: additional attributes: label: Additional Context - description: Any other context about the problem (proxy setup, Docker, etc.) + description: Any other context (proxy setup, Docker, proposed solution, etc.) validations: required: false @@ -116,5 +129,3 @@ body: required: true - label: I have checked the documentation and FAQ required: true - - label: I have included the minimal configuration to reproduce this issue - required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 2401ed30d..496851e08 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,11 +1,8 @@ blank_issues_enabled: false contact_links: - - name: Bug Report - url: https://github.com/benoitc/gunicorn/discussions/new?category=q-a - about: Report a bug or unexpected behavior (starts as a discussion for triage) - - name: Feature Request - url: https://github.com/benoitc/gunicorn/discussions/new?category=ideas - about: Suggest a new feature or improvement + - name: Bug Report / Feature Request + url: https://github.com/benoitc/gunicorn/discussions/new?category=issue-triage + about: Report a bug or request a feature (triaged before becoming an issue) - name: Question url: https://github.com/benoitc/gunicorn/discussions/new?category=q-a about: Ask a question about configuration, deployment, or usage From 47b9a1861993748920a97495b9faf7f7374d8777 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 09:38:41 +0100 Subject: [PATCH 052/356] fix: handle SSLWantReadError in finish_body() (#3448) The finish_body() function can raise ssl.SSLWantReadError when discarding unread request body data on SSL connections. This causes TLS requests to fail intermittently with "Invalid request" errors. Handle SSLWantReadError by treating it as "no more data to read". This is safe because finish_body() only discards leftover data before keepalive - if SSL says "need to wait for more data", there's nothing left to discard. Fixes #3448 --- gunicorn/http/parser.py | 10 +++- tests/test_gthread.py | 115 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+), 2 deletions(-) diff --git a/gunicorn/http/parser.py b/gunicorn/http/parser.py index 05ee6ca66..5b2da1150 100644 --- a/gunicorn/http/parser.py +++ b/gunicorn/http/parser.py @@ -2,6 +2,8 @@ # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. +import ssl + from gunicorn.http.message import Request from gunicorn.http.unreader import SocketUnreader, IterUnreader @@ -33,9 +35,13 @@ def finish_body(self): leftover body bytes. """ if self.mesg: - data = self.mesg.body.read(8192) - while data: + try: data = self.mesg.body.read(8192) + while data: + data = self.mesg.body.read(8192) + except ssl.SSLWantReadError: + # SSL socket has no more application data available + pass def __next__(self): # Stop if HTTP dictates a stop. diff --git a/tests/test_gthread.py b/tests/test_gthread.py index b8dbea149..71101a8df 100644 --- a/tests/test_gthread.py +++ b/tests/test_gthread.py @@ -1282,3 +1282,118 @@ def test_connections_tracked_during_signal(self): assert worker.alive is False # But shutting down worker.method_queue.close() + + +class TestFinishBodySSL: + """Tests for SSL error handling in finish_body().""" + + def test_finish_body_handles_ssl_want_read_error(self): + """Test that finish_body() handles SSLWantReadError gracefully. + + When discarding unread body data on SSL connections, the socket + may raise SSLWantReadError if there's no application data available. + This should be treated as "no more data" rather than an error. + """ + import ssl + from gunicorn.http.parser import RequestParser + + # Create a mock SSL socket that raises SSLWantReadError on recv + class MockSSLSocket: + def __init__(self): + self._fileno = 123 + + def fileno(self): + return self._fileno + + def recv(self, size): + raise ssl.SSLWantReadError("The operation did not complete") + + def setblocking(self, blocking): + pass + + cfg = Config() + sock = MockSSLSocket() + parser = RequestParser(cfg, sock, ('127.0.0.1', 12345)) + + # Create a mock message with a body that will trigger socket read + mock_body = mock.Mock() + mock_body.read.side_effect = ssl.SSLWantReadError("The operation did not complete") + + mock_mesg = mock.Mock() + mock_mesg.body = mock_body + parser.mesg = mock_mesg + + # finish_body() should handle SSLWantReadError without raising + parser.finish_body() # Should not raise + + # Verify body.read was called + mock_body.read.assert_called_once_with(8192) + + def test_finish_body_reads_all_data_before_ssl_error(self): + """Test that finish_body() reads all available data before SSLWantReadError.""" + import ssl + from gunicorn.http.parser import RequestParser + + cfg = Config() + + # Create a mock socket + class MockSocket: + def recv(self, size): + return b'' + + def setblocking(self, blocking): + pass + + sock = MockSocket() + parser = RequestParser(cfg, sock, ('127.0.0.1', 12345)) + + # Create a mock message body that returns data then raises SSLWantReadError + call_count = [0] + def mock_read(size): + call_count[0] += 1 + if call_count[0] <= 2: + return b'x' * size # Return data first two times + raise ssl.SSLWantReadError("The operation did not complete") + + mock_body = mock.Mock() + mock_body.read.side_effect = mock_read + + mock_mesg = mock.Mock() + mock_mesg.body = mock_body + parser.mesg = mock_mesg + + # finish_body() should read all data and handle SSLWantReadError + parser.finish_body() # Should not raise + + # Verify body.read was called multiple times (2 data reads + 1 error) + assert call_count[0] == 3 + + def test_finish_body_normal_operation(self): + """Test that finish_body() works normally when no SSL error occurs.""" + from gunicorn.http.parser import RequestParser + + cfg = Config() + + class MockSocket: + def recv(self, size): + return b'' + + def setblocking(self, blocking): + pass + + sock = MockSocket() + parser = RequestParser(cfg, sock, ('127.0.0.1', 12345)) + + # Create a mock message body that returns empty (end of data) + mock_body = mock.Mock() + mock_body.read.return_value = b'' + + mock_mesg = mock.Mock() + mock_mesg.body = mock_body + parser.mesg = mock_mesg + + # finish_body() should work normally + parser.finish_body() + + # Verify body.read was called once and returned empty + mock_body.read.assert_called_once_with(8192) From 0e175a2d34779f936212be5cf940e957238691b3 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 09:56:32 +0100 Subject: [PATCH 053/356] fix: resolve lint issues and remove obsolete Sphinx references - Fix lint issues in test_gthread.py: - Remove unused imports (queue, partial, http) - Move fcntl import to top level - Remove unused variable assignment - Replace unnecessary lambdas with method references - Add blank lines before nested function definitions (E306) - Update .github/workflows/lint.yml: - Replace Sphinx docs check with MkDocs settings generator - docs/source directory no longer exists after MkDocs migration - Update tox.ini: - Remove docs/source/*.rst lint (directory doesn't exist) - Add tests/test_gthread.py to lint targets --- .github/workflows/lint.yml | 12 ++++++------ tests/test_gthread.py | 22 +++++++++++++--------- tox.ini | 6 +----- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 11f27c833..a51f41fb5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,17 +36,17 @@ jobs: - name: Install Dependencies (non-toxic) if: ${{ ! matrix.toxenv }} run: | - python -m pip install sphinx - - name: "Update docs" + python -m pip install --upgrade pip + python -m pip install -e . + - name: "Check generated docs" if: ${{ ! matrix.toxenv }} run: | - # this will update docs/source/settings.rst - but will not create html output - (cd docs && sphinx-build -b "dummy" -d _build/doctrees source "_build/dummy") - git update-index --assume-unchanged docs/source/settings.rst + # Regenerate settings.md and check for uncommitted changes + python scripts/build_settings_doc.py if unclean=$(git status --untracked-files=no --porcelain) && [ -z "$unclean" ]; then echo "no uncommitted changes in working tree (as it should be)" else - echo "did you forget to run `make -C docs html`?" + echo "did you forget to run 'python scripts/build_settings_doc.py'?" echo "$unclean" exit 2 fi diff --git a/tests/test_gthread.py b/tests/test_gthread.py index 71101a8df..6e2159779 100644 --- a/tests/test_gthread.py +++ b/tests/test_gthread.py @@ -5,19 +5,17 @@ """Tests for the gthread worker.""" import errno +import fcntl import os -import queue import selectors import threading import time from collections import deque from concurrent import futures -from functools import partial from unittest import mock import pytest -from gunicorn import http from gunicorn.config import Config from gunicorn.workers import gthread @@ -85,7 +83,7 @@ def test_tconn_init_sets_blocking_false(self): sock = FakeSocket() sock.setblocking(True) - conn = gthread.TConn(cfg, sock, ('127.0.0.1', 12345), ('127.0.0.1', 8000)) + gthread.TConn(cfg, sock, ('127.0.0.1', 12345), ('127.0.0.1', 8000)) # TConn sets socket to non-blocking in __init__ assert sock.blocking is False @@ -147,7 +145,7 @@ def test_queue_defer_and_run(self): q.init() results = [] - q.defer(lambda x: results.append(x), 42) + q.defer(results.append, 42) # Simulate the selector reading from the pipe q.run_callbacks(None) @@ -162,7 +160,7 @@ def test_queue_multiple_callbacks(self): results = [] for i in range(5): - q.defer(lambda x: results.append(x), i) + q.defer(results.append, i) q.run_callbacks(None) @@ -220,9 +218,6 @@ def callback(): def test_queue_nonblocking_pipe(self): """Test that pipe is non-blocking (BSD compatibility).""" - import os - import fcntl - q = gthread.PollableMethodQueue() q.init() @@ -889,18 +884,22 @@ def test_worker_notifies_in_run_loop(self): # Track notify calls notify_calls = [] original_notify = worker.notify + def tracking_notify(): notify_calls.append(time.monotonic()) original_notify() + worker.notify = tracking_notify # Mock poller.select to exit after first iteration call_count = [0] + def mock_select(timeout): call_count[0] += 1 if call_count[0] > 1: worker.alive = False return [] + worker.poller.select.side_effect = mock_select # Mock is_parent_alive to return True @@ -1010,6 +1009,7 @@ def test_graceful_shutdown_drains_connections(self): # Track iterations iterations = [0] + def mock_select(timeout): iterations[0] += 1 if iterations[0] == 1: @@ -1022,6 +1022,7 @@ def mock_select(timeout): # Connection finishes worker.nr_conns = 0 return [] + worker.poller.select.side_effect = mock_select worker.is_parent_alive = mock.Mock(return_value=True) @@ -1096,9 +1097,11 @@ def test_worker_exits_on_parent_death(self): worker.ppid = 99999999 # Invalid ppid iterations = [0] + def mock_select(timeout): iterations[0] += 1 return [] + worker.poller.select.side_effect = mock_select worker.run() @@ -1349,6 +1352,7 @@ def setblocking(self, blocking): # Create a mock message body that returns data then raises SSLWantReadError call_count = [0] + def mock_read(size): call_count[0] += 1 if call_count[0] <= 2: diff --git a/tox.ini b/tox.ini index 359cb90b5..b328e7e2d 100644 --- a/tox.ini +++ b/tox.ini @@ -33,6 +33,7 @@ commands = gunicorn \ tests/test_arbiter.py \ tests/test_config.py \ + tests/test_gthread.py \ tests/test_http.py \ tests/test_invalid_requests.py \ tests/test_logger.py \ @@ -48,16 +49,11 @@ deps = [testenv:docs-lint] no_package = true -allowlist_externals = - rst-lint - bash - grep deps = restructuredtext_lint pygments commands = rst-lint README.rst docs/README.rst - bash -c "(set -o pipefail; rst-lint --encoding utf-8 docs/source/*.rst | grep -v 'Unknown interpreted text role\|Unknown directive type'); test $? == 1" [testenv:pycodestyle] no_package = true From 38e23175e788fe4c35d7d6340e3a56dafb4407d9 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 09:57:33 +0100 Subject: [PATCH 054/356] docs: regenerate settings.md with updated worker versions --- docs/content/reference/settings.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/content/reference/settings.md b/docs/content/reference/settings.md index e24227bfd..018a07932 100644 --- a/docs/content/reference/settings.md +++ b/docs/content/reference/settings.md @@ -1442,11 +1442,11 @@ libraries may be installed using setuptools' ``extras_require`` feature. A string referring to one of the following bundled classes: * ``sync`` -* ``eventlet`` - Requires eventlet >= 0.24.1 (or install it via +* ``eventlet`` - Requires eventlet >= 0.40.3 (or install it via ``pip install gunicorn[eventlet]``) -* ``gevent`` - Requires gevent >= 1.4 (or install it via +* ``gevent`` - Requires gevent >= 24.10.1 (or install it via ``pip install gunicorn[gevent]``) -* ``tornado`` - Requires tornado >= 0.2 (or install it via +* ``tornado`` - Requires tornado >= 6.5.0 (or install it via ``pip install gunicorn[tornado]``) * ``gthread`` - Python 2 requires the futures package to be installed (or install it via ``pip install gunicorn[gthread]``) From f68ad2e095b7a69cc851fe51576c72b7a721a225 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 10:04:57 +0100 Subject: [PATCH 055/356] ci: add git diff output to diagnose settings.md issue --- .github/workflows/lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a51f41fb5..8e1e6a2dd 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -48,5 +48,6 @@ jobs: else echo "did you forget to run 'python scripts/build_settings_doc.py'?" echo "$unclean" + git diff exit 2 fi From 46e772683866854641a547d8b9dfd1d19aab0f3b Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 10:08:01 +0100 Subject: [PATCH 056/356] fix: make syslog_addr default platform-neutral in docs The syslog_addr setting has different defaults depending on the platform (macOS, FreeBSD, OpenBSD, Linux). Added default_doc to show all platform-specific defaults in the documentation, ensuring consistent output regardless of which platform generates the docs. Also kept the diagnostic git diff in CI for future debugging. --- docs/content/reference/settings.md | 9 ++++++++- gunicorn/config.py | 9 +++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/content/reference/settings.md b/docs/content/reference/settings.md index 018a07932..52cd3152e 100644 --- a/docs/content/reference/settings.md +++ b/docs/content/reference/settings.md @@ -285,7 +285,14 @@ Format: https://docs.python.org/3/library/logging.config.html#logging.config.jso **Command line:** `--log-syslog-to SYSLOG_ADDR` -**Default:** `'unix:///var/run/syslog'` +**Default:** + +Platform-specific: + +* macOS: ``'unix:///var/run/syslog'`` +* FreeBSD/DragonFly: ``'unix:///var/run/log'`` +* OpenBSD: ``'unix:///dev/log'`` +* Linux/other: ``'udp://localhost:514'`` Address to send syslog messages. diff --git a/gunicorn/config.py b/gunicorn/config.py index 2dcf64d0d..eb93857b6 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -1568,6 +1568,15 @@ class SyslogTo(Setting): else: default = "udp://localhost:514" + default_doc = """\ + Platform-specific: + + * macOS: ``'unix:///var/run/syslog'`` + * FreeBSD/DragonFly: ``'unix:///var/run/log'`` + * OpenBSD: ``'unix:///dev/log'`` + * Linux/other: ``'udp://localhost:514'`` + """ + desc = """\ Address to send syslog messages. From 36f3807a74a816b134b693082f0373f49305f4f8 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 10:36:42 +0100 Subject: [PATCH 057/356] docs: remove RuntimeDirectory from systemd service example The RuntimeDirectory directive is unused by gunicorn and causes unnecessary directory creation in /run. Closes #3341 --- docs/content/deploy.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/content/deploy.md b/docs/content/deploy.md index bb78674e4..435bc426f 100644 --- a/docs/content/deploy.md +++ b/docs/content/deploy.md @@ -214,7 +214,6 @@ Type=notify NotifyAccess=main User=someuser Group=someuser -RuntimeDirectory=gunicorn WorkingDirectory=/home/someuser/applicationroot ExecStart=/usr/bin/gunicorn applicationname.wsgi ExecReload=/bin/kill -s HUP $MAINPID From 4ef635446b8a82ac780460e8e7d29089513d64be Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 10:37:30 +0100 Subject: [PATCH 058/356] docs: add dogstatsd_tags example to description Clarify the expected format with a concrete example. Closes #3288 --- gunicorn/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gunicorn/config.py b/gunicorn/config.py index 2dcf64d0d..d4f75068d 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -1672,7 +1672,7 @@ class DogstatsdTags(Setting): validator = validate_string desc = """\ A comma-delimited list of datadog statsd (dogstatsd) tags to append to - statsd metrics. + statsd metrics. e.g. ``'tag1:value1,tag2:value2'`` .. versionadded:: 20 """ From 33e53373950315042ee6f15bde53b3e6b94767cd Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 10:56:07 +0100 Subject: [PATCH 059/356] docs: fix post_request hook signature description The description incorrectly stated the callable accepts two parameters (Worker and Request), but the signature shows four parameters including environ and resp. Closes #2592 --- gunicorn/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gunicorn/config.py b/gunicorn/config.py index 01f8a8372..15b72bd13 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -1947,7 +1947,8 @@ def post_request(worker, req, environ, resp): Called after a worker processes the request. The callable needs to accept two instance variables for the Worker and - the Request. + the Request. If a third parameter is defined it will be passed the + environment. If a fourth parameter is defined it will be passed the Response. """ From a182066beaca9a0dab242b87786b8161257b173c Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 10:59:05 +0100 Subject: [PATCH 060/356] fix: use proper exception chaining with 'raise from' in glogging.py Use 'raise X from e' syntax instead of just 'raise X' when wrapping exceptions. This provides more accurate exception chaining messages ("The above exception was the direct cause of" vs "During handling of"). Closes #2360 --- gunicorn/glogging.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gunicorn/glogging.py b/gunicorn/glogging.py index e34fcd5f7..ade25eee1 100644 --- a/gunicorn/glogging.py +++ b/gunicorn/glogging.py @@ -237,7 +237,7 @@ def setup(self, cfg): ValueError, TypeError ) as exc: - raise RuntimeError(str(exc)) + raise RuntimeError(str(exc)) from exc elif cfg.logconfig_json: config = CONFIG_DEFAULTS.copy() if os.path.exists(cfg.logconfig_json): @@ -252,7 +252,7 @@ def setup(self, cfg): ValueError, TypeError ) as exc: - raise RuntimeError(str(exc)) + raise RuntimeError(str(exc)) from exc elif cfg.logconfig: if os.path.exists(cfg.logconfig): defaults = CONFIG_DEFAULTS.copy() @@ -442,8 +442,8 @@ def _set_syslog_handler(self, log, cfg, fmt, name): # syslog facility try: facility = SYSLOG_FACILITIES[cfg.syslog_facility.lower()] - except KeyError: - raise RuntimeError("unknown facility name") + except KeyError as exc: + raise RuntimeError("unknown facility name") from exc # parse syslog address socktype, addr = parse_syslog_address(cfg.syslog_addr) From 8e75b3aba35d77b83f5bba2f7b8d69dc0efc1b14 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 10:59:56 +0100 Subject: [PATCH 061/356] fix: prevent RecursionError when pickling Config On Python 3.8+ with macOS, the multiprocessing module uses 'spawn' by default which pickles objects. When pickle.load tries to read __setstate__ before __dict__ is restored, it hits __getattr__ causing infinite recursion. Adding a special case for 'settings' prevents this. Closes #2401 --- gunicorn/config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gunicorn/config.py b/gunicorn/config.py index 15b72bd13..a1e76796f 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -62,6 +62,8 @@ def __str__(self): return "\n".join(lines) def __getattr__(self, name): + if name == "settings": + raise AttributeError() if name not in self.settings: raise AttributeError("No configuration setting for: %s" % name) return self.settings[name].get() From 56abeaf105e756f368784f84ed70692473036fc1 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 11:00:09 +0100 Subject: [PATCH 062/356] fix: unreader.unread() now prepends data to buffer The unread method was incorrectly appending data to the end of the buffer instead of prepending it to the beginning. This caused issues when reading partial data and then unreading it. Closes #2915 Closes #2346 --- gunicorn/http/unreader.py | 4 +++- tests/test_http.py | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gunicorn/http/unreader.py b/gunicorn/http/unreader.py index 9aadfbcff..1138e02fb 100644 --- a/gunicorn/http/unreader.py +++ b/gunicorn/http/unreader.py @@ -49,8 +49,10 @@ def read(self, size=None): return data[:size] def unread(self, data): - self.buf.seek(0, os.SEEK_END) + rest = self.buf.getvalue() + self.buf = io.BytesIO() self.buf.write(data) + self.buf.write(rest) class SocketUnreader(Unreader): diff --git a/tests/test_http.py b/tests/test_http.py index 3aa4808f9..94a3a9d39 100644 --- a/tests/test_http.py +++ b/tests/test_http.py @@ -137,6 +137,14 @@ def test_unreader_unread(): assert b'hi there' in unreader.read() +def test_unreader_unread_should_place_data_at_the_beginning_of_the_buffer(): + unreader = IterUnreader([b"abc", b"def"]) + ab = unreader.read(2) + unreader.unread(ab) + + assert unreader.read(None) == b"abc" + + def test_unreader_read_zero_size(): unreader = Unreader() unreader.chunk = mock.MagicMock(side_effect=[b'qwerty', b'asdfgh']) From 19d07bd4af86d6dad71f29bcc5b8e5f97704aef2 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 11:02:29 +0100 Subject: [PATCH 063/356] fix: print exception to stderr on worker boot failure When a worker fails to boot, the exception is now printed to stderr (in addition to being logged), consistent with AppImportError handling. This makes boot failures more visible to users. Closes #2933 --- gunicorn/arbiter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py index 9b9c8d6d8..8e27dca4c 100644 --- a/gunicorn/arbiter.py +++ b/gunicorn/arbiter.py @@ -631,8 +631,10 @@ def spawn_worker(self): print("%s" % e, file=sys.stderr) sys.stderr.flush() sys.exit(self.APP_LOAD_ERROR) - except Exception: + except Exception as e: self.log.exception("Exception in worker process") + print("%s" % e, file=sys.stderr) + sys.stderr.flush() if not worker.booted: sys.exit(self.WORKER_BOOT_ERROR) sys.exit(-1) From bbc9bba95e4bc53ed0178c1e43d33281948dec44 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 11:03:27 +0100 Subject: [PATCH 064/356] fix: log SIGTERM as info level, not warning SIGTERM is expected during graceful shutdown and reload operations. Logging it as warning level causes unnecessary noise in error logs. SIGKILL remains at error level (suggests OOM), other signals at warning. Closes #3094 --- gunicorn/arbiter.py | 5 ++++- tests/test_arbiter.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py index 8e27dca4c..da2942830 100644 --- a/gunicorn/arbiter.py +++ b/gunicorn/arbiter.py @@ -551,8 +551,11 @@ def reap_workers(self): if sig == signal.SIGKILL: msg += " Perhaps out of memory?" self.log.error(msg) + elif sig == signal.SIGTERM: + # SIGTERM is expected during graceful shutdown + self.log.info(msg) else: - # SIGTERM/SIGQUIT are expected during shutdown + # Other signals are unexpected self.log.warning(msg) if exitcode is not None and exitcode != 0: diff --git a/tests/test_arbiter.py b/tests/test_arbiter.py index e9d03e195..ff855b46b 100644 --- a/tests/test_arbiter.py +++ b/tests/test_arbiter.py @@ -407,8 +407,8 @@ def test_reap_killed_by_signal(self, mock_waitpid): mock_worker = mock.Mock() arbiter.WORKERS = {42: mock_worker} - # SIGTERM should be logged as warning (not error) - with mock.patch.object(arbiter.log, 'warning') as mock_log: + # SIGTERM should be logged as info (expected during graceful shutdown) + with mock.patch.object(arbiter.log, 'info') as mock_log: arbiter.reap_workers() # Should log the signal From b0d38928c86952f0bbe40fcc1efe0d507e7ce7b8 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 11:05:32 +0100 Subject: [PATCH 065/356] feat: InotifyReloader now watches newly loaded modules Refactor reloader to share code via ReloaderBase class. InotifyReloader now calls refresh_dirs() on each event loop timeout (~1 sec) to watch directories for dynamically loaded modules (e.g., Django dynamic imports). Fixes #1790 Closes #1791 --- gunicorn/reloader.py | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/gunicorn/reloader.py b/gunicorn/reloader.py index 1c67f2a7d..3952aad48 100644 --- a/gunicorn/reloader.py +++ b/gunicorn/reloader.py @@ -13,7 +13,7 @@ COMPILED_EXT_RE = re.compile(r'py[co]$') -class Reloader(threading.Thread): +class ReloaderBase(threading.Thread): def __init__(self, extra_files=None, interval=1, callback=None): super().__init__() self.daemon = True @@ -35,6 +35,8 @@ def get_files(self): return fnames + +class Reloader(ReloaderBase): def run(self): mtimes = {} while True: @@ -65,25 +67,21 @@ def run(self): if has_inotify: - class InotifyReloader(threading.Thread): + class InotifyReloader(ReloaderBase): event_mask = (inotify.constants.IN_CREATE | inotify.constants.IN_DELETE | inotify.constants.IN_DELETE_SELF | inotify.constants.IN_MODIFY | inotify.constants.IN_MOVE_SELF | inotify.constants.IN_MOVED_FROM | inotify.constants.IN_MOVED_TO) def __init__(self, extra_files=None, callback=None): - super().__init__() - self.daemon = True - self._callback = callback + super().__init__(extra_files=extra_files, callback=callback) self._dirs = set() self._watcher = Inotify() - for extra_file in extra_files: - self.add_extra_file(extra_file) - def add_extra_file(self, filename): - dirname = os.path.dirname(filename) + super().add_extra_file(filename) + dirname = os.path.dirname(filename) if dirname in self._dirs: return @@ -91,23 +89,22 @@ def add_extra_file(self, filename): self._dirs.add(dirname) def get_dirs(self): - fnames = [ - os.path.dirname(os.path.abspath(COMPILED_EXT_RE.sub('py', module.__file__))) - for module in tuple(sys.modules.values()) - if getattr(module, '__file__', None) - ] + dirnames = [os.path.dirname(os.path.abspath(fname)) for fname in self.get_files()] + return set(dirnames) - return set(fnames) + def refresh_dirs(self): + new_dirs = self.get_dirs().difference(self._dirs) + self._dirs.update(new_dirs) + for new_dir in new_dirs: + if os.path.isdir(new_dir): + self._watcher.add_watch(new_dir, mask=self.event_mask) def run(self): - self._dirs = self.get_dirs() - - for dirname in self._dirs: - if os.path.isdir(dirname): - self._watcher.add_watch(dirname, mask=self.event_mask) + self.refresh_dirs() for event in self._watcher.event_gen(): if event is None: + self.refresh_dirs() continue filename = event[3] From e52ac46e297d9d483ad8cf16e43487545185a997 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 11:09:26 +0100 Subject: [PATCH 066/356] feat: support CIDR networks in forwarded_allow_ips and proxy_allow_ips Use Python's ipaddress module to support IP networks in allow lists. Individual IP addresses are converted to /32 (IPv4) or /128 (IPv6) networks. CIDR notation (e.g., 192.168.0.0/16) is now supported. Fixes #1485 Closes #2390 --- gunicorn/config.py | 20 +++++++++++++++----- gunicorn/http/message.py | 27 +++++++++++++++++++++------ tests/test_config.py | 27 ++++++++++++++++++++++++--- 3 files changed, 60 insertions(+), 14 deletions(-) diff --git a/gunicorn/config.py b/gunicorn/config.py index a1e76796f..caa7ab0e4 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -407,12 +407,15 @@ def validate_list_of_existing_files(val): def validate_string_to_addr_list(val): val = validate_string_to_list(val) + result = [] for addr in val: if addr == "*": + result.append(addr) continue - _vaid_ip = ipaddress.ip_address(addr) + # Support both single IPs and CIDR networks + result.append(ipaddress.ip_network(addr, strict=False)) - return val + return result def validate_string_to_list(val): @@ -1278,8 +1281,11 @@ class ForwardedAllowIPS(Setting): validator = validate_string_to_addr_list default = os.environ.get("FORWARDED_ALLOW_IPS", "127.0.0.1,::1") desc = """\ - Front-end's IPs from which allowed to handle set secure headers. - (comma separated). + Front-end's IP addresses or networks from which allowed to handle + set secure headers. (comma separated). + + Supports both individual IP addresses (e.g., ``192.168.1.1``) and + CIDR networks (e.g., ``192.168.0.0/16``). Set to ``*`` to disable checking of front-end IPs. This is useful for setups where you don't know in advance the IP address of front-end, but @@ -2094,7 +2100,11 @@ class ProxyAllowFrom(Setting): validator = validate_string_to_addr_list default = "127.0.0.1,::1" desc = """\ - Front-end's IPs from which allowed accept proxy requests (comma separated). + Front-end's IP addresses or networks from which allowed accept + proxy requests (comma separated). + + Supports both individual IP addresses (e.g., ``192.168.1.1``) and + CIDR networks (e.g., ``192.168.0.0/16``). Set to ``*`` to disable checking of front-end IPs. This is useful for setups where you don't know in advance the IP address of front-end, but diff --git a/gunicorn/http/message.py b/gunicorn/http/message.py index 59ce0bf4b..4e8dd4447 100644 --- a/gunicorn/http/message.py +++ b/gunicorn/http/message.py @@ -3,6 +3,7 @@ # See the NOTICE for more information. import io +import ipaddress import re import socket @@ -30,6 +31,22 @@ RFC9110_5_5_INVALID_AND_DANGEROUS = re.compile(r"[\0\r\n]") +def _ip_in_allow_list(ip_str, allow_list): + """Check if IP address is in the allow list (which may contain networks).""" + if '*' in allow_list: + return True + try: + ip = ipaddress.ip_address(ip_str) + except ValueError: + return False + for network in allow_list: + if network == '*': + return True + if ip in network: + return True + return False + + class Message: def __init__(self, cfg, unreader, peer_addr): self.cfg = cfg @@ -82,9 +99,8 @@ def parse_headers(self, data, from_trailer=False): # nonsense. either a request is https from the beginning # .. or we are just behind a proxy who does not remove conflicting trailers pass - elif ('*' in cfg.forwarded_allow_ips or - not isinstance(self.peer_addr, tuple) - or self.peer_addr[0] in cfg.forwarded_allow_ips): + elif (not isinstance(self.peer_addr, tuple) + or _ip_in_allow_list(self.peer_addr[0], cfg.forwarded_allow_ips)): secure_scheme_headers = cfg.secure_scheme_headers forwarder_headers = cfg.forwarder_headers @@ -352,9 +368,8 @@ def proxy_protocol(self, line): def proxy_protocol_access_check(self): # check in allow list - if ("*" not in self.cfg.proxy_allow_ips and - isinstance(self.peer_addr, tuple) and - self.peer_addr[0] not in self.cfg.proxy_allow_ips): + if (isinstance(self.peer_addr, tuple) and + not _ip_in_allow_list(self.peer_addr[0], self.cfg.proxy_allow_ips)): raise ForbiddenProxyRequest(self.peer_addr[0]) def parse_proxy_protocol(self, line): diff --git a/tests/test_config.py b/tests/test_config.py index 6ca014b6a..0aff90f5f 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -2,6 +2,7 @@ # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. +import ipaddress import os import re import sys @@ -165,10 +166,30 @@ def test_str_validation(): def test_str_to_addr_list_validation(): c = config.Config() - assert c.proxy_allow_ips == ["127.0.0.1", "::1"] - assert c.forwarded_allow_ips == ["127.0.0.1", "::1"] + # Default values are now network objects + assert c.proxy_allow_ips == [ + ipaddress.ip_network("127.0.0.1/32"), + ipaddress.ip_network("::1/128") + ] + assert c.forwarded_allow_ips == [ + ipaddress.ip_network("127.0.0.1/32"), + ipaddress.ip_network("::1/128") + ] + # Single IPs are converted to /32 or /128 networks c.set("forwarded_allow_ips", "127.0.0.1,192.0.2.1") - assert c.forwarded_allow_ips == ["127.0.0.1", "192.0.2.1"] + assert c.forwarded_allow_ips == [ + ipaddress.ip_network("127.0.0.1/32"), + ipaddress.ip_network("192.0.2.1/32") + ] + # CIDR networks are supported + c.set("forwarded_allow_ips", "127.0.0.0/8,192.168.0.0/16") + assert c.forwarded_allow_ips == [ + ipaddress.ip_network("127.0.0.0/8"), + ipaddress.ip_network("192.168.0.0/16") + ] + # Wildcard is preserved as string + c.set("forwarded_allow_ips", "*") + assert c.forwarded_allow_ips == ["*"] c.set("forwarded_allow_ips", "") assert c.forwarded_allow_ips == [] c.set("forwarded_allow_ips", None) From f22cd6558ebf866a096914dc45142934eb564c4c Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 11:11:55 +0100 Subject: [PATCH 067/356] feat: add socket backlog metric (Linux only) Add --enable-backlog-metric option to emit a gunicorn.backlog histogram metric showing connections waiting in the socket backlog. This helps identify worker saturation and concurrency issues. Also distinguishes between timer (|ms) and histogram (|h) statsd metric types per the statsd spec. Note: Only works on Linux using TCP_INFO from getsockopt. Closes #2407 Partially fixes #2057 --- gunicorn/arbiter.py | 10 ++++++++++ gunicorn/config.py | 15 +++++++++++++++ gunicorn/instrument/statsd.py | 10 ++++++++-- gunicorn/sock.py | 23 +++++++++++++++++++++++ 4 files changed, 56 insertions(+), 2 deletions(-) diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py index da2942830..222b3ca30 100644 --- a/gunicorn/arbiter.py +++ b/gunicorn/arbiter.py @@ -600,6 +600,16 @@ def manage_workers(self): "value": active_worker_count, "mtype": "gauge"}) + if self.cfg.enable_backlog_metric: + backlog = sum(sock.get_backlog() or 0 + for sock in self.LISTENERS) + + if backlog >= 0: + self.log.debug("socket backlog: {0}".format(backlog), + extra={"metric": "gunicorn.backlog", + "value": backlog, + "mtype": "histogram"}) + def spawn_worker(self): self.worker_age += 1 worker = self.worker_class(self.worker_age, self.pid, self.LISTENERS, diff --git a/gunicorn/config.py b/gunicorn/config.py index caa7ab0e4..663799f26 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -1710,6 +1710,21 @@ class StatsdPrefix(Setting): """ +class BacklogMetric(Setting): + name = "enable_backlog_metric" + section = "Logging" + cli = ["--enable-backlog-metric"] + validator = validate_bool + default = False + action = "store_true" + desc = """\ + Enable socket backlog metric (only supported on Linux). + + When enabled, gunicorn will emit a ``gunicorn.backlog`` histogram metric + showing the number of connections waiting in the socket backlog. + """ + + class Procname(Setting): name = "proc_name" section = "Process Naming" diff --git a/gunicorn/instrument/statsd.py b/gunicorn/instrument/statsd.py index 7bc4e6ffd..708a1d6bf 100644 --- a/gunicorn/instrument/statsd.py +++ b/gunicorn/instrument/statsd.py @@ -17,6 +17,7 @@ GAUGE_TYPE = "gauge" COUNTER_TYPE = "counter" HISTOGRAM_TYPE = "histogram" +TIMER_TYPE = "timer" class Statsd(Logger): @@ -80,6 +81,8 @@ def log(self, lvl, msg, *args, **kwargs): self.increment(metric, value) elif typ == HISTOGRAM_TYPE: self.histogram(metric, value) + elif typ == TIMER_TYPE: + self.timer(metric, value) else: pass @@ -101,7 +104,7 @@ def access(self, resp, req, environ, request_time): status = status.decode('utf-8') if isinstance(status, str): status = int(status.split(None, 1)[0]) - self.histogram("gunicorn.request.duration", duration_in_ms) + self.timer("gunicorn.request.duration", duration_in_ms) self.increment("gunicorn.requests", 1) self.increment("gunicorn.request.status.%d" % status, 1) @@ -116,9 +119,12 @@ def increment(self, name, value, sampling_rate=1.0): def decrement(self, name, value, sampling_rate=1.0): self._sock_send("{0}{1}:-{2}|c|@{3}".format(self.prefix, name, value, sampling_rate)) - def histogram(self, name, value): + def timer(self, name, value): self._sock_send("{0}{1}:{2}|ms".format(self.prefix, name, value)) + def histogram(self, name, value): + self._sock_send("{0}{1}:{2}|h".format(self.prefix, name, value)) + def _sock_send(self, msg): try: if isinstance(msg, str): diff --git a/gunicorn/sock.py b/gunicorn/sock.py index eb2b6fa9c..d89d752cf 100644 --- a/gunicorn/sock.py +++ b/gunicorn/sock.py @@ -7,11 +7,14 @@ import socket import ssl import stat +import struct import sys import time from gunicorn import util +PLATFORM = sys.platform + class BaseSocket: @@ -70,6 +73,9 @@ def close(self): self.sock = None + def get_backlog(self): + return -1 + class TCPSocket(BaseSocket): @@ -88,6 +94,23 @@ def set_options(self, sock, bound=False): sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) return super().set_options(sock, bound=bound) + if PLATFORM == "linux": + def get_backlog(self): + if self.sock: + # tcp_info struct from include/uapi/linux/tcp.h + fmt = 'B' * 8 + 'I' * 24 + try: + tcp_info_struct = self.sock.getsockopt(socket.IPPROTO_TCP, + socket.TCP_INFO, 104) + # 12 is tcpi_unacked + return struct.unpack(fmt, tcp_info_struct)[12] + except (AttributeError, OSError): + pass + return 0 + else: + def get_backlog(self): + return -1 + class TCP6Socket(TCPSocket): From c0c4b65f0fcae1b776bc963e87a968978329e1a4 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 11:41:15 +0100 Subject: [PATCH 068/356] docs: regenerate settings.md --- docs/content/reference/settings.md | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/docs/content/reference/settings.md b/docs/content/reference/settings.md index 52cd3152e..7fc136f92 100644 --- a/docs/content/reference/settings.md +++ b/docs/content/reference/settings.md @@ -370,7 +370,7 @@ Address is a string of the form: **Default:** `''` A comma-delimited list of datadog statsd (dogstatsd) tags to append to -statsd metrics. +statsd metrics. e.g. ``'tag1:value1,tag2:value2'`` !!! info "Added in 20" @@ -385,6 +385,17 @@ if not provided). !!! info "Added in 19.2" +### `enable_backlog_metric` + +**Command line:** `--enable-backlog-metric` + +**Default:** `False` + +Enable socket backlog metric (only supported on Linux). + +When enabled, gunicorn will emit a ``gunicorn.backlog`` histogram metric +showing the number of connections waiting in the socket backlog. + ## Process Naming ### `proc_name` @@ -726,7 +737,8 @@ def post_request(worker, req, environ, resp): Called after a worker processes the request. The callable needs to accept two instance variables for the Worker and -the Request. +the Request. If a third parameter is defined it will be passed the +environment. If a fourth parameter is defined it will be passed the Response. ### `child_exit` @@ -1031,8 +1043,11 @@ the headers defined here can not be passed directly from the client. **Default:** `'127.0.0.1,::1'` -Front-end's IPs from which allowed to handle set secure headers. -(comma separated). +Front-end's IP addresses or networks from which allowed to handle +set secure headers. (comma separated). + +Supports both individual IP addresses (e.g., ``192.168.1.1``) and +CIDR networks (e.g., ``192.168.0.0/16``). Set to ``*`` to disable checking of front-end IPs. This is useful for setups where you don't know in advance the IP address of front-end, but @@ -1159,7 +1174,11 @@ Example for stunnel config:: **Default:** `'127.0.0.1,::1'` -Front-end's IPs from which allowed accept proxy requests (comma separated). +Front-end's IP addresses or networks from which allowed accept +proxy requests (comma separated). + +Supports both individual IP addresses (e.g., ``192.168.1.1``) and +CIDR networks (e.g., ``192.168.0.0/16``). Set to ``*`` to disable checking of front-end IPs. This is useful for setups where you don't know in advance the IP address of front-end, but From 66963367f314c94db311ffb62ad38702d3d6409f Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 14:40:40 +0100 Subject: [PATCH 069/356] fix: set socket to blocking mode on keepalive connections On keepalive connections, finish_request() sets the socket to non-blocking for selector registration. When the connection is reused, handle() calls conn.init() which returns early (already initialized) without restoring blocking mode. This caused SSLWantReadError when WSGI apps read the request body on SSL connections. Fix by explicitly setting blocking mode at the start of handle(). Fixes #3448 --- gunicorn/workers/gthread.py | 6 ++ tests/test_gthread.py | 113 ++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+) diff --git a/gunicorn/workers/gthread.py b/gunicorn/workers/gthread.py index 7cab99200..1665f4e6c 100644 --- a/gunicorn/workers/gthread.py +++ b/gunicorn/workers/gthread.py @@ -344,6 +344,12 @@ def handle(self, conn): """Handle a request on a connection. Runs in a worker thread.""" req = None try: + # Always ensure blocking mode in worker thread. + # Critical for keepalive connections: the socket is set to non-blocking + # for the selector in finish_request(), but must be blocking for + # request/body reading to avoid SSLWantReadError on SSL connections. + conn.sock.setblocking(True) + # Initialize connection in worker thread to handle SSL errors gracefully # (ENOTCONN from ssl_wrap_socket would crash main thread otherwise) conn.init() diff --git a/tests/test_gthread.py b/tests/test_gthread.py index 6e2159779..a085ada76 100644 --- a/tests/test_gthread.py +++ b/tests/test_gthread.py @@ -1287,6 +1287,119 @@ def test_connections_tracked_during_signal(self): worker.method_queue.close() +class TestKeepaliveBlockingMode: + """Tests for socket blocking mode on keepalive connections (issue #3448).""" + + def create_worker(self): + """Create a worker for testing.""" + cfg = Config() + cfg.set('workers', 1) + cfg.set('threads', 4) + cfg.set('worker_connections', 1000) + cfg.set('keepalive', 2) + + worker = gthread.ThreadWorker( + age=1, + ppid=os.getpid(), + sockets=[], + app=mock.Mock(), + timeout=30, + cfg=cfg, + log=mock.Mock(), + ) + return worker + + def test_handle_sets_blocking_on_keepalive_connection(self): + """Test that handle() sets socket to blocking mode on keepalive connections. + + On keepalive connections, the socket is in non-blocking mode (set by + finish_request() for the selector). handle() must set it back to blocking + before reading request/body to avoid SSLWantReadError on SSL connections. + """ + worker = self.create_worker() + worker.wsgi = mock.Mock(return_value=[b'response']) + + # Create a connection that simulates a keepalive reuse + cfg = Config() + sock = FakeSocket() + conn = gthread.TConn(cfg, sock, ('127.0.0.1', 12345), ('127.0.0.1', 8000)) + + # Simulate the state after finish_request() for keepalive: + # - socket is non-blocking (for selector registration) + # - connection is already initialized + conn.init() # First request initialized the connection + sock.setblocking(False) # finish_request() set non-blocking for selector + assert sock.blocking is False + assert conn.initialized is True + + # Verify that handle() sets the socket to blocking mode + # Mock the parser to avoid actually parsing + mock_parser = mock.Mock() + mock_parser.__next__ = mock.Mock(return_value=None) # No request + conn.parser = mock_parser + + worker.handle(conn) + + # Socket should be set to blocking mode by handle() + assert sock.blocking is True + + def test_handle_sets_blocking_before_body_read(self): + """Test that socket is blocking before WSGI app reads request body. + + This is the core fix for issue #3448: Flask's request.get_json() + reads the body, which triggers socket.recv(). If the socket is + non-blocking, this raises SSLWantReadError on SSL connections. + """ + worker = self.create_worker() + + cfg = Config() + sock = FakeSocket() + conn = gthread.TConn(cfg, sock, ('127.0.0.1', 12345), ('127.0.0.1', 8000)) + + # Simulate keepalive state + conn.init() + sock.setblocking(False) + + # Track when blocking is set vs when body would be read + blocking_state_at_body_read = [None] + + def mock_wsgi(environ, start_response): + # This simulates Flask's request.get_json() reading the body + # The socket must be blocking at this point + blocking_state_at_body_read[0] = sock.blocking + start_response('200 OK', []) + return [b'response'] + + worker.wsgi = mock_wsgi + + # Mock parser to return a request + mock_request = mock.Mock() + mock_request.headers = [] + mock_request.unreader = mock.Mock() + mock_request.body = mock.Mock() + mock_request.body.read.return_value = b'' + + mock_parser = mock.Mock() + mock_parser.__next__ = mock.Mock(return_value=mock_request) + mock_parser.finish_body = mock.Mock() + conn.parser = mock_parser + + # Mock handle_request to invoke wsgi + original_handle_request = worker.handle_request + + def mock_handle_request(req, conn): + # Simplified version that just calls wsgi + worker.wsgi({}, lambda s, h: None) + return True + + worker.handle_request = mock_handle_request + + worker.handle(conn) + + # Socket must be blocking when WSGI app reads body + assert blocking_state_at_body_read[0] is True + + class TestFinishBodySSL: """Tests for SSL error handling in finish_body().""" From f95ac41b8f5b81f3325a67df316876766c1b29f7 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 14:46:40 +0100 Subject: [PATCH 070/356] fix: use smaller buffer in finish_body for faster timeout Reduce buffer size from 8192 to 1024 bytes when discarding unread body data, allowing timeouts to trigger more quickly on slow or stalled connections. --- gunicorn/http/parser.py | 4 ++-- tests/test_gthread.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gunicorn/http/parser.py b/gunicorn/http/parser.py index 5b2da1150..260beafa2 100644 --- a/gunicorn/http/parser.py +++ b/gunicorn/http/parser.py @@ -36,9 +36,9 @@ def finish_body(self): """ if self.mesg: try: - data = self.mesg.body.read(8192) + data = self.mesg.body.read(1024) while data: - data = self.mesg.body.read(8192) + data = self.mesg.body.read(1024) except ssl.SSLWantReadError: # SSL socket has no more application data available pass diff --git a/tests/test_gthread.py b/tests/test_gthread.py index a085ada76..0762cc99b 100644 --- a/tests/test_gthread.py +++ b/tests/test_gthread.py @@ -1443,7 +1443,7 @@ def setblocking(self, blocking): parser.finish_body() # Should not raise # Verify body.read was called - mock_body.read.assert_called_once_with(8192) + mock_body.read.assert_called_once_with(1024) def test_finish_body_reads_all_data_before_ssl_error(self): """Test that finish_body() reads all available data before SSLWantReadError.""" @@ -1513,4 +1513,4 @@ def setblocking(self, blocking): parser.finish_body() # Verify body.read was called once and returned empty - mock_body.read.assert_called_once_with(8192) + mock_body.read.assert_called_once_with(1024) From f3190f84cce874117136d277d4bcb8f2c62dcc9a Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 18:40:44 +0100 Subject: [PATCH 071/356] feat: add PROXY protocol v2 support with version selection (#3451) Extend --proxy-protocol to accept version values (off, v1, v2, auto) instead of being boolean-only. This allows explicit control over which PROXY protocol versions are accepted. Changes: - Add InvalidProxyHeader exception for v2 binary header errors - Add validate_proxy_protocol() validator with backwards compatibility - Update ProxyProtocol setting with nargs="?" and const="auto" - Add PROXY v2 constants (PP_V2_SIGNATURE, PPCommand, PPFamily, PPProtocol) - Add _parse_proxy_protocol_v1() and _parse_proxy_protocol_v2() methods - Update both sync (message.py) and async (asgi/message.py) parsers - Add hex escape handling in treq.py for v2 binary test data - Add test cases for v2 TCPv4 and TCPv6 Backwards compatible: --proxy-protocol alone (or True) maps to "auto". Closes #2912 --- docs/content/reference/settings.md | 26 +++- gunicorn/asgi/message.py | 217 +++++++++++++++++++++------ gunicorn/config.py | 54 ++++++- gunicorn/http/errors.py | 9 ++ gunicorn/http/message.py | 227 ++++++++++++++++++++++++----- tests/requests/valid/pp_03.http | 4 + tests/requests/valid/pp_03.py | 15 ++ tests/requests/valid/pp_04.http | 4 + tests/requests/valid/pp_04.py | 15 ++ tests/requests/valid/pp_05.http | 4 + tests/requests/valid/pp_05.py | 15 ++ tests/test_asgi.py | 7 +- tests/test_gthread.py | 2 +- tests/treq.py | 25 +++- 14 files changed, 522 insertions(+), 102 deletions(-) create mode 100644 tests/requests/valid/pp_03.http create mode 100644 tests/requests/valid/pp_03.py create mode 100644 tests/requests/valid/pp_04.http create mode 100644 tests/requests/valid/pp_04.py create mode 100644 tests/requests/valid/pp_05.http create mode 100644 tests/requests/valid/pp_05.py diff --git a/docs/content/reference/settings.md b/docs/content/reference/settings.md index 7fc136f92..79aecefa3 100644 --- a/docs/content/reference/settings.md +++ b/docs/content/reference/settings.md @@ -1148,16 +1148,27 @@ command line arguments to control server configuration instead. ### `proxy_protocol` -**Command line:** `--proxy-protocol` +**Command line:** `--proxy-protocol MODE` -**Default:** `False` +**Default:** `'off'` + +Enable PROXY protocol support. + +Allow using HTTP and PROXY protocol together. It may be useful for work +with stunnel as HTTPS frontend and Gunicorn as HTTP server, or with +HAProxy. -Enable detect PROXY protocol (PROXY mode). +Accepted values: -Allow using HTTP and Proxy together. It may be useful for work with -stunnel as HTTPS frontend and Gunicorn as HTTP server. +* ``off`` - Disabled (default) +* ``v1`` - PROXY protocol v1 only (text format) +* ``v2`` - PROXY protocol v2 only (binary format) +* ``auto`` - Auto-detect v1 or v2 -PROXY protocol: http://haproxy.1wt.eu/download/1.5/doc/proxy-protocol.txt +Using ``--proxy-protocol`` without a value is equivalent to ``auto``. + +PROXY protocol v1: http://haproxy.1wt.eu/download/1.5/doc/proxy-protocol.txt +PROXY protocol v2: https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt Example for stunnel config:: @@ -1168,6 +1179,9 @@ Example for stunnel config:: cert = /etc/ssl/certs/stunnel.pem key = /etc/ssl/certs/stunnel.key +!!! info "Changed in 24.0.0" + Extended to support version selection (v1, v2, auto). + ### `proxy_allow_ips` **Command line:** `--proxy-allow-from` diff --git a/gunicorn/asgi/message.py b/gunicorn/asgi/message.py index a2d8e8250..1bb26b996 100644 --- a/gunicorn/asgi/message.py +++ b/gunicorn/asgi/message.py @@ -9,17 +9,22 @@ """ import io +import ipaddress import re import socket +import struct from gunicorn.http.errors import ( InvalidHeader, InvalidHeaderName, NoMoreData, InvalidRequestLine, InvalidRequestMethod, InvalidHTTPVersion, LimitRequestLine, LimitRequestHeaders, UnsupportedTransferCoding, ObsoleteFolding, - InvalidProxyLine, ForbiddenProxyRequest, + InvalidProxyLine, InvalidProxyHeader, ForbiddenProxyRequest, InvalidSchemeHeaders, ) +from gunicorn.http.message import ( + PP_V2_SIGNATURE, PPCommand, PPFamily, PPProtocol +) from gunicorn.util import bytes_to_str, split_request_uri MAX_REQUEST_LINE = 8190 @@ -34,6 +39,22 @@ RFC9110_5_5_INVALID_AND_DANGEROUS = re.compile(r"[\0\r\n]") +def _ip_in_allow_list(ip_str, allow_list): + """Check if IP address is in the allow list (which may contain networks).""" + if '*' in allow_list: + return True + try: + ip = ipaddress.ip_address(ip_str) + except ValueError: + return False + for network in allow_list: + if network == '*': + return True + if ip in network: + return True + return False + + class AsyncRequest: """Async HTTP request parser. @@ -111,33 +132,29 @@ async def parse(cls, cfg, unreader, peer_addr, req_number=1): async def _parse(self): """Parse the request from the unreader.""" - buf = io.BytesIO() - await self._get_data(buf, stop=True) + buf = bytearray() + await self._read_into(buf, stop=True) - # Get request line - line, rbuf = await self._read_line(buf, self.limit_request_line) + # Handle proxy protocol if enabled and this is the first request + mode = self.cfg.proxy_protocol + if mode != "off" and self.req_number == 1: + buf = await self._handle_proxy_protocol(buf, mode) - # Proxy protocol - if self._proxy_protocol(bytes_to_str(line)): - # Get next request line - buf = io.BytesIO() - buf.write(rbuf) - line, rbuf = await self._read_line(buf, self.limit_request_line) + # Get request line + line, buf = await self._read_line(buf, self.limit_request_line) self._parse_request_line(line) - buf = io.BytesIO() - buf.write(rbuf) # Headers - data = buf.getvalue() + data = bytes(buf) while True: idx = data.find(b"\r\n\r\n") done = data[:2] == b"\r\n" if idx < 0 and not done: - await self._get_data(buf) - data = buf.getvalue() + await self._read_into(buf) + data = bytes(buf) if len(data) > self.max_buffer_headers: raise LimitRequestHeaders("max buffer headers") else: @@ -151,18 +168,18 @@ async def _parse(self): self._set_body_reader() - async def _get_data(self, buf, stop=False): - """Read data from unreader into buffer.""" + async def _read_into(self, buf, stop=False): + """Read data from unreader and append to bytearray buffer.""" data = await self.unreader.read() if not data: if stop: raise StopIteration() - raise NoMoreData(buf.getvalue()) - buf.write(data) + raise NoMoreData(bytes(buf)) + buf.extend(data) async def _read_line(self, buf, limit=0): - """Read a line from the buffer/stream.""" - data = buf.getvalue() + """Read a line from buffer, returning (line, remaining_buffer).""" + data = bytes(buf) while True: idx = data.find(b"\r\n") @@ -172,36 +189,54 @@ async def _read_line(self, buf, limit=0): break if len(data) - 2 > limit > 0: raise LimitRequestLine(len(data), limit) - await self._get_data(buf) - data = buf.getvalue() + await self._read_into(buf) + data = bytes(buf) - return (data[:idx], data[idx + 2:]) + return (data[:idx], bytearray(data[idx + 2:])) - def _proxy_protocol(self, line): - """Detect, check and parse proxy protocol.""" - if not self.cfg.proxy_protocol: - return False + async def _handle_proxy_protocol(self, buf, mode): + """Handle PROXY protocol detection and parsing. - if self.req_number != 1: - return False + Returns the buffer with proxy protocol data consumed. + """ + # Ensure we have enough data to detect v2 signature (12 bytes) + while len(buf) < 12: + await self._read_into(buf) - if not line.startswith("PROXY"): - return False + # Check for v2 signature first + if mode in ("v2", "auto") and buf[:12] == PP_V2_SIGNATURE: + self._proxy_protocol_access_check() + return await self._parse_proxy_protocol_v2(buf) - self._proxy_protocol_access_check() - self._parse_proxy_protocol(line) + # Check for v1 prefix + if mode in ("v1", "auto") and buf[:6] == b"PROXY ": + self._proxy_protocol_access_check() + return await self._parse_proxy_protocol_v1(buf) - return True + # Not proxy protocol - return buffer unchanged + return buf def _proxy_protocol_access_check(self): """Check if proxy protocol is allowed from this peer.""" - if ("*" not in self.cfg.proxy_allow_ips and - isinstance(self.peer_addr, tuple) and - self.peer_addr[0] not in self.cfg.proxy_allow_ips): + if (isinstance(self.peer_addr, tuple) and + not _ip_in_allow_list(self.peer_addr[0], self.cfg.proxy_allow_ips)): raise ForbiddenProxyRequest(self.peer_addr[0]) - def _parse_proxy_protocol(self, line): - """Parse proxy protocol header line.""" + async def _parse_proxy_protocol_v1(self, buf): + """Parse PROXY protocol v1 (text format). + + Returns buffer with v1 header consumed. + """ + # Read until we find \r\n + data = bytes(buf) + while b"\r\n" not in data: + await self._read_into(buf) + data = bytes(buf) + + idx = data.find(b"\r\n") + line = bytes_to_str(data[:idx]) + remaining = bytearray(data[idx + 2:]) + bits = line.split(" ") if len(bits) != 6: @@ -244,6 +279,101 @@ def _parse_proxy_protocol(self, line): "proxy_port": d_port } + return remaining + + async def _parse_proxy_protocol_v2(self, buf): + """Parse PROXY protocol v2 (binary format). + + Returns buffer with v2 header consumed. + """ + # We need at least 16 bytes for the header (12 signature + 4 header) + while len(buf) < 16: + await self._read_into(buf) + + # Parse header fields (after 12-byte signature) + ver_cmd = buf[12] + fam_proto = buf[13] + length = struct.unpack(">H", bytes(buf[14:16]))[0] + + # Validate version (high nibble must be 0x2) + version = (ver_cmd & 0xF0) >> 4 + if version != 2: + raise InvalidProxyHeader("unsupported version %d" % version) + + # Extract command (low nibble) + command = ver_cmd & 0x0F + if command not in (PPCommand.LOCAL, PPCommand.PROXY): + raise InvalidProxyHeader("unsupported command %d" % command) + + # Ensure we have the complete header + total_header_size = 16 + length + while len(buf) < total_header_size: + await self._read_into(buf) + + # For LOCAL command, no address info is provided + if command == PPCommand.LOCAL: + self.proxy_protocol_info = { + "proxy_protocol": "LOCAL", + "client_addr": None, + "client_port": None, + "proxy_addr": None, + "proxy_port": None + } + return bytearray(buf[total_header_size:]) + + # Extract address family and protocol + family = (fam_proto & 0xF0) >> 4 + protocol = fam_proto & 0x0F + + # We only support TCP (STREAM) + if protocol != PPProtocol.STREAM: + raise InvalidProxyHeader("only TCP protocol is supported") + + addr_data = bytes(buf[16:16 + length]) + + if family == PPFamily.INET: # IPv4 + if length < 12: # 4+4+2+2 + raise InvalidProxyHeader("insufficient address data for IPv4") + s_addr = socket.inet_ntop(socket.AF_INET, addr_data[0:4]) + d_addr = socket.inet_ntop(socket.AF_INET, addr_data[4:8]) + s_port = struct.unpack(">H", addr_data[8:10])[0] + d_port = struct.unpack(">H", addr_data[10:12])[0] + proto = "TCP4" + + elif family == PPFamily.INET6: # IPv6 + if length < 36: # 16+16+2+2 + raise InvalidProxyHeader("insufficient address data for IPv6") + s_addr = socket.inet_ntop(socket.AF_INET6, addr_data[0:16]) + d_addr = socket.inet_ntop(socket.AF_INET6, addr_data[16:32]) + s_port = struct.unpack(">H", addr_data[32:34])[0] + d_port = struct.unpack(">H", addr_data[34:36])[0] + proto = "TCP6" + + elif family == PPFamily.UNSPEC: + # No address info provided with PROXY command + self.proxy_protocol_info = { + "proxy_protocol": "UNSPEC", + "client_addr": None, + "client_port": None, + "proxy_addr": None, + "proxy_port": None + } + return bytearray(buf[total_header_size:]) + + else: + raise InvalidProxyHeader("unsupported address family %d" % family) + + # Set data + self.proxy_protocol_info = { + "proxy_protocol": proto, + "client_addr": s_addr, + "client_port": s_port, + "proxy_addr": d_addr, + "proxy_port": d_port + } + + return bytearray(buf[total_header_size:]) + def _parse_request_line(self, line_bytes): """Parse the HTTP request line.""" bits = [bytes_to_str(bit) for bit in line_bytes.split(b" ", 2)] @@ -299,9 +429,8 @@ def _parse_headers(self, data, from_trailer=False): forwarder_headers = [] if from_trailer: pass - elif ('*' in cfg.forwarded_allow_ips or - not isinstance(self.peer_addr, tuple) - or self.peer_addr[0] in cfg.forwarded_allow_ips): + elif (not isinstance(self.peer_addr, tuple) + or _ip_in_allow_list(self.peer_addr[0], cfg.forwarded_allow_ips)): secure_scheme_headers = cfg.secure_scheme_headers forwarder_headers = cfg.forwarder_headers diff --git a/gunicorn/config.py b/gunicorn/config.py index 663799f26..700c9429f 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -2082,20 +2082,57 @@ def ssl_context(conf, default_ssl_context_factory): """ +def validate_proxy_protocol(val): + """Validate proxy_protocol setting. + + Accepts: off, false, v1, v2, auto, true + Returns normalized value: off, v1, v2, or auto + """ + if val is None: + return "off" + if isinstance(val, bool): + return "auto" if val else "off" + if not isinstance(val, str): + raise TypeError("proxy_protocol must be string or bool") + + val = val.lower().strip() + mapping = { + "false": "off", "off": "off", "0": "off", "none": "off", + "true": "auto", "auto": "auto", "1": "auto", + "v1": "v1", "v2": "v2", + } + if val not in mapping: + raise ValueError("proxy_protocol must be: off, v1, v2, or auto") + return mapping[val] + + class ProxyProtocol(Setting): name = "proxy_protocol" section = "Server Mechanics" cli = ["--proxy-protocol"] - validator = validate_bool - default = False - action = "store_true" + meta = "MODE" + validator = validate_proxy_protocol + default = "off" + nargs = "?" + const = "auto" desc = """\ - Enable detect PROXY protocol (PROXY mode). + Enable PROXY protocol support. - Allow using HTTP and Proxy together. It may be useful for work with - stunnel as HTTPS frontend and Gunicorn as HTTP server. + Allow using HTTP and PROXY protocol together. It may be useful for work + with stunnel as HTTPS frontend and Gunicorn as HTTP server, or with + HAProxy. - PROXY protocol: http://haproxy.1wt.eu/download/1.5/doc/proxy-protocol.txt + Accepted values: + + * ``off`` - Disabled (default) + * ``v1`` - PROXY protocol v1 only (text format) + * ``v2`` - PROXY protocol v2 only (binary format) + * ``auto`` - Auto-detect v1 or v2 + + Using ``--proxy-protocol`` without a value is equivalent to ``auto``. + + PROXY protocol v1: http://haproxy.1wt.eu/download/1.5/doc/proxy-protocol.txt + PROXY protocol v2: https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt Example for stunnel config:: @@ -2105,6 +2142,9 @@ class ProxyProtocol(Setting): connect = 80 cert = /etc/ssl/certs/stunnel.pem key = /etc/ssl/certs/stunnel.key + + .. versionchanged:: 24.0.0 + Extended to support version selection (v1, v2, auto). """ diff --git a/gunicorn/http/errors.py b/gunicorn/http/errors.py index bcb970072..e9c24917b 100644 --- a/gunicorn/http/errors.py +++ b/gunicorn/http/errors.py @@ -131,6 +131,15 @@ def __str__(self): return "Invalid PROXY line: %r" % self.line +class InvalidProxyHeader(ParseException): + def __init__(self, msg): + self.msg = msg + self.code = 400 + + def __str__(self): + return "Invalid PROXY header: %s" % self.msg + + class ForbiddenProxyRequest(ParseException): def __init__(self, host): self.host = host diff --git a/gunicorn/http/message.py b/gunicorn/http/message.py index 4e8dd4447..81132b342 100644 --- a/gunicorn/http/message.py +++ b/gunicorn/http/message.py @@ -2,10 +2,11 @@ # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. -import io +from enum import IntEnum import ipaddress import re import socket +import struct from gunicorn.http.body import ChunkedReader, LengthReader, EOFReader, Body from gunicorn.http.errors import ( @@ -14,10 +15,36 @@ LimitRequestLine, LimitRequestHeaders, UnsupportedTransferCoding, ObsoleteFolding, ) -from gunicorn.http.errors import InvalidProxyLine, ForbiddenProxyRequest +from gunicorn.http.errors import InvalidProxyLine, InvalidProxyHeader, ForbiddenProxyRequest from gunicorn.http.errors import InvalidSchemeHeaders from gunicorn.util import bytes_to_str, split_request_uri + +# PROXY protocol v2 constants +PP_V2_SIGNATURE = b"\x0D\x0A\x0D\x0A\x00\x0D\x0A\x51\x55\x49\x54\x0A" + + +class PPCommand(IntEnum): + """PROXY protocol v2 commands.""" + LOCAL = 0x0 + PROXY = 0x1 + + +class PPFamily(IntEnum): + """PROXY protocol v2 address families.""" + UNSPEC = 0x0 + INET = 0x1 # IPv4 + INET6 = 0x2 # IPv6 + UNIX = 0x3 + + +class PPProtocol(IntEnum): + """PROXY protocol v2 transport protocols.""" + UNSPEC = 0x0 + STREAM = 0x1 # TCP + DGRAM = 0x2 # UDP + + MAX_REQUEST_LINE = 8190 MAX_HEADERS = 32768 DEFAULT_MAX_HEADERFIELD_SIZE = 8190 @@ -283,26 +310,21 @@ def get_data(self, unreader, buf, stop=False): buf.write(data) def parse(self, unreader): - buf = io.BytesIO() - self.get_data(unreader, buf, stop=True) + buf = bytearray() + self.read_into(unreader, buf, stop=True) - # get request line - line, rbuf = self.read_line(unreader, buf, self.limit_request_line) + # Handle proxy protocol if enabled and this is the first request + mode = self.cfg.proxy_protocol + if mode != "off" and self.req_number == 1: + buf = self._handle_proxy_protocol(unreader, buf, mode) - # proxy protocol - if self.proxy_protocol(bytes_to_str(line)): - # get next request line - buf = io.BytesIO() - buf.write(rbuf) - line, rbuf = self.read_line(unreader, buf, self.limit_request_line) + # Get request line + line, buf = self.read_line(unreader, buf, self.limit_request_line) self.parse_request_line(line) - buf = io.BytesIO() - buf.write(rbuf) # Headers - data = buf.getvalue() - idx = data.find(b"\r\n\r\n") + data = bytes(buf) done = data[:2] == b"\r\n" while True: @@ -310,8 +332,8 @@ def parse(self, unreader): done = data[:2] == b"\r\n" if idx < 0 and not done: - self.get_data(unreader, buf) - data = buf.getvalue() + self.read_into(unreader, buf) + data = bytes(buf) if len(data) > self.max_buffer_headers: raise LimitRequestHeaders("max buffer headers") else: @@ -324,11 +346,20 @@ def parse(self, unreader): self.headers = self.parse_headers(data[:idx], from_trailer=False) ret = data[idx + 4:] - buf = None return ret + def read_into(self, unreader, buf, stop=False): + """Read data from unreader and append to bytearray buffer.""" + data = unreader.read() + if not data: + if stop: + raise StopIteration() + raise NoMoreData(bytes(buf)) + buf.extend(data) + def read_line(self, unreader, buf, limit=0): - data = buf.getvalue() + """Read a line from buffer, returning (line, remaining_buffer).""" + data = bytes(buf) while True: idx = data.find(b"\r\n") @@ -339,40 +370,61 @@ def read_line(self, unreader, buf, limit=0): break if len(data) - 2 > limit > 0: raise LimitRequestLine(len(data), limit) - self.get_data(unreader, buf) - data = buf.getvalue() + self.read_into(unreader, buf) + data = bytes(buf) return (data[:idx], # request line, - data[idx + 2:]) # residue in the buffer, skip \r\n + bytearray(data[idx + 2:])) # residue in the buffer, skip \r\n - def proxy_protocol(self, line): - """\ - Detect, check and parse proxy protocol. + def read_bytes(self, unreader, buf, count): + """Read exactly count bytes from buffer/unreader.""" + while len(buf) < count: + self.read_into(unreader, buf) + return bytes(buf[:count]), bytearray(buf[count:]) - :raises: ForbiddenProxyRequest, InvalidProxyLine. - :return: True for proxy protocol line else False - """ - if not self.cfg.proxy_protocol: - return False + def _handle_proxy_protocol(self, unreader, buf, mode): + """Handle PROXY protocol detection and parsing. - if self.req_number != 1: - return False + Returns the buffer with proxy protocol data consumed. + """ + # Ensure we have enough data to detect v2 signature (12 bytes) + while len(buf) < 12: + self.read_into(unreader, buf) - if not line.startswith("PROXY"): - return False + # Check for v2 signature first + if mode in ("v2", "auto") and buf[:12] == PP_V2_SIGNATURE: + self.proxy_protocol_access_check() + return self._parse_proxy_protocol_v2(unreader, buf) - self.proxy_protocol_access_check() - self.parse_proxy_protocol(line) + # Check for v1 prefix + if mode in ("v1", "auto") and buf[:6] == b"PROXY ": + self.proxy_protocol_access_check() + return self._parse_proxy_protocol_v1(unreader, buf) - return True + # Not proxy protocol - return buffer unchanged + return buf def proxy_protocol_access_check(self): - # check in allow list + """Check if proxy protocol is allowed from this peer.""" if (isinstance(self.peer_addr, tuple) and not _ip_in_allow_list(self.peer_addr[0], self.cfg.proxy_allow_ips)): raise ForbiddenProxyRequest(self.peer_addr[0]) - def parse_proxy_protocol(self, line): + def _parse_proxy_protocol_v1(self, unreader, buf): + """Parse PROXY protocol v1 (text format). + + Returns buffer with v1 header consumed. + """ + # Read until we find \r\n + data = bytes(buf) + while b"\r\n" not in data: + self.read_into(unreader, buf) + data = bytes(buf) + + idx = data.find(b"\r\n") + line = bytes_to_str(data[:idx]) + remaining = bytearray(data[idx + 2:]) + bits = line.split(" ") if len(bits) != 6: @@ -417,6 +469,101 @@ def parse_proxy_protocol(self, line): "proxy_port": d_port } + return remaining + + def _parse_proxy_protocol_v2(self, unreader, buf): + """Parse PROXY protocol v2 (binary format). + + Returns buffer with v2 header consumed. + """ + # We need at least 16 bytes for the header (12 signature + 4 header) + while len(buf) < 16: + self.read_into(unreader, buf) + + # Parse header fields (after 12-byte signature) + ver_cmd = buf[12] + fam_proto = buf[13] + length = struct.unpack(">H", bytes(buf[14:16]))[0] + + # Validate version (high nibble must be 0x2) + version = (ver_cmd & 0xF0) >> 4 + if version != 2: + raise InvalidProxyHeader("unsupported version %d" % version) + + # Extract command (low nibble) + command = ver_cmd & 0x0F + if command not in (PPCommand.LOCAL, PPCommand.PROXY): + raise InvalidProxyHeader("unsupported command %d" % command) + + # Ensure we have the complete header + total_header_size = 16 + length + while len(buf) < total_header_size: + self.read_into(unreader, buf) + + # For LOCAL command, no address info is provided + if command == PPCommand.LOCAL: + self.proxy_protocol_info = { + "proxy_protocol": "LOCAL", + "client_addr": None, + "client_port": None, + "proxy_addr": None, + "proxy_port": None + } + return bytearray(buf[total_header_size:]) + + # Extract address family and protocol + family = (fam_proto & 0xF0) >> 4 + protocol = fam_proto & 0x0F + + # We only support TCP (STREAM) + if protocol != PPProtocol.STREAM: + raise InvalidProxyHeader("only TCP protocol is supported") + + addr_data = bytes(buf[16:16 + length]) + + if family == PPFamily.INET: # IPv4 + if length < 12: # 4+4+2+2 + raise InvalidProxyHeader("insufficient address data for IPv4") + s_addr = socket.inet_ntop(socket.AF_INET, addr_data[0:4]) + d_addr = socket.inet_ntop(socket.AF_INET, addr_data[4:8]) + s_port = struct.unpack(">H", addr_data[8:10])[0] + d_port = struct.unpack(">H", addr_data[10:12])[0] + proto = "TCP4" + + elif family == PPFamily.INET6: # IPv6 + if length < 36: # 16+16+2+2 + raise InvalidProxyHeader("insufficient address data for IPv6") + s_addr = socket.inet_ntop(socket.AF_INET6, addr_data[0:16]) + d_addr = socket.inet_ntop(socket.AF_INET6, addr_data[16:32]) + s_port = struct.unpack(">H", addr_data[32:34])[0] + d_port = struct.unpack(">H", addr_data[34:36])[0] + proto = "TCP6" + + elif family == PPFamily.UNSPEC: + # No address info provided with PROXY command + self.proxy_protocol_info = { + "proxy_protocol": "UNSPEC", + "client_addr": None, + "client_port": None, + "proxy_addr": None, + "proxy_port": None + } + return bytearray(buf[total_header_size:]) + + else: + raise InvalidProxyHeader("unsupported address family %d" % family) + + # Set data + self.proxy_protocol_info = { + "proxy_protocol": proto, + "client_addr": s_addr, + "client_port": s_port, + "proxy_addr": d_addr, + "proxy_port": d_port + } + + return bytearray(buf[total_header_size:]) + def parse_request_line(self, line_bytes): bits = [bytes_to_str(bit) for bit in line_bytes.split(b" ", 2)] if len(bits) != 3: diff --git a/tests/requests/valid/pp_03.http b/tests/requests/valid/pp_03.http new file mode 100644 index 000000000..5a2f784f2 --- /dev/null +++ b/tests/requests/valid/pp_03.http @@ -0,0 +1,4 @@ +GET /no/proxy/header HTTP/1.1\r\n +Host: example.com\r\n +Content-Length: 0\r\n +\r\n diff --git a/tests/requests/valid/pp_03.py b/tests/requests/valid/pp_03.py new file mode 100644 index 000000000..70112876a --- /dev/null +++ b/tests/requests/valid/pp_03.py @@ -0,0 +1,15 @@ +from gunicorn.config import Config + +cfg = Config() +cfg.set("proxy_protocol", True) + +request = { + "method": "GET", + "uri": uri("/no/proxy/header"), + "version": (1, 1), + "headers": [ + ("HOST", "example.com"), + ("CONTENT-LENGTH", "0") + ], + "body": b"" +} diff --git a/tests/requests/valid/pp_04.http b/tests/requests/valid/pp_04.http new file mode 100644 index 000000000..f4e9ec956 --- /dev/null +++ b/tests/requests/valid/pp_04.http @@ -0,0 +1,4 @@ +\x0D\x0A\x0D\x0A\x00\x0D\x0A\x51\x55\x49\x54\x0A\x21\x11\x00\x0C\xC0\xA8\x01\x0A\xC0\xA8\x01\x01\x30\x39\x01\xBBGET /proxy/v2/ipv4 HTTP/1.1\r\n +Host: example.com\r\n +Content-Length: 0\r\n +\r\n diff --git a/tests/requests/valid/pp_04.py b/tests/requests/valid/pp_04.py new file mode 100644 index 000000000..cbf6e7a8c --- /dev/null +++ b/tests/requests/valid/pp_04.py @@ -0,0 +1,15 @@ +from gunicorn.config import Config + +cfg = Config() +cfg.set("proxy_protocol", True) + +request = { + "method": "GET", + "uri": uri("/proxy/v2/ipv4"), + "version": (1, 1), + "headers": [ + ("HOST", "example.com"), + ("CONTENT-LENGTH", "0") + ], + "body": b"" +} diff --git a/tests/requests/valid/pp_05.http b/tests/requests/valid/pp_05.http new file mode 100644 index 000000000..616bde295 --- /dev/null +++ b/tests/requests/valid/pp_05.http @@ -0,0 +1,4 @@ +\x0D\x0A\x0D\x0A\x00\x0D\x0A\x51\x55\x49\x54\x0A\x21\x21\x00\x24\x20\x01\x0D\xB8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x20\x01\x0D\xB8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xD4\x31\x00\x50GET /proxy/v2/ipv6 HTTP/1.1\r\n +Host: example.com\r\n +Content-Length: 0\r\n +\r\n diff --git a/tests/requests/valid/pp_05.py b/tests/requests/valid/pp_05.py new file mode 100644 index 000000000..80e2b7645 --- /dev/null +++ b/tests/requests/valid/pp_05.py @@ -0,0 +1,15 @@ +from gunicorn.config import Config + +cfg = Config() +cfg.set("proxy_protocol", True) + +request = { + "method": "GET", + "uri": uri("/proxy/v2/ipv6"), + "version": (1, 1), + "headers": [ + ("HOST", "example.com"), + ("CONTENT-LENGTH", "0") + ], + "body": b"" +} diff --git a/tests/test_asgi.py b/tests/test_asgi.py index 227f7ea2c..e39ae91a7 100644 --- a/tests/test_asgi.py +++ b/tests/test_asgi.py @@ -8,6 +8,7 @@ import asyncio import io +import ipaddress import pytest from unittest import mock @@ -48,9 +49,9 @@ class MockConfig: def __init__(self): self.is_ssl = False - self.proxy_protocol = False - self.proxy_allow_ips = ["127.0.0.1"] - self.forwarded_allow_ips = ["127.0.0.1"] + self.proxy_protocol = "off" + self.proxy_allow_ips = [ipaddress.ip_network("127.0.0.1")] + self.forwarded_allow_ips = [ipaddress.ip_network("127.0.0.1")] self.secure_scheme_headers = {} self.forwarder_headers = [] self.limit_request_line = 8190 diff --git a/tests/test_gthread.py b/tests/test_gthread.py index 0762cc99b..b8839fa13 100644 --- a/tests/test_gthread.py +++ b/tests/test_gthread.py @@ -1385,7 +1385,7 @@ def mock_wsgi(environ, start_response): conn.parser = mock_parser # Mock handle_request to invoke wsgi - original_handle_request = worker.handle_request + _ = worker.handle_request # save reference before overwriting def mock_handle_request(req, conn): # Simplified version that just calls wsgi diff --git a/tests/treq.py b/tests/treq.py index fbe54700e..e341780cd 100644 --- a/tests/treq.py +++ b/tests/treq.py @@ -39,6 +39,27 @@ def load_py(fname): return vars(mod) +def decode_hex_escapes(data): + """Decode hex escape sequences like \\xAB in test data.""" + import re + result = bytearray() + i = 0 + while i < len(data): + # Check for \xHH hex escape + if i + 3 < len(data) and data[i:i+2] == b'\\x': + hex_chars = data[i+2:i+4] + try: + byte_val = int(hex_chars, 16) + result.append(byte_val) + i += 4 + continue + except ValueError: + pass + result.append(data[i]) + i += 1 + return bytes(result) + + class request: def __init__(self, fname, expect): self.fname = fname @@ -52,8 +73,10 @@ def __init__(self, fname, expect): self.data = handle.read() self.data = self.data.replace(b"\n", b"").replace(b"\\r\\n", b"\r\n") self.data = self.data.replace(b"\\0", b"\000").replace(b"\\n", b"\n").replace(b"\\t", b"\t") + # Handle hex escape sequences for binary data (e.g., \x0D for PROXY v2) + self.data = decode_hex_escapes(self.data) if b"\\" in self.data: - raise AssertionError("Unexpected backslash in test data - only handling HTAB, NUL and CRLF") + raise AssertionError("Unexpected backslash in test data - only handling HTAB, NUL, CRLF, and hex escapes") # Functions for sending data to the parser. # These functions mock out reading from a From 7894d1c170a6176b024b5a899017a80a90af1baa Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 18:47:17 +0100 Subject: [PATCH 072/356] release: prepare 24.1.0 - Bump version to 24.1.0 - Add PROXY protocol v2 documentation to deploy guide - Add 24.1.0 changelog with new features and bug fixes - Update all docs.gunicorn.org URLs to gunicorn.org --- .github/DISCUSSION_TEMPLATE/issue-triage.yml | 2 +- .github/DISCUSSION_TEMPLATE/question.yml | 6 +- docs/content/2012-news.md | 2 +- docs/content/2014-news.md | 4 +- docs/content/2026-news.md | 56 +++++++++++++ docs/content/deploy.md | 86 ++++++++++++++++++++ docs/content/reference/settings.md | 2 +- examples/example_config.py | 4 +- gunicorn/__init__.py | 2 +- gunicorn/config.py | 2 +- pyproject.toml | 4 +- 11 files changed, 156 insertions(+), 14 deletions(-) diff --git a/.github/DISCUSSION_TEMPLATE/issue-triage.yml b/.github/DISCUSSION_TEMPLATE/issue-triage.yml index aad41527e..68862a977 100644 --- a/.github/DISCUSSION_TEMPLATE/issue-triage.yml +++ b/.github/DISCUSSION_TEMPLATE/issue-triage.yml @@ -9,7 +9,7 @@ body: **Before submitting, please:** - Search [existing discussions](https://github.com/benoitc/gunicorn/discussions) and [issues](https://github.com/benoitc/gunicorn/issues) for duplicates - - Check the [FAQ](https://docs.gunicorn.org/en/latest/faq.html) and [documentation](https://docs.gunicorn.org/) + - Check the [FAQ](https://gunicorn.org/faq/) and [documentation](https://gunicorn.org/) - type: dropdown id: type diff --git a/.github/DISCUSSION_TEMPLATE/question.yml b/.github/DISCUSSION_TEMPLATE/question.yml index 2e3436324..8f6abd347 100644 --- a/.github/DISCUSSION_TEMPLATE/question.yml +++ b/.github/DISCUSSION_TEMPLATE/question.yml @@ -6,9 +6,9 @@ body: Have a question about Gunicorn? Before asking, please check: - - [Documentation](https://docs.gunicorn.org/) - - [FAQ](https://docs.gunicorn.org/en/latest/faq.html) - - [Settings Reference](https://docs.gunicorn.org/en/latest/settings.html) + - [Documentation](https://gunicorn.org/) + - [FAQ](https://gunicorn.org/faq/) + - [Settings Reference](https://gunicorn.org/reference/settings/) - [Existing discussions](https://github.com/benoitc/gunicorn/discussions) - type: textarea diff --git a/docs/content/2012-news.md b/docs/content/2012-news.md index 7d3380467..31f11e31e 100644 --- a/docs/content/2012-news.md +++ b/docs/content/2012-news.md @@ -29,7 +29,7 @@ ## 0.15.0 / 2012-10-18 -- new documentation site on http://docs.gunicorn.org +- new documentation site on https://gunicorn.org - new website on http://gunicorn.org - add `haproxy PROXY protocol `_ support - add ForwardedAllowIPS option: allows to filter Front-end's IPs diff --git a/docs/content/2014-news.md b/docs/content/2014-news.md index ed1937c2b..f9149cfb7 100644 --- a/docs/content/2014-news.md +++ b/docs/content/2014-news.md @@ -80,7 +80,7 @@ ### Documentation - update faq: put a note on how `watch logs in the console - `_ + `_ since many people asked for it. @@ -88,7 +88,7 @@ Gunicorn 19.0 is a major release with new features and fixes. This version improve a lot the usage of Gunicorn with python 3 by adding `two -new workers `_ +new workers `_ to it: `gthread` a fully threaded async worker using futures and `gaiohttp` a worker using asyncio. diff --git a/docs/content/2026-news.md b/docs/content/2026-news.md index 2c9bd8d66..a5c3857af 100644 --- a/docs/content/2026-news.md +++ b/docs/content/2026-news.md @@ -1,6 +1,62 @@ # Changelog - 2026 +## 24.1.0 - 2026-01-23 + +### New Features + +- **PROXY Protocol v2 Support**: Extended PROXY protocol implementation to support + the binary v2 format in addition to the existing text-based v1 format + ([PR #3451](https://github.com/benoitc/gunicorn/pull/3451)) + - New `--proxy-protocol` modes: `off`, `v1`, `v2`, `auto` + - `auto` mode (default when enabled) detects v1 or v2 automatically + - v2 binary format is more efficient and supports additional metadata + - Works with HAProxy, AWS NLB/ALB, and other PROXY protocol v2 sources + +- **CIDR Network Support**: `--forwarded-allow-ips` and `--proxy-allow-from` now + accept CIDR notation (e.g., `192.168.0.0/16`) for specifying trusted networks + ([PR #3449](https://github.com/benoitc/gunicorn/pull/3449)) + +- **Socket Backlog Metric**: New `gunicorn.socket.backlog` gauge metric reports + the current socket backlog size on Linux systems + ([PR #3450](https://github.com/benoitc/gunicorn/pull/3450)) + +- **InotifyReloader Enhancement**: The inotify-based reloader now watches newly + imported modules, not just those loaded at startup + ([PR #3447](https://github.com/benoitc/gunicorn/pull/3447)) + +### Bug Fixes + +- Fix socket blocking mode on keepalive connections preventing SSL handshake + failures with async workers + ([PR #3452](https://github.com/benoitc/gunicorn/pull/3452)) + +- Use smaller buffer size in `finish_body()` for faster timeout detection on + slow or abandoned connections + ([PR #3453](https://github.com/benoitc/gunicorn/pull/3453)) + +- Handle `SSLWantReadError` in `finish_body()` to prevent worker hangs during + SSL renegotiation + ([PR #3448](https://github.com/benoitc/gunicorn/pull/3448)) + +- Log SIGTERM as info level instead of warning to reduce noise in orchestrated + environments + ([PR #3446](https://github.com/benoitc/gunicorn/pull/3446)) + +- Print exception details to stderr when worker fails to boot + ([PR #3443](https://github.com/benoitc/gunicorn/pull/3443)) + +- Fix `unreader.unread()` to prepend data to buffer instead of appending + ([PR #3442](https://github.com/benoitc/gunicorn/pull/3442)) + +- Prevent `RecursionError` when pickling Config objects + ([PR #3441](https://github.com/benoitc/gunicorn/pull/3441)) + +- Use proper exception chaining with `raise from` in glogging.py + ([PR #3440](https://github.com/benoitc/gunicorn/pull/3440)) + +--- + ## 24.0.0 - 2026-01-23 ### New Features diff --git a/docs/content/deploy.md b/docs/content/deploy.md index 435bc426f..63b807d9a 100644 --- a/docs/content/deploy.md +++ b/docs/content/deploy.md @@ -78,6 +78,92 @@ proxy IP rather than the upstream client. To log the real client address, set When binding Gunicorn to a UNIX socket `REMOTE_ADDR` will be empty. +## PROXY Protocol + +The [PROXY protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) +allows load balancers and reverse proxies to pass original client connection +information (IP address, port) to backend servers. This is especially useful +when TLS termination happens at the proxy layer. + +Gunicorn supports both PROXY protocol v1 (text format) and v2 (binary format). + +### Configuration + +Enable PROXY protocol with the `--proxy-protocol` option: + +```bash +# Auto-detect v1 or v2 (recommended) +gunicorn --proxy-protocol auto app:app + +# Force v1 only (text format) +gunicorn --proxy-protocol v1 app:app + +# Force v2 only (binary format, more efficient) +gunicorn --proxy-protocol v2 app:app +``` + +Using `--proxy-protocol` without a value is equivalent to `auto`. + +!!! warning "Security" + Only enable PROXY protocol when Gunicorn is behind a trusted proxy that sends + PROXY headers. Configure [`--proxy-allow-from`](reference/settings.md#proxy_allow_ips) + to restrict which IPs can send PROXY protocol headers. + +### HAProxy + +HAProxy can send PROXY protocol headers to backends. Example configuration: + +```haproxy +frontend https_front + bind *:443 ssl crt /etc/ssl/certs/site.pem + default_backend gunicorn_back + +backend gunicorn_back + # Send PROXY protocol v2 (binary, more efficient) + server gunicorn 127.0.0.1:8000 send-proxy-v2 + + # Or use v1 (text format) + # server gunicorn 127.0.0.1:8000 send-proxy +``` + +Start Gunicorn to accept PROXY protocol: + +```bash +gunicorn -b 127.0.0.1:8000 --proxy-protocol v2 --proxy-allow-from 127.0.0.1 app:app +``` + +### stunnel + +[stunnel](https://www.stunnel.org/) can terminate TLS and forward connections +with PROXY protocol headers: + +```ini +# /etc/stunnel/stunnel.conf +[https] +accept = 443 +connect = 127.0.0.1:8000 +cert = /etc/ssl/certs/stunnel.pem +key = /etc/ssl/certs/stunnel.key +protocol = proxy +``` + +The `protocol = proxy` directive tells stunnel to prepend PROXY protocol v1 +headers to forwarded connections. + +### AWS/ELB + +AWS Network Load Balancers (NLB) and Application Load Balancers (ALB) support +PROXY protocol v2. Enable it in the target group settings, then configure +Gunicorn: + +```bash +gunicorn --proxy-protocol v2 --proxy-allow-from '*' app:app +``` + +!!! note + When using `--proxy-allow-from '*'` ensure Gunicorn is not directly + accessible from the internet—only through the load balancer. + ## Using virtual environments Install Gunicorn inside your project diff --git a/docs/content/reference/settings.md b/docs/content/reference/settings.md index 79aecefa3..76b58d5b6 100644 --- a/docs/content/reference/settings.md +++ b/docs/content/reference/settings.md @@ -1179,7 +1179,7 @@ Example for stunnel config:: cert = /etc/ssl/certs/stunnel.pem key = /etc/ssl/certs/stunnel.key -!!! info "Changed in 24.0.0" +!!! info "Changed in 24.1.0" Extended to support version selection (v1, v2, auto). ### `proxy_allow_ips` diff --git a/examples/example_config.py b/examples/example_config.py index 592882424..f42b3d863 100644 --- a/examples/example_config.py +++ b/examples/example_config.py @@ -34,14 +34,14 @@ # worker_class - The type of workers to use. The default # sync class should handle most 'normal' types of work # loads. You'll want to read -# http://docs.gunicorn.org/en/latest/design.html#choosing-a-worker-type +# https://gunicorn.org/design/#choosing-a-worker-type # for information on when you might want to choose one # of the other worker classes. # # A string referring to a Python path to a subclass of # gunicorn.workers.base.Worker. The default provided values # can be seen at -# http://docs.gunicorn.org/en/latest/settings.html#worker-class +# https://gunicorn.org/reference/settings/#worker_class # # worker_connections - For the eventlet and gevent worker classes # this limits the maximum number of simultaneous clients that diff --git a/gunicorn/__init__.py b/gunicorn/__init__.py index 347557ce8..8b90daf11 100644 --- a/gunicorn/__init__.py +++ b/gunicorn/__init__.py @@ -2,7 +2,7 @@ # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. -version_info = (24, 0, 0) +version_info = (24, 1, 0) __version__ = ".".join([str(v) for v in version_info]) SERVER = "gunicorn" SERVER_SOFTWARE = "%s/%s" % (SERVER, __version__) diff --git a/gunicorn/config.py b/gunicorn/config.py index 700c9429f..58141e55b 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -2143,7 +2143,7 @@ class ProxyProtocol(Setting): cert = /etc/ssl/certs/stunnel.pem key = /etc/ssl/certs/stunnel.key - .. versionchanged:: 24.0.0 + .. versionchanged:: 24.1.0 Extended to support version selection (v1, v2, auto). """ diff --git a/pyproject.toml b/pyproject.toml index c176784f6..5bdf6e952 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,10 +41,10 @@ dynamic = ["version"] [project.urls] Homepage = "https://gunicorn.org" -Documentation = "https://docs.gunicorn.org" +Documentation = "https://gunicorn.org" "Issue tracker" = "https://github.com/benoitc/gunicorn/issues" "Source code" = "https://github.com/benoitc/gunicorn" -Changelog = "https://docs.gunicorn.org/en/stable/news.html" +Changelog = "https://gunicorn.org/news/" [project.optional-dependencies] gevent = ["gevent>=24.10.1"] From 469110d6477b5c80de6da9661b18cff093a08e78 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 18:57:21 +0100 Subject: [PATCH 073/356] feat: add official Docker image with GHCR publishing workflow - Add docker/Dockerfile with non-root user and configurable environment - Add GitHub Actions workflow to build multi-platform images (amd64/arm64) - Publish to ghcr.io/benoitc/gunicorn on version tags - Update documentation with official image usage examples --- .github/workflows/docker-publish.yml | 57 +++++++++++++++++++++ docker/.dockerignore | 8 +++ docker/Dockerfile | 31 ++++++++++++ docker/docker-entrypoint.sh | 33 ++++++++++++ docs/content/guides/docker.md | 75 ++++++++++++++++++++++++++++ docs/content/install.md | 4 +- 6 files changed, 206 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/docker-publish.yml create mode 100644 docker/.dockerignore create mode 100644 docker/Dockerfile create mode 100644 docker/docker-entrypoint.sh diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 000000000..8054947df --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,57 @@ +name: Docker Publish +on: + push: + tags: + - 'v*' + workflow_dispatch: + +permissions: + contents: read + packages: write + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push: + name: Build and Push Docker Image + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=raw,value=latest,enable={{is_default_branch}} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + file: docker/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/docker/.dockerignore b/docker/.dockerignore new file mode 100644 index 000000000..32f0329d4 --- /dev/null +++ b/docker/.dockerignore @@ -0,0 +1,8 @@ +.git +.github +__pycache__ +*.pyc +.pytest_cache +.tox +docs +tests diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 000000000..1b27c1738 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,31 @@ +FROM python:3.12-slim + +LABEL org.opencontainers.image.source=https://github.com/benoitc/gunicorn +LABEL org.opencontainers.image.description="Gunicorn Python WSGI HTTP Server" +LABEL org.opencontainers.image.licenses=MIT + +# Create non-root user +RUN useradd --create-home --shell /bin/bash gunicorn + +WORKDIR /app + +# Install gunicorn +RUN pip install --no-cache-dir gunicorn + +# Copy entrypoint script +COPY docker/docker-entrypoint.sh /usr/local/bin/ +RUN chmod +x /usr/local/bin/docker-entrypoint.sh + +# Configuration via environment: +# GUNICORN_BIND - full bind address (default: [::]:8000, IPv4+IPv6) +# GUNICORN_HOST - bind host (default: [::]) +# GUNICORN_PORT - bind port (default: 8000) +# GUNICORN_WORKERS - number of workers (default: number of CPUs) +# GUNICORN_ARGS - additional arguments (e.g., "--timeout 120") + +USER gunicorn + +EXPOSE 8000 + +ENTRYPOINT ["docker-entrypoint.sh"] +CMD ["--help"] diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh new file mode 100644 index 000000000..2ac91149b --- /dev/null +++ b/docker/docker-entrypoint.sh @@ -0,0 +1,33 @@ +#!/bin/bash +set -e + +# Allow running other commands (e.g., bash for debugging) +if [ "${1:0:1}" = '-' ] || [ -z "${1##*:*}" ]; then + # First arg is a flag or contains ':' (app:callable), run gunicorn + + # Build bind address from GUNICORN_HOST and GUNICORN_PORT, or use GUNICORN_BIND + # Default: listen on both IPv4 and IPv6 + PORT="${GUNICORN_PORT:-8000}" + BIND="${GUNICORN_BIND:-${GUNICORN_HOST:-[::]}:${PORT}}" + + # Add bind if not specified in args or GUNICORN_ARGS + if [[ ! " $* $GUNICORN_ARGS " =~ " --bind " ]] && [[ ! " $* $GUNICORN_ARGS " =~ " -b " ]] && [[ ! "$* $GUNICORN_ARGS" =~ --bind= ]] && [[ ! "$* $GUNICORN_ARGS" =~ -b= ]]; then + set -- --bind "$BIND" "$@" + fi + + # Add workers if not specified - default to number of CPUs + if [[ ! " $* $GUNICORN_ARGS " =~ " --workers " ]] && [[ ! " $* $GUNICORN_ARGS " =~ " -w " ]] && [[ ! "$* $GUNICORN_ARGS" =~ --workers= ]] && [[ ! "$* $GUNICORN_ARGS" =~ -w= ]]; then + WORKERS="${GUNICORN_WORKERS:-$(nproc)}" + set -- --workers "$WORKERS" "$@" + fi + + # Append GUNICORN_ARGS if set + if [ -n "$GUNICORN_ARGS" ]; then + exec gunicorn $GUNICORN_ARGS "$@" + fi + + exec gunicorn "$@" +fi + +# Otherwise, run the command as-is (e.g., bash, sh, python) +exec "$@" diff --git a/docs/content/guides/docker.md b/docs/content/guides/docker.md index 036b38b1a..0c9d49eb0 100644 --- a/docs/content/guides/docker.md +++ b/docs/content/guides/docker.md @@ -4,6 +4,81 @@ Running Gunicorn in Docker containers is the most common deployment pattern for modern Python applications. This guide covers best practices for containerizing Gunicorn applications. +## Official Docker Image + +Gunicorn provides an official Docker image on GitHub Container Registry: + +```bash +docker pull ghcr.io/benoitc/gunicorn:latest +``` + +### Quick Start + +Mount your application directory and run: + +```bash +docker run -p 8000:8000 -v $(pwd):/app ghcr.io/benoitc/gunicorn app:app +``` + +### Environment Variables + +| Variable | Description | Default | +|----------|-------------|---------| +| `GUNICORN_BIND` | Full bind address | `[::]:8000` (IPv4+IPv6) | +| `GUNICORN_HOST` | Bind host | `[::]` | +| `GUNICORN_PORT` | Bind port | `8000` | +| `GUNICORN_WORKERS` | Number of workers | Number of CPUs | +| `GUNICORN_ARGS` | Additional arguments | (none) | + +### With Configuration + +```bash +docker run -p 9000:9000 -v $(pwd):/app \ + -e GUNICORN_PORT=9000 \ + -e GUNICORN_WORKERS=4 \ + -e GUNICORN_ARGS="--timeout 120 --access-logfile -" \ + ghcr.io/benoitc/gunicorn app:app +``` + +### As Base Image (Recommended for Production) + +```dockerfile +FROM ghcr.io/benoitc/gunicorn:24.1.0 + +# Install app dependencies +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Copy application +COPY --chown=gunicorn:gunicorn . . + +CMD ["myapp:app", "--workers", "4"] +``` + +### With Docker Compose + +```yaml +services: + web: + image: ghcr.io/benoitc/gunicorn:latest + ports: + - "8000:8000" + volumes: + - ./app:/app + command: ["myapp:app", "--workers", "4"] +``` + +### Available Tags + +- `ghcr.io/benoitc/gunicorn:latest` - Latest release +- `ghcr.io/benoitc/gunicorn:24.1.0` - Specific version +- `ghcr.io/benoitc/gunicorn:24.1` - Minor version +- `ghcr.io/benoitc/gunicorn:24` - Major version + +## Building Your Own Image + +For more control, build a custom image using the patterns below. + ## Basic Dockerfile ```dockerfile diff --git a/docs/content/install.md b/docs/content/install.md index 27c73fed5..95b68df9d 100644 --- a/docs/content/install.md +++ b/docs/content/install.md @@ -20,8 +20,8 @@ === "Docker" ```bash - docker run -p 8000:8000 -v $(pwd):/app -w /app \ - python:3.12-slim sh -c "pip install gunicorn && gunicorn app:app" + docker pull ghcr.io/benoitc/gunicorn:latest + docker run -p 8000:8000 -v $(pwd):/app ghcr.io/benoitc/gunicorn app:app ``` See the [Docker guide](guides/docker.md) for production configurations. From 4e656d3a91792ca719f84160c6d5215c7d4a7e36 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 19:13:47 +0100 Subject: [PATCH 074/356] fix: use documented worker formula (2 * CPU + 1) in Docker image --- docker/Dockerfile | 2 +- docker/docker-entrypoint.sh | 4 ++-- docs/content/guides/docker.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 1b27c1738..0aae43534 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -20,7 +20,7 @@ RUN chmod +x /usr/local/bin/docker-entrypoint.sh # GUNICORN_BIND - full bind address (default: [::]:8000, IPv4+IPv6) # GUNICORN_HOST - bind host (default: [::]) # GUNICORN_PORT - bind port (default: 8000) -# GUNICORN_WORKERS - number of workers (default: number of CPUs) +# GUNICORN_WORKERS - number of workers (default: 2 * CPU + 1) # GUNICORN_ARGS - additional arguments (e.g., "--timeout 120") USER gunicorn diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 2ac91149b..125716ed1 100644 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -15,9 +15,9 @@ if [ "${1:0:1}" = '-' ] || [ -z "${1##*:*}" ]; then set -- --bind "$BIND" "$@" fi - # Add workers if not specified - default to number of CPUs + # Add workers if not specified - default to (2 * CPU_COUNT) + 1 if [[ ! " $* $GUNICORN_ARGS " =~ " --workers " ]] && [[ ! " $* $GUNICORN_ARGS " =~ " -w " ]] && [[ ! "$* $GUNICORN_ARGS" =~ --workers= ]] && [[ ! "$* $GUNICORN_ARGS" =~ -w= ]]; then - WORKERS="${GUNICORN_WORKERS:-$(nproc)}" + WORKERS="${GUNICORN_WORKERS:-$(( 2 * $(nproc) + 1 ))}" set -- --workers "$WORKERS" "$@" fi diff --git a/docs/content/guides/docker.md b/docs/content/guides/docker.md index 0c9d49eb0..10470aeea 100644 --- a/docs/content/guides/docker.md +++ b/docs/content/guides/docker.md @@ -27,7 +27,7 @@ docker run -p 8000:8000 -v $(pwd):/app ghcr.io/benoitc/gunicorn app:app | `GUNICORN_BIND` | Full bind address | `[::]:8000` (IPv4+IPv6) | | `GUNICORN_HOST` | Bind host | `[::]` | | `GUNICORN_PORT` | Bind port | `8000` | -| `GUNICORN_WORKERS` | Number of workers | Number of CPUs | +| `GUNICORN_WORKERS` | Number of workers | `(2 * CPU) + 1` | | `GUNICORN_ARGS` | Additional arguments | (none) | ### With Configuration From 6a83feecd6ef1e29c24a2de3e5749b13c1fb03b8 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 19:16:40 +0100 Subject: [PATCH 075/356] docs: add running in background section to Docker guide --- docs/content/guides/docker.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/content/guides/docker.md b/docs/content/guides/docker.md index 10470aeea..e01a66234 100644 --- a/docs/content/guides/docker.md +++ b/docs/content/guides/docker.md @@ -20,6 +20,30 @@ Mount your application directory and run: docker run -p 8000:8000 -v $(pwd):/app ghcr.io/benoitc/gunicorn app:app ``` +### Running in Background + +Use `-d` (detached mode) to run the container in the background: + +```bash +# Start in background +docker run -d --name myapp -p 8000:8000 -v $(pwd):/app ghcr.io/benoitc/gunicorn app:app + +# View logs +docker logs myapp + +# Follow logs in real-time +docker logs -f myapp + +# Stop the container +docker stop myapp + +# Start it again +docker start myapp + +# Remove the container +docker rm myapp +``` + ### Environment Variables | Variable | Description | Default | From 076bef68d3a0034699ffc18a266596386175a0f5 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 19:19:38 +0100 Subject: [PATCH 076/356] fix: default to 0.0.0.0 instead of [::] for broader compatibility --- docker/Dockerfile | 4 ++-- docker/docker-entrypoint.sh | 3 +-- docs/content/guides/docker.md | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 0aae43534..242d628cb 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -17,8 +17,8 @@ COPY docker/docker-entrypoint.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/docker-entrypoint.sh # Configuration via environment: -# GUNICORN_BIND - full bind address (default: [::]:8000, IPv4+IPv6) -# GUNICORN_HOST - bind host (default: [::]) +# GUNICORN_BIND - full bind address (default: 0.0.0.0:8000) +# GUNICORN_HOST - bind host (default: 0.0.0.0) # GUNICORN_PORT - bind port (default: 8000) # GUNICORN_WORKERS - number of workers (default: 2 * CPU + 1) # GUNICORN_ARGS - additional arguments (e.g., "--timeout 120") diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 125716ed1..04fd606a0 100644 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -6,9 +6,8 @@ if [ "${1:0:1}" = '-' ] || [ -z "${1##*:*}" ]; then # First arg is a flag or contains ':' (app:callable), run gunicorn # Build bind address from GUNICORN_HOST and GUNICORN_PORT, or use GUNICORN_BIND - # Default: listen on both IPv4 and IPv6 PORT="${GUNICORN_PORT:-8000}" - BIND="${GUNICORN_BIND:-${GUNICORN_HOST:-[::]}:${PORT}}" + BIND="${GUNICORN_BIND:-${GUNICORN_HOST:-0.0.0.0}:${PORT}}" # Add bind if not specified in args or GUNICORN_ARGS if [[ ! " $* $GUNICORN_ARGS " =~ " --bind " ]] && [[ ! " $* $GUNICORN_ARGS " =~ " -b " ]] && [[ ! "$* $GUNICORN_ARGS" =~ --bind= ]] && [[ ! "$* $GUNICORN_ARGS" =~ -b= ]]; then diff --git a/docs/content/guides/docker.md b/docs/content/guides/docker.md index e01a66234..c05afdfb3 100644 --- a/docs/content/guides/docker.md +++ b/docs/content/guides/docker.md @@ -48,8 +48,8 @@ docker rm myapp | Variable | Description | Default | |----------|-------------|---------| -| `GUNICORN_BIND` | Full bind address | `[::]:8000` (IPv4+IPv6) | -| `GUNICORN_HOST` | Bind host | `[::]` | +| `GUNICORN_BIND` | Full bind address | `0.0.0.0:8000` | +| `GUNICORN_HOST` | Bind host | `0.0.0.0` | | `GUNICORN_PORT` | Bind port | `8000` | | `GUNICORN_WORKERS` | Number of workers | `(2 * CPU) + 1` | | `GUNICORN_ARGS` | Additional arguments | (none) | From 8b86f6c36db6701320d05fec5edd6a97a92f0dc5 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 19:26:39 +0100 Subject: [PATCH 077/356] fix: install gunicorn from source in Docker image --- docker/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 242d628cb..9b628a7ce 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -9,8 +9,10 @@ RUN useradd --create-home --shell /bin/bash gunicorn WORKDIR /app -# Install gunicorn -RUN pip install --no-cache-dir gunicorn +# Install gunicorn from source +COPY pyproject.toml README.rst LICENSE ./ +COPY gunicorn/ ./gunicorn/ +RUN pip install --no-cache-dir . # Copy entrypoint script COPY docker/docker-entrypoint.sh /usr/local/bin/ From a3a59b2f56104329d616069ea200526dc26e00bb Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 19:27:14 +0100 Subject: [PATCH 078/356] chore: update version placeholder to 24.1.0 --- .github/DISCUSSION_TEMPLATE/issue-triage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DISCUSSION_TEMPLATE/issue-triage.yml b/.github/DISCUSSION_TEMPLATE/issue-triage.yml index 68862a977..36d898109 100644 --- a/.github/DISCUSSION_TEMPLATE/issue-triage.yml +++ b/.github/DISCUSSION_TEMPLATE/issue-triage.yml @@ -73,7 +73,7 @@ body: attributes: label: Gunicorn Version description: Output of `gunicorn --version` - placeholder: gunicorn 24.0.0 + placeholder: gunicorn 24.1.0 validations: required: true From 3179789f463e834c75a1e72ae06a22a562becbff Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 21:25:07 +0100 Subject: [PATCH 079/356] fix: handle SIGCLD alias for SIGCHLD on Linux On Linux, SIGCLD and SIGCHLD are aliases for the same signal number (17). The SIG_NAMES dict iteration order can map to either name, causing "Unhandled signal: cld" errors when workers fail during boot. Fixes #3453 --- gunicorn/arbiter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py index 222b3ca30..f8c64b4b5 100644 --- a/gunicorn/arbiter.py +++ b/gunicorn/arbiter.py @@ -237,6 +237,10 @@ def handle_chld(self): """SIGCHLD handling - called from main loop, safe to log.""" self.reap_workers() + # SIGCLD is an alias for SIGCHLD on Linux. The SIG_NAMES dict may map + # to either "chld" or "cld" depending on iteration order of dir(signal). + handle_cld = handle_chld + def handle_hup(self): """\ HUP handling. From 7ef34796ae0f8ebd515e581e1c0e202aa5a14004 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 21:26:35 +0100 Subject: [PATCH 080/356] docs: add SIGCLD fix to changelog --- docs/content/2026-news.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/content/2026-news.md b/docs/content/2026-news.md index a5c3857af..7f7b329a0 100644 --- a/docs/content/2026-news.md +++ b/docs/content/2026-news.md @@ -27,6 +27,10 @@ ### Bug Fixes +- Fix signal handling regression where SIGCLD alias caused "Unhandled signal: cld" + errors on Linux when workers fail during boot + ([#3453](https://github.com/benoitc/gunicorn/discussions/3453)) + - Fix socket blocking mode on keepalive connections preventing SSL handshake failures with async workers ([PR #3452](https://github.com/benoitc/gunicorn/pull/3452)) From a20d3fb2206d785ce73b2503ad9a51e7a1a10238 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 21:49:50 +0100 Subject: [PATCH 081/356] docs: add Docker image to 24.1.0 changelog --- docs/content/2026-news.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/content/2026-news.md b/docs/content/2026-news.md index 7f7b329a0..318e06c4a 100644 --- a/docs/content/2026-news.md +++ b/docs/content/2026-news.md @@ -5,6 +5,13 @@ ### New Features +- **Official Docker Image**: Gunicorn now publishes official Docker images to GitHub + Container Registry at `ghcr.io/benoitc/gunicorn` + ([PR #3454](https://github.com/benoitc/gunicorn/pull/3454)) + - Based on Python 3.12 slim image + - Uses recommended worker formula (2 × CPU + 1) + - Configurable via environment variables + - **PROXY Protocol v2 Support**: Extended PROXY protocol implementation to support the binary v2 format in addition to the existing text-based v1 format ([PR #3451](https://github.com/benoitc/gunicorn/pull/3451)) From eab5f0b1a5fd2c9e8b334bfd735b1017adaff131 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 21:54:49 +0100 Subject: [PATCH 082/356] ci: trigger Docker publish on tags with or without v prefix --- .github/workflows/docker-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 8054947df..6a9322389 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -3,6 +3,7 @@ on: push: tags: - 'v*' + - '[0-9]+.[0-9]+.[0-9]+' workflow_dispatch: permissions: From 53f2c310123f727d5b0711e9220c3847a9730890 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 22:14:05 +0100 Subject: [PATCH 083/356] ci: allow docs deploy on workflow_dispatch --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0f6aef184..ec83eebfb 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -48,7 +48,7 @@ jobs: retention-days: 7 deploy: - if: github.event_name == 'push' && github.ref == 'refs/heads/master' + if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/master' needs: build runs-on: ubuntu-latest permissions: From d73ff4b1d84cdd4637b914415ad8065c9cf6143c Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 22:16:37 +0100 Subject: [PATCH 084/356] docs: update main changelog with 24.1.0 --- docs/content/news.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/docs/content/news.md b/docs/content/news.md index 11d0e34cb..9abfecc38 100644 --- a/docs/content/news.md +++ b/docs/content/news.md @@ -1,6 +1,42 @@ # Changelog +## 24.1.0 - 2026-01-23 + +### New Features + +- **Official Docker Image**: Gunicorn now publishes official Docker images to GitHub + Container Registry at `ghcr.io/benoitc/gunicorn` + - Based on Python 3.12 slim image + - Uses recommended worker formula (2 × CPU + 1) + - Configurable via environment variables + +- **PROXY Protocol v2 Support**: Extended PROXY protocol implementation to support + the binary v2 format in addition to the existing text-based v1 format + - New `--proxy-protocol` modes: `off`, `v1`, `v2`, `auto` + - Works with HAProxy, AWS NLB/ALB, and other PROXY protocol v2 sources + +- **CIDR Network Support**: `--forwarded-allow-ips` and `--proxy-allow-from` now + accept CIDR notation (e.g., `192.168.0.0/16`) for specifying trusted networks + +- **Socket Backlog Metric**: New `gunicorn.socket.backlog` gauge metric reports + the current socket backlog size on Linux systems + +- **InotifyReloader Enhancement**: The inotify-based reloader now watches newly + imported modules, not just those loaded at startup + +### Bug Fixes + +- Fix signal handling regression where SIGCLD alias caused errors on Linux +- Fix socket blocking mode on keepalive connections with async workers +- Handle `SSLWantReadError` in `finish_body()` to prevent worker hangs +- Log SIGTERM as info level instead of warning +- Print exception details to stderr when worker fails to boot +- Fix `unreader.unread()` to prepend data to buffer instead of appending +- Prevent `RecursionError` when pickling Config objects + +--- + ## 24.0.0 - 2026-01-23 ### New Features From e9a3f30a0f2e4d91a39afa51ffc8f22a76d9c776 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 23:51:25 +0100 Subject: [PATCH 085/356] fix: keep forwarded_allow_ips as strings for backward compatibility (#3459) The CIDR network support added in 24.1.0 changed forwarded_allow_ips and proxy_allow_ips from string lists to ipaddress.ip_network objects. This broke external tools like uvicorn that expect strings. This fix validates IP/CIDR format during config parsing but keeps the string representation. Network objects are cached in Config methods (forwarded_allow_networks() and proxy_allow_networks()) for efficient IP checking without repeated conversions. Also uses strict mode for ip_network validation to detect mistakes like 192.168.1.1/24 where host bits are set (should be 192.168.1.0/24). Fixes #3458 --- gunicorn/asgi/message.py | 20 +++++++++++++------- gunicorn/config.py | 33 ++++++++++++++++++++++++++++----- gunicorn/http/message.py | 20 +++++++++++++------- tests/test_asgi.py | 24 ++++++++++++++++++++++-- tests/test_config.py | 30 ++++++++++-------------------- 5 files changed, 86 insertions(+), 41 deletions(-) diff --git a/gunicorn/asgi/message.py b/gunicorn/asgi/message.py index 1bb26b996..b73e1b0bc 100644 --- a/gunicorn/asgi/message.py +++ b/gunicorn/asgi/message.py @@ -39,17 +39,21 @@ RFC9110_5_5_INVALID_AND_DANGEROUS = re.compile(r"[\0\r\n]") -def _ip_in_allow_list(ip_str, allow_list): - """Check if IP address is in the allow list (which may contain networks).""" +def _ip_in_allow_list(ip_str, allow_list, networks): + """Check if IP address is in the allow list. + + Args: + ip_str: The IP address string to check + allow_list: The original allow list (strings, may contain "*") + networks: Pre-computed ipaddress.ip_network objects from config + """ if '*' in allow_list: return True try: ip = ipaddress.ip_address(ip_str) except ValueError: return False - for network in allow_list: - if network == '*': - return True + for network in networks: if ip in network: return True return False @@ -219,7 +223,8 @@ async def _handle_proxy_protocol(self, buf, mode): def _proxy_protocol_access_check(self): """Check if proxy protocol is allowed from this peer.""" if (isinstance(self.peer_addr, tuple) and - not _ip_in_allow_list(self.peer_addr[0], self.cfg.proxy_allow_ips)): + not _ip_in_allow_list(self.peer_addr[0], self.cfg.proxy_allow_ips, + self.cfg.proxy_allow_networks())): raise ForbiddenProxyRequest(self.peer_addr[0]) async def _parse_proxy_protocol_v1(self, buf): @@ -430,7 +435,8 @@ def _parse_headers(self, data, from_trailer=False): if from_trailer: pass elif (not isinstance(self.peer_addr, tuple) - or _ip_in_allow_list(self.peer_addr[0], cfg.forwarded_allow_ips)): + or _ip_in_allow_list(self.peer_addr[0], cfg.forwarded_allow_ips, + cfg.forwarded_allow_networks())): secure_scheme_headers = cfg.secure_scheme_headers forwarder_headers = cfg.forwarder_headers diff --git a/gunicorn/config.py b/gunicorn/config.py index 58141e55b..ffbc1b27f 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -47,6 +47,8 @@ class Config: def __init__(self, usage=None, prog=None): self.settings = make_settings() + self._forwarded_allow_networks = None + self._proxy_allow_networks = None self.usage = usage self.prog = prog or os.path.basename(sys.argv[0]) self.env_orig = os.environ.copy() @@ -174,6 +176,26 @@ def logger_class(self): def is_ssl(self): return self.certfile or self.keyfile + def forwarded_allow_networks(self): + """Return cached network objects for forwarded_allow_ips (internal use).""" + if self._forwarded_allow_networks is None: + self._forwarded_allow_networks = [ + ipaddress.ip_network(addr) + for addr in self.forwarded_allow_ips + if addr != "*" + ] + return self._forwarded_allow_networks + + def proxy_allow_networks(self): + """Return cached network objects for proxy_allow_ips (internal use).""" + if self._proxy_allow_networks is None: + self._proxy_allow_networks = [ + ipaddress.ip_network(addr) + for addr in self.proxy_allow_ips + if addr != "*" + ] + return self._proxy_allow_networks + @property def ssl_options(self): opts = {} @@ -407,15 +429,16 @@ def validate_list_of_existing_files(val): def validate_string_to_addr_list(val): val = validate_string_to_list(val) - result = [] for addr in val: if addr == "*": - result.append(addr) continue - # Support both single IPs and CIDR networks - result.append(ipaddress.ip_network(addr, strict=False)) + # Validate that it's a valid IP address or CIDR network + # but keep the string representation for backward compatibility. + # Use strict mode to detect mistakes like 192.168.1.1/24 where + # host bits are set (should be 192.168.1.0/24). + ipaddress.ip_network(addr) - return result + return val def validate_string_to_list(val): diff --git a/gunicorn/http/message.py b/gunicorn/http/message.py index 81132b342..1f939c219 100644 --- a/gunicorn/http/message.py +++ b/gunicorn/http/message.py @@ -58,17 +58,21 @@ class PPProtocol(IntEnum): RFC9110_5_5_INVALID_AND_DANGEROUS = re.compile(r"[\0\r\n]") -def _ip_in_allow_list(ip_str, allow_list): - """Check if IP address is in the allow list (which may contain networks).""" +def _ip_in_allow_list(ip_str, allow_list, networks): + """Check if IP address is in the allow list. + + Args: + ip_str: The IP address string to check + allow_list: The original allow list (strings, may contain "*") + networks: Pre-computed ipaddress.ip_network objects from config + """ if '*' in allow_list: return True try: ip = ipaddress.ip_address(ip_str) except ValueError: return False - for network in allow_list: - if network == '*': - return True + for network in networks: if ip in network: return True return False @@ -127,7 +131,8 @@ def parse_headers(self, data, from_trailer=False): # .. or we are just behind a proxy who does not remove conflicting trailers pass elif (not isinstance(self.peer_addr, tuple) - or _ip_in_allow_list(self.peer_addr[0], cfg.forwarded_allow_ips)): + or _ip_in_allow_list(self.peer_addr[0], cfg.forwarded_allow_ips, + cfg.forwarded_allow_networks())): secure_scheme_headers = cfg.secure_scheme_headers forwarder_headers = cfg.forwarder_headers @@ -407,7 +412,8 @@ def _handle_proxy_protocol(self, unreader, buf, mode): def proxy_protocol_access_check(self): """Check if proxy protocol is allowed from this peer.""" if (isinstance(self.peer_addr, tuple) and - not _ip_in_allow_list(self.peer_addr[0], self.cfg.proxy_allow_ips)): + not _ip_in_allow_list(self.peer_addr[0], self.cfg.proxy_allow_ips, + self.cfg.proxy_allow_networks())): raise ForbiddenProxyRequest(self.peer_addr[0]) def _parse_proxy_protocol_v1(self, unreader, buf): diff --git a/tests/test_asgi.py b/tests/test_asgi.py index e39ae91a7..4e75f7acb 100644 --- a/tests/test_asgi.py +++ b/tests/test_asgi.py @@ -50,8 +50,10 @@ class MockConfig: def __init__(self): self.is_ssl = False self.proxy_protocol = "off" - self.proxy_allow_ips = [ipaddress.ip_network("127.0.0.1")] - self.forwarded_allow_ips = [ipaddress.ip_network("127.0.0.1")] + self.proxy_allow_ips = ["127.0.0.1"] + self.forwarded_allow_ips = ["127.0.0.1"] + self._proxy_allow_networks = None + self._forwarded_allow_networks = None self.secure_scheme_headers = {} self.forwarder_headers = [] self.limit_request_line = 8190 @@ -64,6 +66,24 @@ def __init__(self): self.strip_header_spaces = False self.header_map = "refuse" + def forwarded_allow_networks(self): + if self._forwarded_allow_networks is None: + self._forwarded_allow_networks = [ + ipaddress.ip_network(addr) + for addr in self.forwarded_allow_ips + if addr != "*" + ] + return self._forwarded_allow_networks + + def proxy_allow_networks(self): + if self._proxy_allow_networks is None: + self._proxy_allow_networks = [ + ipaddress.ip_network(addr) + for addr in self.proxy_allow_ips + if addr != "*" + ] + return self._proxy_allow_networks + # AsyncUnreader Tests diff --git a/tests/test_config.py b/tests/test_config.py index 0aff90f5f..7ec3d8e79 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -2,7 +2,6 @@ # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. -import ipaddress import os import re import sys @@ -166,27 +165,15 @@ def test_str_validation(): def test_str_to_addr_list_validation(): c = config.Config() - # Default values are now network objects - assert c.proxy_allow_ips == [ - ipaddress.ip_network("127.0.0.1/32"), - ipaddress.ip_network("::1/128") - ] - assert c.forwarded_allow_ips == [ - ipaddress.ip_network("127.0.0.1/32"), - ipaddress.ip_network("::1/128") - ] - # Single IPs are converted to /32 or /128 networks + # Values remain as strings for backward compatibility + assert c.proxy_allow_ips == ["127.0.0.1", "::1"] + assert c.forwarded_allow_ips == ["127.0.0.1", "::1"] + # Single IPs are validated but kept as strings c.set("forwarded_allow_ips", "127.0.0.1,192.0.2.1") - assert c.forwarded_allow_ips == [ - ipaddress.ip_network("127.0.0.1/32"), - ipaddress.ip_network("192.0.2.1/32") - ] - # CIDR networks are supported + assert c.forwarded_allow_ips == ["127.0.0.1", "192.0.2.1"] + # CIDR networks are supported and kept as strings c.set("forwarded_allow_ips", "127.0.0.0/8,192.168.0.0/16") - assert c.forwarded_allow_ips == [ - ipaddress.ip_network("127.0.0.0/8"), - ipaddress.ip_network("192.168.0.0/16") - ] + assert c.forwarded_allow_ips == ["127.0.0.0/8", "192.168.0.0/16"] # Wildcard is preserved as string c.set("forwarded_allow_ips", "*") assert c.forwarded_allow_ips == ["*"] @@ -200,6 +187,9 @@ def test_str_to_addr_list_validation(): pytest.raises(ValueError, c.set, "forwarded_allow_ips", "127.0.0") # detect typos pytest.raises(ValueError, c.set, "forwarded_allow_ips", "::f:") + # dangerous typos such as accidentally permitting half the internet + # clearly recognizable - masked bits are not zero + pytest.raises(ValueError, c.set, "forwarded_allow_ips", "100.64.0.0/1") def test_str_to_list(): From abce0ca9cb873a55c28a42714cf3c636d7244b06 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 23 Jan 2026 23:53:29 +0100 Subject: [PATCH 086/356] docs: add 24.1.1 changelog entry for forwarded_allow_ips fix --- docs/content/2026-news.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/content/2026-news.md b/docs/content/2026-news.md index 318e06c4a..25dac3f55 100644 --- a/docs/content/2026-news.md +++ b/docs/content/2026-news.md @@ -1,6 +1,18 @@ # Changelog - 2026 +## 24.1.1 - unreleased + +### Bug Fixes + +- Fix `forwarded_allow_ips` and `proxy_allow_ips` to remain as strings for backward + compatibility with external tools like uvicorn. Network validation now uses strict + mode to detect invalid CIDR notation (e.g., `192.168.1.1/24` where host bits are set) + ([#3458](https://github.com/benoitc/gunicorn/issues/3458), + [PR #3459](https://github.com/benoitc/gunicorn/pull/3459)) + +--- + ## 24.1.0 - 2026-01-23 ### New Features From 684180411695af8d7e19f71314888c51a021609b Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Sat, 24 Jan 2026 00:02:56 +0100 Subject: [PATCH 087/356] docs: remove incorrect PR reference from Docker changelog entry --- docs/content/2026-news.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/content/2026-news.md b/docs/content/2026-news.md index 25dac3f55..162435508 100644 --- a/docs/content/2026-news.md +++ b/docs/content/2026-news.md @@ -19,7 +19,6 @@ - **Official Docker Image**: Gunicorn now publishes official Docker images to GitHub Container Registry at `ghcr.io/benoitc/gunicorn` - ([PR #3454](https://github.com/benoitc/gunicorn/pull/3454)) - Based on Python 3.12 slim image - Uses recommended worker formula (2 × CPU + 1) - Configurable via environment variables From 70200eef468735002b88f3a1ec0e12e9e03c9190 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Sat, 24 Jan 2026 01:24:44 +0100 Subject: [PATCH 088/356] chore: add GitHub Sponsors funding configuration --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..8206fbf1a --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [benoitc] From ad0c12de9813e1616574dd029517f9b58f4b7c3b Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Sat, 24 Jan 2026 02:08:28 +0100 Subject: [PATCH 089/356] docs: add sponsors section to README --- README.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.rst b/README.rst index f87cc4a6d..97558ec27 100644 --- a/README.rst +++ b/README.rst @@ -61,6 +61,13 @@ Community - Chat in `#gunicorn`_ on `Libera.chat`_ - See `CONTRIBUTING.md `_ for contribution guidelines +Sponsors +-------- + +Gunicorn is maintained thanks to our sponsors. `Become a sponsor `_. + +.. Sponsor logos will appear here + License ------- From 375e79e95b78f81b70af0c1ae8e32b7f4beee273 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Sat, 24 Jan 2026 02:13:42 +0100 Subject: [PATCH 090/356] release: bump version to 24.1.1 --- docs/content/2026-news.md | 2 +- docs/content/news.md | 12 ++++++++++++ gunicorn/__init__.py | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/content/2026-news.md b/docs/content/2026-news.md index 162435508..4e4d74a71 100644 --- a/docs/content/2026-news.md +++ b/docs/content/2026-news.md @@ -1,7 +1,7 @@ # Changelog - 2026 -## 24.1.1 - unreleased +## 24.1.1 - 2026-01-24 ### Bug Fixes diff --git a/docs/content/news.md b/docs/content/news.md index 9abfecc38..a86bcd5e4 100644 --- a/docs/content/news.md +++ b/docs/content/news.md @@ -1,6 +1,18 @@ # Changelog +## 24.1.1 - 2026-01-24 + +### Bug Fixes + +- Fix `forwarded_allow_ips` and `proxy_allow_ips` to remain as strings for backward + compatibility with external tools like uvicorn. Network validation now uses strict + mode to detect invalid CIDR notation (e.g., `192.168.1.1/24` where host bits are set) + ([#3458](https://github.com/benoitc/gunicorn/issues/3458), + [PR #3459](https://github.com/benoitc/gunicorn/pull/3459)) + +--- + ## 24.1.0 - 2026-01-23 ### New Features diff --git a/gunicorn/__init__.py b/gunicorn/__init__.py index 8b90daf11..2f64370ff 100644 --- a/gunicorn/__init__.py +++ b/gunicorn/__init__.py @@ -2,7 +2,7 @@ # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. -version_info = (24, 1, 0) +version_info = (24, 1, 1) __version__ = ".".join([str(v) for v in version_info]) SERVER = "gunicorn" SERVER_SOFTWARE = "%s/%s" % (SERVER, __version__) From f0952e5874551a4191dfc4f9f4707efb5a24b2f0 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Sat, 24 Jan 2026 02:19:14 +0100 Subject: [PATCH 091/356] docs: add sponsors section to website homepage --- docs/content/assets/stylesheets/home.css | 56 ++++++++++++++++++++++++ docs/content/index.md | 12 +++++ 2 files changed, 68 insertions(+) diff --git a/docs/content/assets/stylesheets/home.css b/docs/content/assets/stylesheets/home.css index 5f1748ef7..bcdd6d1be 100644 --- a/docs/content/assets/stylesheets/home.css +++ b/docs/content/assets/stylesheets/home.css @@ -360,6 +360,62 @@ color: var(--text-muted); } +/* ============================================ + Sponsors + ============================================ */ +.sponsors { + text-align: center; +} + +.sponsors h2 { + font-size: 1.75rem; + margin: 0 0 0.5rem 0; +} + +.sponsors p { + color: var(--text-muted); + margin: 0 0 2rem 0; +} + +.sponsors__logos { + display: flex; + flex-wrap: wrap; + justify-content: center; + align-items: center; + gap: 2rem; + margin-bottom: 2rem; + min-height: 60px; +} + +.sponsors__logos img { + max-height: 50px; + max-width: 150px; + filter: grayscale(100%); + opacity: 0.7; + transition: all 0.15s ease; +} + +.sponsors__logos img:hover { + filter: grayscale(0%); + opacity: 1; +} + +[data-md-color-scheme="slate"] .sponsors__logos img { + filter: grayscale(100%) brightness(1.5); +} + +[data-md-color-scheme="slate"] .sponsors__logos img:hover { + filter: grayscale(0%) brightness(1); +} + +.sponsors__placeholder { + color: var(--text-muted); + font-size: 0.875rem; + padding: 1rem 2rem; + border: 2px dashed var(--border); + border-radius: 8px; +} + /* ============================================ Footer CTA ============================================ */ diff --git a/docs/content/index.md b/docs/content/index.md index 7a9136b59..353a6b128 100644 --- a/docs/content/index.md +++ b/docs/content/index.md @@ -114,6 +114,18 @@ title: Gunicorn - Python WSGI HTTP Server
+
+
+

Sponsors

+

Gunicorn is maintained thanks to our sponsors.

+
+ + Your logo here +
+ Become a Sponsor +
+
+