unstale

pypi / gunicorn

gunicorn

What changed in gunicorn 24 to 27, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

50 breaking9 security1 deprecations34 new APIs and options7 performance16 behavior and defaults75 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

gunicorn 2763 changes

Breaking changes 27

  • ASGI responses never exceed the app's Content-Length, and the connection closes if the body is shorter.

    27.0.0release notesupgrade guide

  • Error responses use the standard reason phrase in the status line and put error text in the body.

    27.0.0upgrade guide

  • The connection closes when an ASGI app returns before finishing its response.

    27.0.0release notesupgrade guide

  • Gunicorn stops when the app reports a failed lifespan startup instead of serving requests or repeatedly rebooting the worker.

    27.0.0release notes

  • Each request gets a shallow copy of lifespan state, so one request's scope state values are not seen by the next.

    27.0.0release notesupgrade guide

  • Requests rejected by the fast parser receive 400 and the connection closes, rather than being dropped without a response.

    27.0.0release notesupgrade guide

  • Usual request limits apply before unterminated lines finish, and trailers count against limit_request_fields.

    27.0.0release notesupgrade guide

  • Invalid ASGI response header names and values are rejected.

    27.0.0release notesupgrade guide

  • A line terminated by bare LF is rejected immediately with 400 rather than waiting for a limit or timeout.

    27.0.0release notesupgrade guide

  • The connection closes after a CONNECT request regardless of the application response; subsequent bytes are not served as another request.

    27.0.0release notesupgrade guide

  • Content-Length values that are not plain digits are rejected.

    27.0.0upgrade guide

  • Dirty app stream reads are bounded by idle and total timeouts and drop the connection when either fires; sync streams no longer replace idle timeout with a fixed 5 seconds.

    27.0.0release notesupgrade guide

  • The fast extra requires gunicorn_h1c 0.6.14, which parses requests faster and matches Python parser acceptance and rejection across read splits.

    27.0.0release notesupgrade guide

  • Requests with whitespace between a header name and its colon are rejected.

    27.0.0release notesupgrade guide

  • HTTP/2 connections close with ENHANCE_YOUR_CALM when a peer sends more than 1000 PING, SETTINGS, or empty DATA frames in 10 seconds.

    27.0.0release notesupgrade guide

  • HTTP/2 sync workers close connections when more than 10000 frames pile up while a response waits for window credit.

    27.0.0release notesupgrade guide

  • Request paths containing raw non-ASCII bytes are rejected; such bytes must be percent-encoded.

    27.0.0release notes

  • Control characters and raw non-ASCII bytes in request paths are rejected; non-ASCII bytes must be percent-encoded.

    27.0.0upgrade guide

  • Request paths containing control characters are rejected.

    27.0.0release notes

  • Requests whose Transfer-Encoding does not end in chunked are rejected with 400; clients must stop sending Transfer-Encoding: identity.

    27.0.0release notesupgrade guide

  • Control frames over 125 bytes or fragmented are rejected with close code 1002.

    27.0.0upgrade guide

  • WebSockets reject malformed or forbidden frames, invalid UTF-8 text or close reasons, and answer an empty client close with 1000.

    27.0.0release notesupgrade guide

  • WebSocket handshakes require version 13 and a key that is 16 bytes of base64, returning 426 or 400 respectively when invalid.

    27.0.0release notesupgrade guide

  • An ASGI WebSocket handshake the app closes or never accepts returns HTTP 403, or 500 if the app raised, rather than a close frame.

    27.0.0release notesupgrade guide

  • ASGI delivers websocket.disconnect as soon as the client closes the connection.

    27.0.0release notesupgrade guide

  • WSGI returns 500 instead of 400 for an invalid application response header and omits the header value from the error.

    27.0.0release notesupgrade guide

  • WSGI rejects response statuses that are not three digits followed by a valid reason phrase.

    27.0.0release notesupgrade guide

