fix: apply redis TLS config in manager cache and job queue - #4908
Open
Smuger wants to merge 1 commit into
Open
Conversation
The manager cache client (manager/cache/cache.go) and the async job queue (internal/job/job.go) built their redis clients without applying database.redis.tls, so the configured TLS settings were silently ignored. Against a TLS-required redis (e.g. a managed redis with transit encryption enabled) the client connected in plaintext and the initial ping hung until timeout: "failed to ping redis: i/o timeout". Add pkgredis.NewTLSClientConfig to build the *tls.Config once and use it at every redis client site (manager cache, manager database, scheduler, and the manager/scheduler job queues), replacing the duplicated inline tlsconfig.Client blocks. Thread a *tls.Config through internaljob.Config into both the ping health-check options and the machinery server config (Config.TLSConfig, which the redis broker and backend honor). Add unit tests for the helper. Signed-off-by: smuger <krzysiek.kwietniewski@gmail.com>
Smuger
requested review from
EvanCley,
anjia0532,
fcgxz2003,
gaius-qi,
hhhhsdxxxx and
hyy0322
July 29, 2026 13:43
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4908 +/- ##
==========================================
+ Coverage 28.45% 28.46% +0.01%
==========================================
Files 235 236 +1
Lines 23228 23242 +14
==========================================
+ Hits 6609 6616 +7
- Misses 16169 16176 +7
Partials 450 450
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #4907. The manager cache client and job queue built their redis clients without applying
database.redis.tls, so it was silently ignored (see the issue for details/repro).This PR:
pkgredis.NewTLSClientConfigand uses it at every redis client site, replacing the duplicated inlinetlsconfig.Clientblocks.*tls.Configthroughinternaljob.Configinto the ping options and the machinery config (Config.TLSConfig, honored by the redis broker/backend).pkg/redis/tls_test.go).No behavior change when
database.redis.tlsis unset (TLSConfigstaysnil).Related Issue
Fixes #4907
Motivation and Context
Connecting the manager to AWS ElastiCache for Valkey with TLS (encryption in transit) enabled. See #4907.
Testing
Verified against AWS ElastiCache for Valkey 9.0.0 with encryption in transit enabled (TLS required), using images built from this change (release
v2.5.1-redis-tls):Types of changes
Checklist