Skip to content

Commit 2cae213

Browse files
authored
Merge pull request #792 from LincolnPuzey/doc_fork_change
Add notes about 3.14 changes to release notes
2 parents 73969e8 + edadf09 commit 2cae213

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

docs/source/changelog.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,18 @@ Added
124124

125125
* Add Python 3.14 to test matrix and project classifiers.
126126
(`#751`_, `@LincolnPuzey`_)
127+
Things to be aware of when upgrading to Python 3.14:
128+
129+
* Python 3.14 `changes`_ the default multiprocessing `start method`_ to `forkserver`_ on some platforms.
130+
Dramatiq Workers use multiprocessing and will be effected by this change.
131+
``forkserver`` should be less bug-prone than the old default ``fork``.
132+
However, if you run into weird issues, using the existing ``--use-spawn`` flag when starting Dramatiq to
133+
set the start method to ``spawn``, might solve them.
134+
* The free-threaded build of Python is now `officially supported`_ by Python.
135+
Dramatiq is not yet unit-tested with free-threaded Python, but we hope to do so soon.
136+
In the meantime, if you have any success or problems running Dramatiq with free-threaded Python,
137+
we would love to hear about it.
138+
127139
* Added type annotations for the external API of the |Worker| and |Broker| classes.
128140
(`#727`_, `#731`_, `#744`_, `@jenstroeger`_)
129141
* Added type annotations for the external API of the |Middleware| class and its subclasses.
@@ -134,6 +146,10 @@ Added
134146
* Added ``dramatiq_worker_timeout`` environment variable.
135147
(`#773`_, `@ksoviero-zengrc`_)
136148

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

138154
.. _#751: https://github.com/Bogdanp/dramatiq/pull/751
139155
.. _#727: https://github.com/Bogdanp/dramatiq/issues/727

dramatiq/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,11 @@ def make_argument_parser():
221221
help="write all logs to a file (default: sys.stderr)",
222222
)
223223
parser.add_argument("--skip-logging", action="store_true", help="do not call logging.basicConfig()")
224+
_unix_default = "fork" if sys.version_info < (3, 14) else "forkserver"
224225
parser.add_argument(
225226
"--use-spawn",
226227
action="store_true",
227-
help="start processes by spawning (default: fork on unix, spawn on windows)",
228+
help=f"start processes by spawning (default: {_unix_default} on unix, spawn on Windows and macOS)",
228229
)
229230
parser.add_argument(
230231
"--fork-function",

0 commit comments

Comments
 (0)