Security 6

  • Malformed chunk extensions, including control characters and unclosed quotes, are rejected.

    27.0.0release notes

  • Content-Length values that are not plain digits are rejected.

    27.0.0release notes

  • The dirty arbiter creates its PID file in the temporary directory with mode 0600 and ignores files it did not create for processes that are not ours.

    27.0.0release notesupgrade guide

  • ASGI applies forwarded_allow_ips to HTTP/1 requests; forwarded headers affect the scheme only from trusted proxies.

    27.0.0release notes

  • ASGI applies forwarded-header trust settings to HTTP/1 requests; secure_scheme_headers are honored only from trusted proxies, and underscore header names follow header_map.

    27.0.0upgrade guide

  • Gunicorn no longer calls listen() again on an already-listening socket, avoiding SELinux denials.

    27.0.0release notesupgrade guide

New APIs and options 1

  • Adds a WebSocket message-size setting, defaulting to 16 MiB; oversized messages close with 1009, while invalid control frames close with 1002.

    27.0.0release notesupgrade guide

Performance 4

  • ASGI reduces per-request work and copying; small requests and streamed responses are faster, and large responses use less memory under load.

    27.0.0release notesupgrade guide

  • Chunked request bodies are read in larger steps, up to the size each chunk announces.

    27.0.0release notes

  • Known-length request bodies are read in larger steps, speeding up large uploads, especially while other threads keep the worker busy.

    27.0.0release notes

  • Repeated request headers are joined in linear rather than quadratic time when building the WSGI environ.

    27.0.0release notes

Behavior and default changes 6

  • On a kept-alive HTTP/1.1 connection, the next request is served as soon as the previous response completes, without waiting for the application to return.

    27.0.1release notes

  • When a worker stops, kept-alive connections remain open for up to 2 seconds; requests arriving on them are answered with Connection: close instead of being dropped.

    27.0.1release notes

  • ASGI pauses socket reads while more than 256 KiB of request body or pipelined data waits for the application, then resumes as it reads.

    27.0.0release notesupgrade guide

  • ASGI pauses socket reads while unread WebSocket data or messages pile up, until the app catches up.

    27.0.0upgrade guide

  • ASGI sends 100 Continue when the app first reads the body, avoiding client delays before uploads.

    27.0.0release notesupgrade guide

  • WebSocket sends wait while the client is not reading, preventing slow clients from growing the worker's write buffer.

    27.0.0release notesupgrade guide

Fixes and other changes 19

  • An informational (1xx) response sent after the final response has started is refused instead of being written out of order.

    27.0.1release notes

  • ASGI accepts whitespace between a chunk size and its extension, matching WSGI behavior.

    27.0.0release notes

  • ASGI error responses use standard reason phrases in the status line and put error text in the body.

    27.0.0release notes

  • ASGI reads the body declared by a HEAD request instead of treating it as the next request.

    27.0.0release notesupgrade guide

  • ASGI copies bytearray and memoryview response bodies when sending so later app buffer reuse cannot change the transmitted bytes.

    27.0.0release notesupgrade guide

  • ASGI returns 501 for unsupported transfer codings, matching WSGI behavior.

    27.0.0release notesupgrade guide

  • Chunk data not followed by CRLF is rejected.

    27.0.0release notesupgrade guide

  • ASGI accepts whitespace between a chunk size and its extension; malformed chunk extensions are rejected.

    27.0.0upgrade guide

  • One empty line before the request line is ignored.

    27.0.0release notesupgrade guide

  • Idle gthread keep-alive connections no longer hold up graceful shutdown, and workers continue reporting while waiting during max_requests restarts.

    27.0.0release notesupgrade guide

  • A request arriving while the previous request's unread body is drained is served instead of waiting for the keepalive timeout.

    27.0.0release notes

  • The inotify reloader now reloads when the target of a symlinked file changes.

    27.0.0release notes

  • ASGI closes idle kept-alive connections after the configured keepalive seconds.

    27.0.0release notes

  • A request line over limit_request_line now receives 414 URI Too Long.

    27.0.0release notes

  • The connection closes when reading a request body fails, preventing bytes after the body from being lost on a reused connection.

    27.0.0release notesupgrade guide

  • On platforms without SO_REUSEPORT, workers use the master's sockets rather than failing to bind.

    27.0.0release notesupgrade guide

  • StatsD metrics are sent over IPv6 when statsd_host is a numeric IPv6 address.

    27.0.0release notesupgrade guide

  • Only spaces and tabs are trimmed around Transfer-Encoding values.

    27.0.0release notes

  • WebSocket send() after closure raises an OSError subclass that remains a RuntimeError; Gunicorn no longer logs it as an error.

    27.0.0release notesupgrade guide

