Fix RESP3 client handshakes on non-RESP3 servers by mgravell · Pull Request #3037 · StackExchange/StackExchange.Redis

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