Skip to content

Fix RESP3 client handshakes on non-RESP3 servers#3037

Merged
mgravell merged 6 commits intomainfrom
marc/resp3
Mar 19, 2026
Merged

Fix RESP3 client handshakes on non-RESP3 servers#3037
mgravell merged 6 commits intomainfrom
marc/resp3

Conversation

@mgravell
Copy link
Collaborator

@mgravell mgravell commented Mar 17, 2026

RESP2 on RESP2 servers, and RESP3 on RESP3 servers have both always been fine; however, requesting RESP3 on servers that either don't support RESP3 at all (-ERR) or (like DMC in the past) reject RESP3: have had bumps. We fix this here by:

  1. fixing an order oddity where-by the protocol wasn't always set before announcing connection-established
  2. proactively poking pub/sub if we were hoping for RESP3 (so: wouldn't have spun it up yet)

fix #2783

Tests use the in-process test infrastructure, simulating:

  • client requesting RESP2
  • client requesting RESP3 against a server that doesn't talk HELLO (down-level RESP2 Redis)
  • client requesting RESP3 against a server that knows about HELLO but still only supports RESP2 (down-level DMC)
  • client requesting RESP3 against a server that can talk RESP3
  • all with/without auth
  • all with/without pub/sub
  • all with/without "normal" commands

- `HELLO 3` with `3` response: pass
- `HELLO 3` with `-ERR` response: fail
- `HELLO 3` with `2` response: fail
@mgravell mgravell merged commit 6f24522 into main Mar 19, 2026
8 checks passed
@mgravell mgravell deleted the marc/resp3 branch March 19, 2026 16:36
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.

RESP3 causes RedisServerException only (P|S)SUBSCRIBE / (P|S)UNSUBSCRIBE / PING / QUIT are allowed in this context

2 participants