gunicorn 2657 changes

Breaking changes 16

  • HTTP/2 request bodies stream to the application instead of being fully buffered; at most the receive window remains in flight.

    26.2.1release notes

  • HTTP/2 workers close RST_STREAM floods with ENHANCE_YOUR_CALM.

    26.2.1release notes

  • Waiting for HTTP/2 send credit is bounded by timeout.

    26.2.1release notes

  • HTTP/2 requests now share the HTTP/1 policy for header validation, duplicate headers, and forwarded_allow_ips trust; wsgi.url_scheme comes from the transport.

    26.2.0release notes

  • WSGI responses over HTTP/2 stream instead of being buffered whole before sending.

    26.2.0release notes

  • asyncio.CancelledError now propagates from BodyReceiver instead of being swallowed and returned as http.disconnect.

    26.1.0release notes

  • Truncated chunked bodies missing the mandatory empty trailer section are now rejected with ChunkMissingTerminator.

    26.1.0release notes

  • Dependency floors were raised for tornado, h2, setuptools, and pymdown-extensions; pytest and httpx now have floors to avoid versions permitted by the previous requirements.

    26.1.0release notes

  • When a request times out, the worker connection is closed so a late response cannot be returned for a later request.

    26.1.0release notes

  • Requests containing duplicate Host or Content-Type headers are now rejected with InvalidHeader by both parsers.

    26.1.0release notes

  • packaging is no longer a runtime dependency and moved to the gevent and testing extras, so a plain gunicorn install does not pull it in.

    26.1.0release notes

  • The eventlet worker class was removed; migrate to gevent, gthread, or tornado.

    26.0.0release notes

  • The fast HTTP parser now requires gunicorn_h1c >= 0.6.5.

    26.0.0release notes

  • Rejects authority-form targets outside CONNECT, asterisk-form targets outside OPTIONS, and relative-reference request-targets.

    26.0.0release notes

  • Rejects control characters in header values, forbidden trailer field-names, and Content-Length list form.

    26.0.0release notes

  • The ASGI PROXY Protocol callback parser now enforces proxy_allow_ips and tightens v1/v2 parsing.

    26.0.0release notes

Security 3

  • An unterminated chunk-size line or trailer section is bounded by existing request limits and scanned incrementally.

    26.2.1release notes

  • Connections are drained on close to prevent reset-on-close truncation.

    26.0.0release notes

  • Tightens the keepalive gate and finish_body byte cap, and keeps the body receiver alive across the gate to prevent pipelined requests from re-entering a closed body.

    26.0.0release notes

New APIs and options 1

  • Adds cleartext HTTP/2 modes for prior knowledge, HTTP/1.1 upgrade, both, or off. Supported by gthread, gevent, and asgi workers; only peers in forwarded_allow_ips are considered.

    26.2.0release notes

Performance 1

  • The C extension is now used wherever available on CPython; PyPy continues to use the Python parser.

    26.0.0release notes

Behavior and default changes 2

  • SIGHUP now applies changed logger settings while preserving process identity and listeners; invalid settings restore the previous working configuration.

    26.1.0release notes

  • Entries containing glob characters are re-expanded on every reload check, including recursive ** patterns; unmatched patterns warn instead of failing.

    26.1.0release notes

