Skip to content

feat: Redis 설정에 비밀번호/TLS/타임아웃 지원 추가#197

Merged
unam98 merged 2 commits into
devfrom
fix/redis-lettuce-timeout
Jul 24, 2026
Merged

feat: Redis 설정에 비밀번호/TLS/타임아웃 지원 추가#197
unam98 merged 2 commits into
devfrom
fix/redis-lettuce-timeout

Conversation

@unam98

@unam98 unam98 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

작업 배경

  • Render 배포 중 Upstash(관리형 Redis) 연결 실패 발견 — 기존 코드는 로컬 비밀번호 없는 Redis만 전제

변경 사항

영역 내용
RedisConfig.java password/TLS 조건부 지원 추가, Lettuce 연결/커맨드 타임아웃 30초로 상향

영향 범위

  • 기존 값(password/ssl 미설정) 그대로면 동작 100% 동일 — EC2 로컬 Redis 경로 영향 없음
  • 근본 원인: Render Free 티어(0.1 CPU)에서 TLS 핸드셰이크가 느려 기본 타임아웃 안에 못 끝나고 Connection closed prematurely로 실패 — 실측 확인 (로컬 JDK 11로는 즉시 성공, Render에서만 반복 실패)

Test Plan

  • JDK 11(Docker eclipse-temurin:11-jdk)로 컴파일 검증
  • 로컬에서 동일 Upstash 인스턴스에 대해 TLS handshake + AUTH 성공 확인 (Python/Java 양쪽)
  • Render 재배포 후 실제 헬스체크 통과 확인

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved Redis connection reliability with configurable connection and command timeouts.
    • Added optional password authentication for Redis connections.
    • Added optional SSL/TLS support for secure Redis communication.

기존엔 로컬 Redis(비밀번호 없음, 평문 연결)만 전제로 했는데, Upstash 같은
관리형 Redis는 비밀번호 인증 + TLS가 필수라 연결 자체가 불가능했음.

- spring.data.redis.password/ssl.enabled 프로퍼티로 조건부 활성화
 (미설정 시 기존 로컬 docker-compose Redis와 100% 하위 호환)
- Lettuce 연결/커맨드 타임아웃을 30초로 상향
 (Render Free 티어는 0.1 CPU라 TLS 핸드셰이크 자체가 느려서, 기본 타임아웃 안에
 핸드셰이크가 못 끝나고 "Connection closed prematurely"로 실패하는 문제 확인)
@unam98 unam98 self-assigned this Jul 24, 2026
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@unam98, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 93e0015b-f267-40f9-a567-ff9429494d95

📥 Commits

Reviewing files that changed from the base of the PR and between a9909f2 and fcaf4cc.

📒 Files selected for processing (1)
  • src/main/java/org/runnect/server/config/redis/RedisConfig.java
📝 Walkthrough

Walkthrough

Redis connectivity now uses configurable Lettuce client settings, including socket and command timeouts, optional password authentication, and optional SSL/TLS.

Changes

Redis connection configuration

Layer / File(s) Summary
Lettuce connection configuration
src/main/java/org/runnect/server/config/redis/RedisConfig.java
Redis properties now include optional password and SSL settings, while the connection factory applies standalone configuration, timeouts, conditional authentication, and conditional SSL/TLS.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 Redis 설정에 비밀번호, TLS, 타임아웃 지원을 추가한 핵심 변경을 정확히 요약합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/redis-lettuce-timeout

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/main/java/org/runnect/server/config/redis/RedisConfig.java`:
- Around line 41-52: Update the SSL-enabled branch in RedisConfig’s
clientConfigBuilder setup to configure Lettuce SslOptions with a 30-second
handshakeTimeout before applying SSL. Keep SocketOptions.connectTimeout for TCP
connections and preserve the existing non-SSL configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e134471-1609-4513-b598-4bb7d42d0f49

📥 Commits

Reviewing files that changed from the base of the PR and between e845749 and a9909f2.

📒 Files selected for processing (1)
  • src/main/java/org/runnect/server/config/redis/RedisConfig.java

Comment thread src/main/java/org/runnect/server/config/redis/RedisConfig.java Outdated
SocketOptions.connectTimeout은 TCP 연결 단계만 커버하고, TLS 핸드셰이크는
별도의 SslOptions.handshakeTimeout이 관리함. SSL 활성화 시에만
handshakeTimeout(30s)을 추가로 설정.
@unam98
unam98 merged commit c84c39c into dev Jul 24, 2026
2 checks passed
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.

2 participants