Migrate redis from v3 to v6 - #503
Merged
Merged
Conversation
Nikoklis
force-pushed
the
redis-v6-migration
branch
from
August 6, 2026 08:32
4381a9e to
d6d63d2
Compare
node-redis v4 rewrote the client API (promise-based commands, explicit
connect(), createClient(options) signature, socket-level reconnect
strategy) and v6 made RESP3 the default protocol. This migrates the
redis initializer while keeping the orka config schema unchanged:
- createClient({url, socket}) with the legacy options (timesConnected,
totalRetryTime, reconnectAfterMultiplier, socketKeepalive,
socketInitialDelay, tls) mapped to socket options and a
reconnectStrategy that preserves the old retry_strategy semantics;
the old "throw to crash the server" case now stops reconnecting so
the health check reports unhealthy instead
- the initial connect() is awaited during boot so the client is ready
before the server listens; a failed connection is only logged and
the app still boots with /health reporting unhealthy
- isHealthy() uses isReady instead of the removed connected property
- RESP is pinned to 2 to preserve reply shapes; override via
config.redis.options.RESP
- remove obsolete @types/redis; v6 ships its own types
BREAKING CHANGE: getRedis() now returns a promise-based node-redis v6
client; callback-style commands and client.end() are gone.
createRedisConnection() is now async. Requires a major orka release.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Nikoklis
force-pushed
the
redis-v6-migration
branch
from
August 6, 2026 08:50
d6d63d2 to
0362c9b
Compare
Nikoklis
marked this pull request as ready for review
August 6, 2026 08:56
Nikoklis
requested review from
echetzakis,
klesgidis,
kzacharakis,
nikosd23 and
stavros-wb
as code owners
August 6, 2026 08:56
ch-asimakopoulos
approved these changes
Aug 6, 2026
iliasbibas
approved these changes
Aug 6, 2026
klesgidis
approved these changes
Aug 6, 2026
klesgidis
left a comment
Contributor
There was a problem hiding this comment.
LGTM! maybe we should give it a try before releasing this
Contributor
Author
|
Will merge and get a new rc tag from master and test it. |
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.
Replaces #490. That bump cannot be merged as-is: node-redis v4 rewrote the client API and the build fails. This PR does the actual migration.
Before / after
Client usage (breaking for orka consumers):
config.redisschema: unchanged.url,options.tlsand the legacy retry/keepalive options (timesConnected,totalRetryTime,reconnectAfterMultiplier,socketKeepalive,socketInitialDelay) keep working and are mapped to the new driver options. Any other key inconfig.redis.options(e.g.RESP,pingInterval,socket) is passed through tocreateClient.Initializer internals:
createClient(url, options)createClient({ url, RESP: 2, socket })client.connect(), awaited during boot; if redis is down the app still boots and/healthreports unhealthyretry_strategysocket.reconnectStrategy, same semantics/healthturns 503 so the orchestrator restarts the podclient.connectedclient.isReadysetKeepAliveonclient.streamsocket.keepAlive/socket.keepAliveInitialDelayclient.end(true)client.destroy()@types/redis@types/redisremoved)RESPis pinned to2to preserve reply shapes; setconfig.redis.options.RESP = 3to opt in to RESP3.Breaking changes
getRedis()returns a promise-based node-redis v6 client; callback-style commands andclient.end()are gone.createRedisConnection()is now async and resolves after the initial connection attempt.Testing
/health200,destroy(),/health503.set/get/delthroughgetRedis().🤖 Generated with Claude Code