Fixes and other changes 34

  • The ASGI worker now sends Connection: close on HTTP/1.1 responses when it will not reuse the connection, preventing clients from treating a closed socket as persistent.

    26.2.2release notes

  • A reader paused under backpressure is resumed.

    26.2.1release notes

  • The ASGI worker no longer drops requests pipelined on kept-alive connections.

    26.2.1release notes

  • A bad request resets its own stream rather than the connection.

    26.2.1release notes

  • An empty final chunk now ends the HTTP/2 stream.

    26.2.1release notes

  • Graceful GOAWAY is honoured wherever it lands in the HTTP/2 workers.

    26.2.1release notes

  • An application error after headers have been sent resets the stream instead of corrupting the HPACK table.

    26.2.1release notes

  • Malformed chunked request bodies receive 400 Bad Request instead of raising.

    26.2.1release notes

  • Calling receive() after the body blocks until the peer disconnects instead of spinning the loop.

    26.2.1release notes

  • The uWSGI protocol works behind nginx uwsgi_pass again instead of returning 502 for every request.

    26.2.1release notes

  • A worker timeout no longer writes a 500 response onto a response body that has already started.

    26.2.1release notes

  • On the ASGI worker with the fast parser, requests carrying an Upgrade header no longer reach the application with an empty body.

    26.2.0release notes

  • Events read while blocked on a flow-control window are no longer discarded, preventing lost requests and body data.

    26.2.0release notes

  • HEAD, 204, and 304 responses no longer carry a body over HTTP/2.

    26.2.0release notes

  • sendfile() is refused on HTTP/2 responses rather than bypassing HTTP/2 framing.

    26.2.0release notes

  • Server-initiated closes now decrement the connection count and run cleanup exactly once, avoiding unnecessary graceful shutdown waits and warnings.

    26.1.0release notes

  • SIGHUP reloads no longer leak a control thread, selector file descriptor, and Unix socket per worker.

    26.1.0release notes

  • The dirty arbiter is reaped and reported correctly on SIGCHLD, including if it exits during worker reaping.

    26.1.0release notes

  • Cwd-relative extra files such as .env are watched through the current directory instead of raising InotifyError.

    26.1.0release notes

  • No-body responses warn about dropped file bytes only when there are bytes to drop.

    26.1.0release notes

  • The trace hook no longer crashes on dynamically generated code without a __file__.

    26.1.0release notes

  • Zero-valued gauges, counters, histograms, and timers are now reported; only None is skipped.

    26.1.0release notes

  • Unknown child processes are reaped silently at debug level, and only real workers can halt the server.

    26.1.0release notes

  • The WSGI path strips Content-Length on 1xx and 204 responses, drops bodies for no-body responses in write() and sendfile(), and logs one warning per request.

    26.1.0release notes

  • Fixes ASGI disconnect handling for Django-style apps.

    26.0.0release notes

  • Fixes duplicate Transfer-Encoding headers for BlackSheep streaming.

    26.0.0release notes

  • The callback now validates headers like process_headers and passes only the header name to InvalidHeader.

    26.0.0release notes

  • Interim 100-Continue responses no longer receive Transfer-Encoding: chunked.

    26.0.0release notes

  • The async HTTP/2 handler now marks the body complete when a stream ends so request bodies finalize correctly.

    26.0.0release notes

  • Preserves Content-Length on HEAD and 304 responses, drops body framing on HEAD/204/304 even when set by the framework, and warns once when an ASGI app emits a body for a no-body response.

    26.0.0release notes

  • Uses raw ASGI receive for Litestar request bodies and headers.

    26.0.0release notes

  • Normalizes keys to lowercase for the Quart headers endpoint.

    26.0.0release notes

  • Fixes binary sends when the text key is None.

    26.0.0release notes

  • Complies with the close-handshake state machine and closes the transport after the handshake completes.

    26.0.0release notes

gunicorn 2554 changes

Breaking changes 3

  • Adds checks that reject duplicate Content-Length headers, conflicting Content-Length and Transfer-Encoding, invalid HTTP/1.0 or stacked chunked encoding, invalid Transfer-Encoding values, and invalid chunk sizes.

    25.3.0release notes

  • Updates the Docker images to use Python 3.14.

    25.3.0release notes

  • The fast HTTP parser is available for WSGI and ASGI workers and requires gunicorn_h1c >= 0.4.1.

    25.2.0release notes

