issue: https://github.com/redis/redis-py/issues/3090
- 문제: redis 서버에 연결할 때 하나씩 명령어 전송하여 연결 속도가 더디는 버그가 있음
- 제안 사항: 트랜잭션을 사용하여 아래 명령어들을 하나 씩 보내지 않고 하나의 트랜잭션으로 묶어보내 연결 속도를 개선 명령어들을 한 번에 보내는 방법으로 연결 속도를 개선하고자 함.
AUTH
, SELECT
, HELLO
, CLIENT SETINFO
코드 수정하면서 필요한 내용 기록하기!
- RESP 프로토콜이란? 파이프라인?
- parser란?
- pytest
- redis 6버전 아래에서 AUTH 명령어 특이사항
- connection 재시도 로직
- MULTI 명령어로 명령어를 한 번에 쏘면 정말 시간이 줄어들까? 테스트해보자.
- 통합테스트-재연결 예외 처리 로직 수정 전
- 통합테스트-재연결 예외 처리 로직 수정 후
- MULTI와 EXEC 말고 pipeline을 써보자 - 비교
- 재연결 테스트 실패 디버깅
Description of change
Please provide a description of the change here.
This PR optimizes the on_connect method in redis-py by reducing the number of command responses during the connection process. Key improvements include:
- Utilized
MULTI
and EXEC
commands to batch process multiple commands, enhancing response speed and efficiency.
- Streamlined handling of the HELLO command with authentication arguments for Redis 6.0.0 and above.