Skip to content

WIP 3.14t support - #9194

Draft
crusaderky wants to merge 9 commits into
dask:mainfrom
crusaderky:314t
Draft

crusaderky wants to merge 9 commits into
dask:mainfrom
crusaderky:314t

Conversation

@crusaderky

@crusaderky crusaderky commented Feb 13, 2026 •

Copy link
Copy Markdown
Collaborator

General and CI changes

  • Add PyPI flag to signal unstable free-threading support
  • The 3.14t and 3.15t are already available in the main branch although CI does not trigger them.
  • Add 3.14t and 3.15t to CI

Warning-related test failures

This PR fixes thee following failures in 3.14t and 3.15t.

These are due to a difference between 3.14 and 3.14t, which causes warnings to be contextvars-based. This causes pytest.warns and pytest.mark.filterwarnings not to catch warnings emitted by a thread which was started before the filter was set - such as in workers started by the c fixture. So it should just be a matter of tweaking the tests.
See also dask/dask side: dask/dask#12224

FAILED distributed/diagnostics/tests/test_nanny_plugin.py::test_duck_typed_register_nanny_plugin_is_deprecated - Exception: DeprecationWarning('Registering duck-typed plugins has been deprecated. Please make sure your plugin inherits from `NannyPlugin`.')
FAILED distributed/diagnostics/tests/test_scheduler_plugin.py::test_register_plugin - Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted.
FAILED distributed/diagnostics/tests/test_worker_plugin.py::test_duck_typed_register_worker_plugin_is_deprecated - Exception: DeprecationWarning('Registering duck-typed plugins has been deprecated. Please make sure your plugin subclasses `WorkerPlugin`.')
FAILED distributed/tests/test_client.py::test_warn_manual - Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted.
FAILED distributed/tests/test_client.py::test_warn_remote - Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted.
FAILED distributed/tests/test_semaphore.py::test_close_async - Failed: DID NOT WARN. No warnings of type (<class 'RuntimeWarning'>,) were emitted.
FAILED distributed/protocol/tests/test_protocol.py::test_fallback_to_pickle - assert "can not serialize 'numpy.int64'" in 'Failed to serialize (Cannot serialize np.int64(1)); falling back to pickle. Be aware that this may de...

Other test failures

I have not investigated these yet.
OUT OF SCOPE: these tests are expected to keep failing as of this PR.

FAILED distributed/tests/test_scheduler.py::test_memory - AssertionError: Expected 0 MiB <= unmanaged <= 500.55859375 MiB; got:
FAILED distributed/dashboard/tests/test_scheduler_bokeh.py::test_FinePerformanceMetrics - KeyError: 'evict(): dictionary is empty'
FAILED distributed/tests/test_spans.py::test_task_groups[False] - AssertionError: assert 272 == 240
 +  where 272 = Span<name=('wf',), id=c61a8a72-6095-4189-8f75-b8ed9483d9d3>.nbytes_total
FAILED distributed/tests/test_spans.py::test_task_groups[True] - AssertionError: assert 272 == 240
 +  where 272 = Span<name=('wf',), id=96154adf-485b-4b2c-9590-8970326a9f78>.nbytes_total
FAILED distributed/tests/test_spill.py::test_spillbuffer - AssertionError: assert {'b': 'bbbbbb...bbbbbbbbbbbb'} == {'a': 'aaaaaa...bbbbbbbbbbbb'}

@crusaderky
crusaderky requested a review from fjetter as a code owner February 13, 2026 10:18
@crusaderky
crusaderky marked this pull request as draft February 13, 2026 10:18
@github-actions

github-actions Bot commented Feb 13, 2026 •

Copy link
Copy Markdown
Contributor

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

     50 files  +     4      50 suites  +4   16h 21m 11s ⏱️ + 7h 59m 44s
  4 189 tests +     5   4 003 ✅ +    33    178 💤  -     2   8 ❌  - 26 
101 447 runs  +16 395  95 812 ✅ +15 342  5 625 💤 +1 077  10 ❌  - 24 

For more details on these failures, see this check.

Results for commit 51a9e62. ± Comparison against base commit 215e0e5.

This pull request removes 2 and adds 7 tests. Note that renamed tests count towards both.
distributed.cli.tests.test_dask_worker.test_listen_address_ipv6[tcp:..[ ‑ 1]:---nanny]
distributed.cli.tests.test_dask_worker.test_listen_address_ipv6[tcp:..[ ‑ 1]:---no-nanny]
distributed.comm.tests.test_comms ‑ test_batched_warning_context[inproc://]
distributed.comm.tests.test_comms ‑ test_batched_warning_context[tcp://]
distributed.comm.tests.test_comms ‑ test_batched_warning_context[ws://127.0.0.1:0]
distributed.comm.tests.test_comms ‑ test_comm_warning_context_side_channel[inproc://]
distributed.comm.tests.test_comms ‑ test_comm_warning_context_side_channel[tcp://]
distributed.comm.tests.test_comms ‑ test_comm_warning_context_side_channel[ws://127.0.0.1:0]
distributed.tests.test_client ‑ test_catch_warnings_from_warm_worker

♻️ This comment has been updated with latest results.

@crusaderky
crusaderky force-pushed the 314t branch 2 times, most recently from 15f90ab to e4f757e Compare February 13, 2026 12:29
@crusaderky crusaderky mentioned this pull request Feb 13, 2026
6 of 19 tasks
@crusaderky
crusaderky force-pushed the 314t branch 5 times, most recently from 37af8da to 091940c Compare May 4, 2026 13:07
@crusaderky
crusaderky force-pushed the 314t branch 2 times, most recently from 4648c6d to fc7fa74 Compare May 21, 2026 13:58
@crusaderky crusaderky mentioned this pull request May 26, 2026
1 of 6 tasks
The warning context leaked into the object protocol and dispatch helpers, copying ordinary payload buffers and reserving an RPC keyword. Keep the reference in the comm layer and scope it around existing dispatch. Preserve each batched message’s enqueue-time context without inheriting the writer’s context.
The existing plugin registration test already warms up its scheduler comm before capturing the duplicate warning. Match the warning there instead of starting a second cluster for the same coverage.
Msgpack implementations can report different serialization errors. Match Distributed’s own log text and retain the frame assertions that verify the fallback behavior.
Frame-splitting callers expect only payload frames even under a warnings filter. Add TCP and WebSocket transport entry points for the optional context frame and leave the raw helpers unchanged.
…re frames

The previous approach appended a 48-byte process-local UUID frame to TCP and
WebSocket payloads, required transport-specific hooks in tcp.py, ws.py,
inproc.py, and comm/utils.py, inflated comm.write() byte counts, triggered an
extra TCP read_bytes_rw allocation when warnings filters were active, leaked
unconsumed tokens in the global registry when talking to remote processes, and
copied BatchedSend message dicts on enqueue and serialize.

Replace the wire-frame mechanism with an in-memory FIFO side channel paired
during the existing comm handshake in distributed/comm/core.py. Remote peers
ignore the ephemeral handshake key and stay completely unwrapped with zero
per-message overhead, all transports (including TLS and UCX) work with untouched
wire framing and byte counts, BatchedSend keeps plain message lists with a
parallel context list, and ContextVar resets tolerate cross-context GC.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant