Skip to content

Fix docket-rs's rediss:// connections, and put TLS behind a default feature - #552

Merged
chrisguidry merged 3 commits into
chrisguidry:mainfrom
gaker:rust-tls-feature
Oct 8, 2026
Merged

chrisguidry merged 3 commits into
chrisguidry:mainfrom
gaker:rust-tls-feature

Conversation

@gaker

@gaker gaker commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

docket-rs panicked on its first command to a rediss:// URL. redis turns off rustls's default features, which include its crypto backends, and nothing else in docket-rs turned one on, so rustls could not build a TLS config. docket-rs also took all of redis's default features, none of which it uses beyond the streams and script it names, and gave every user rustls whether or not they connect over TLS. Cargo gives a crate no way to turn off a feature that one of its dependencies turns on.

redis's default features are now off, and TLS is a tls feature, on by default, that turns on redis's rustls support and gives rustls its ring backend. Without it, a rediss URL fails with "rediss:// needs docket's tls feature", the way memory:// fails without the memory feature, and the build drops 14 crates. If an application also turns on rustls's aws-lc-rs backend, rustls cannot choose between the two, and the README says to install one. rust/rust-toolchain.toml pins Rust 1.99, the crates' rust-version, so local runs and CI lint with the same clippy; the coverage job sets RUSTUP_TOOLCHAIN to stay on nightly. The lint job now also runs clippy without default features, and the two lints that fired there are fixed.

Session context

A question about whether docket-rs needs redis's default features turned this up. With them off, the dependency tree had rustls but neither ring nor aws-lc-rs, and a small program that connected to rediss:// on a closed port panicked in rustls instead of reporting the refused connection. Turning the defaults back on doesn't help, since they don't touch rustls. Cluster, Sentinel, and token-based authentication stay on for everyone: together they add four crates, and making them optional would put #[cfg] through the connection code.

Tests came first: a_tls_connect_reaches_the_network panicked the same way before rustls had ring, and expects a refused connection now. Nothing here completes a TLS handshake, because CI has no TLS backend. The two clippy lints were on main too, and fire only without the memory feature: a wildcard match left with one variant, and a test helper that only the memory tests call.

Locally, the Rust workspace passes on memory and on a real Redis 8 with all features, the docket-rs tests pass without TLS, clippy -D warnings is clean with no features, each feature alone, and all features, and prek passes.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@read-the-docs-community

read-the-docs-community Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 docket | 🛠️ Build #35023651 | 📁 Comparing 51d19fd against latest (5d2ccd6)

  🔍 Preview build  

3 files changed
± api-reference/index.html
± dependency-injection/index.html
± production/index.html

@codecov-commenter

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
1202 1 1201 16
View the top 1 failed test(s) by shortest run time
tests/fundamentals/test_timeouts.py::test_timeout_extends_by_base_by_default
Stack Traces | 0.875s run time
docket = <docket.docket.Docket object at 0x7b60c91ff5b0>
worker = <docket.worker.Worker object at 0x7b60c955c310>

    async def test_timeout_extends_by_base_by_default(docket: Docket, worker: Worker):
        """A task can be scheduled with a timeout and extend itself by the base timeout"""
    
        called = False
    
        async def task_with_timeout(
            timeout: Timeout = Timeout(timedelta(milliseconds=100)),
        ):
            await asyncio.sleep(0.05)
    
            timeout.extend()  # defaults to the base timeout
    
            try:
                await asyncio.sleep(5)
            except asyncio.CancelledError:
                nonlocal called
                called = True
    
        await docket.add(task_with_timeout)()
    
        start = datetime.now(timezone.utc)
    
        await worker.run_until_finished()
    
        elapsed = datetime.now(timezone.utc) - start
    
>       assert called
E       assert False

tests/fundamentals/test_timeouts.py:115: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

gaker and others added 3 commits October 8, 2026 13:47
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chrisguidry
chrisguidry merged commit 5473cc3 into chrisguidry:main Oct 8, 2026
51 checks passed
chrisguidry added a commit that referenced this pull request Oct 9, 2026
…ial batches, and bump docket-rs to 0.3.0 (#564)

A release review of the changes since python/v0.26.2 and rust/v0.2.0
found these problems.

- A Perpetual that stops itself after a replace of its own key (#554)
published `completed` on the key, so `get_result()` returned `None`
before the replacement ran. At 0.26.2 it raised `ExecutionCancelled`.
Both languages now end a superseded Perpetual run without a state
event, as #562 did for Retry. This also covers a Perpetual reschedule
that a replace superseded, which published the same way at 0.26.2.
- docket-rs's default `tls` feature (#552) turned on rustls's `ring`
backend. In an application that already has rustls's default
`aws-lc-rs`, rustls then has two backends, and every rustls config in
the process panics, the application's own included, even with no
`rediss://` URL. `tls` now brings no backend, and the new `tls-ring`
feature adds `ring` for an application with none. There is no
`tls-aws-lc-rs` feature: `--all-features` would then turn on both.
- A docket-rs batch that failed after its first chunk (#550) returned
only the error, so the caller lost the dispositions of the tasks
already in Redis. The batch now returns every execution, with the
failed chunk and those after it marked `Disposition::Failed`. A
failure on the first chunk still returns the error, as in 0.2.0.
- docket-rs goes to 0.3.0, because `Admission::admit` (#547) and
`add_many`/`replace_many` (#550) changed incompatibly since 0.2.0.


🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01Y2QtufEUxxm9XgTqCWySHG

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

3 participants