Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,18 @@ Added

* Add Python 3.14 to test matrix and project classifiers.
(`#751`_, `@LincolnPuzey`_)
Things to be aware of when upgrading to Python 3.14:

* Python 3.14 `changes`_ the default multiprocessing `start method`_ to `forkserver`_ on some platforms.
Dramatiq Workers use multiprocessing and will be effected by this change.
``forkserver`` should be less bug-prone than the old default ``fork``.
However, if you run into weird issues, using the existing ``--use-spawn`` flag when starting Dramatiq to
set the start method to ``spawn``, might solve them.
* The free-threaded build of Python is now `officially supported`_ by Python.
Dramatiq is not yet unit-tested with free-threaded Python, but we hope to do so soon.
In the meantime, if you have any success or problems running Dramatiq with free-threaded Python,
we would love to hear about it.

* Added type annotations for the external API of the |Worker| and |Broker| classes.
(`#727`_, `#731`_, `#744`_, `@jenstroeger`_)
* Added type annotations for the external API of the |Middleware| class and its subclasses.
Expand All @@ -134,6 +146,10 @@ Added
* Added ``dramatiq_worker_timeout`` environment variable.
(`#773`_, `@ksoviero-zengrc`_)

.. _changes: https://docs.python.org/3.14/whatsnew/3.14.html#whatsnew314-multiprocessing-start-method
.. _start method: https://docs.python.org/3.14/library/multiprocessing.html#multiprocessing-start-methods
.. _forkserver: https://docs.python.org/3.14/library/multiprocessing.html#multiprocessing-start-method-forkserver
.. _officially supported: https://docs.python.org/3.14/whatsnew/3.14.html#free-threaded-python-is-officially-supported

.. _#751: https://github.com/Bogdanp/dramatiq/pull/751
.. _#727: https://github.com/Bogdanp/dramatiq/issues/727
Expand Down
3 changes: 2 additions & 1 deletion dramatiq/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,11 @@ def make_argument_parser():
help="write all logs to a file (default: sys.stderr)",
)
parser.add_argument("--skip-logging", action="store_true", help="do not call logging.basicConfig()")
_unix_default = "fork" if sys.version_info < (3, 14) else "forkserver"
parser.add_argument(
"--use-spawn",
action="store_true",
help="start processes by spawning (default: fork on unix, spawn on windows)",
help=f"start processes by spawning (default: {_unix_default} on unix, spawn on Windows and macOS)",
)
parser.add_argument(
"--fork-function",
Expand Down