Deprecations 1

  • The eventlet worker is deprecated and will be removed in Gunicorn 26.0; migrate to gevent, gthread, or another supported worker type.

    25.0.0release notes

New APIs and options 27

  • Adds PROXY protocol v1 and v2 support to the callback parser.

    25.3.0release notes

  • Adds a setting for the control interface socket mode.

    25.1.0release notes

  • Adds a setting for the control interface's Unix socket.

    25.1.0release notes

  • Adds an in-memory key-value store shared by all workers, with get, set, delete, clear, keys, and has operations.

    25.1.0release notes

  • Adds an interactive control interface for managing running Gunicorn instances, including worker management and server control.

    25.1.0release notes

  • Adds an option to disable the control socket.

    25.1.0release notes

  • Adds a setting for configuring the app used by Dirty Arbiters.

    25.0.0release notes

  • A separate process pool executes long-running, blocking operations without blocking HTTP workers; its workers are asyncio-based and stateful.

    25.0.0release notes

  • Adds a graceful-timeout setting for Dirty Arbiters.

    25.0.0release notes

  • Adds a setting for configuring Dirty Arbiter threads.

    25.0.0release notes

  • Adds a timeout setting for Dirty Arbiters.

    25.0.0release notes

  • Adds a lifecycle hook for Dirty Arbiter workers.

    25.0.0release notes

  • Adds a setting for configuring the number of Dirty Arbiter workers.

    25.0.0release notes

  • Set the DirtyApp workers class attribute to control how many dirty workers load each app, enabling memory optimization.

    25.0.0release notes

  • Adds an exception for graceful handling when no workers are available for an app.

    25.0.0release notes

  • Install the http2 extra to add the h2 library required for HTTP/2 support.

    25.0.0release notes

  • Adds beta native HTTP/2 support with multiplexed streams, HPACK header compression, flow control, and stream prioritization; requires SSL/TLS and the h2 library.

    25.0.0release notes

  • Adds a setting for configuring supported HTTP protocols.

    25.0.0release notes

  • Adds an ASGI message type for sending HTTP 103 Early Hints.

    25.0.0release notes

  • Adds a setting for the initial HTTP/2 window size.

    25.0.0release notes

  • Adds a setting for the maximum number of concurrent HTTP/2 streams.

    25.0.0release notes

  • Adds a setting for the maximum HTTP/2 frame size.

    25.0.0release notes

  • Adds a setting for the maximum HTTP/2 header list size.

    25.0.0release notes

  • Configure per-app dirty worker allocation using the module:class:N format.

    25.0.0release notes

  • Adds a lifecycle hook for Dirty Arbiters.

    25.0.0release notes

  • The ASGI worker can receive requests via the uWSGI binary protocol from nginx.

    25.0.0release notes

  • Adds a WSGI callback for sending HTTP 103 Early Hints headers, allowing browsers to preload resources before the final response.

    25.0.0release notes

Performance 2

  • ASGI worker HTTP parsing is optimized with callback-based parsing, direct bytearray operations, and index-based header iteration.

    25.2.0release notes

  • Uses TLV encoding for dirty arbiter IPC, improving efficiency over JSON for binary data and large payloads.

    25.1.0release notes

Behavior and default changes 5

  • In auto mode, Gunicorn falls back to the Python parser when the gunicorn_h1c version requirement is not met.

    25.2.0release notes

  • The ASGI worker is promoted from beta to stable.

    25.1.0release notes

  • Dirty arbiters are now marked as a beta feature.

    25.1.0release notes

  • Sending SIGTTIN increases the number of dirty workers, subject to minimum worker constraints from app configurations.

    25.1.0release notes

  • Sending SIGTTOU decreases the number of dirty workers.

    25.1.0release notes

