Redis client has no socket timeouts, so a lost Redis connection stalls content requests for minutes

Đang mở
#8,347 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python, redis
Lĩnh vực
backend

Hướng nghiên cứu

Start with redis_connection.py, where the Redis client is built from REDIS_HOST and REDIS_PORT without socket timeouts, and check how REDIS_URL is parsed as an alternative path. Read the cache layer that falls back to the database when Redis raises an error, to confirm where the failure surfaces. Reproduce by pointing the client at an address that does not answer and timing a cache call. Done when the host-based client sets connect and socket timeouts and a health check, and the REDIS_URL options are documented.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Issue Triage-Needed

redis_connection.py builds the client with REDIS_HOST/REDIS_PORT and no socket_timeout, socket_connect_timeout, socket_keepalive or health_check_interval. Every content request consults the cache, and the cache serves the request without Redis when Redis raises an error. With no timeouts, nothing is raised when the Redis server disappears without closing its connections (node loss, network partition): a request on such a pooled connection waits until TCP gives up, which takes minutes, and new connections wait for the OS connect timeout.

Measured with redis-py 8.1 against an address that does not answer: a cache call fails after about 20 s without options and after about 4 s with socket_connect_timeout=1&socket_timeout=2 in REDIS_URL (three retries).

Suggestion: default timeouts and a health check when the client is built from REDIS_HOST, and documenting the REDIS_URL query options for deployments that set it.

Ngôn ngữ chính
Python
Star
641
Fork
178
Merge trung bình
17 giờ 36 phút
Pull request đã merge (30 ngày)
76

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pulp/pulpcore

Tất cả issue của pulp/pulpcore

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.