Fixes and other changes 16

  • Rejects chunk extensions containing bare CR bytes, as required by RFC 9112.

    25.3.0release notes

  • Fixes HTTP/2 ASGI request bodies being received twice, which could cause JSON parsing errors.

    25.3.0release notes

  • Makes --limit-request-line 0 mean unlimited, rather than using the default maximum; this works with both Python and fast C parsers.

    25.3.0release notes

  • FileWrapper adds __iter__ and __next__ methods for full PEP 3333 compliance.

    25.2.0release notes

  • Limit errors from the fast HTTP parser receive proper HTTP status codes 414 and 431.

    25.2.0release notes

  • Fixes the incomplete-header error with gevent or gthread workers using the uwsgi protocol behind nginx.

    25.2.0release notes

  • Fixes a RuntimeError when StopIteration is raised in an ASGI coroutine.

    25.0.3release notes

  • Fixes concurrent request failures when ASGI requests pass through an nginx proxy.

    25.0.2release notes

  • Adds graceful disconnect handling for the ASGI worker.

    25.0.2release notes

  • Lazy-imports the dirty module to improve gevent compatibility.

    25.0.2release notes

  • HTTP/1.1 ASGI streaming responses without a Content-Length header now use chunked transfer encoding, preventing clients from waiting for the connection to close.

    25.0.1release notes

  • Publishes the full exception traceback when the application fails to load.

    25.0.0release notes

  • ASGI workers shut down quickly on SIGINT and SIGQUIT, and gracefully on SIGTERM.

    25.0.0release notes

  • The header is ignored for HTTP/1.0 requests because 100-continue is only valid for HTTP/1.1 and later.

    25.0.0release notes

  • Fixes ALPN negotiation for gevent and eventlet workers when do_handshake_on_connect is False by performing the TLS handshake before checking the selected protocol.

    25.0.0release notes

  • Fixes setproctitle initialization when using systemd socket activation.

    25.0.0release notes

gunicorn 2418 changes

Breaking changes 4

  • Uses strict mode to detect invalid CIDR notation, including addresses where host bits are set.

    24.1.1release notes

  • Requires eventlet >= 0.40.3 to address CVE-2021-21419 and CVE-2025-58068.

    24.0.0release notes

  • Requires gevent >= 24.10.1 to address CVE-2023-41419 and CVE-2024-3219.

    24.0.0release notes

  • Requires tornado >= 6.5.0 to address CVE-2025-47287.

    24.0.0release notes

New APIs and options 5

  • Gunicorn now publishes official Docker images to GitHub Container Registry, based on Python 3.12 slim and configurable via environment variables.

    24.1.0release notes

  • Adds a gauge metric reporting the current socket backlog size on Linux systems.

    24.1.0release notes

  • Adds PROXY protocol v2 support and modes off, v1, v2, and auto; auto detects v1 or v2 automatically.

    24.1.0release notes

  • Adds native asyncio-based ASGI support for async Python frameworks, including HTTP/1.1 keepalive, WebSockets, and lifespan hooks; uvloop is optional.

    24.0.0release notes

  • Adds support for receiving requests from nginx via the uwsgi_pass directive.

    24.0.0release notes

Behavior and default changes 3

  • Now accepts CIDR notation for specifying trusted networks.

    24.1.0release notes

  • The inotify-based reloader now watches newly imported modules, not just those loaded at startup.

    24.1.0release notes

  • SIGTERM is now logged at info level instead of warning to reduce noise in orchestrated environments.

    24.1.0release notes

Fixes and other changes 6

  • Remains a string for backward compatibility with external tools like uvicorn.

    24.1.1release notes

  • Uses a smaller buffer size for faster timeout detection on slow or abandoned connections.

    24.1.0release notes

  • Handles SSLWantReadError to prevent worker hangs during SSL renegotiation.

    24.1.0release notes

  • Fixes socket blocking mode on keepalive connections to prevent SSL handshake failures with async workers.

    24.1.0release notes

  • Fixes a signal handling regression that caused “Unhandled signal: cld” errors on Linux when workers fail during boot.

    24.1.0release notes

  • Exception details are now printed to stderr when a worker fails to boot.

    24.1.0release notes