Skip to content

[HOTFIX] Redis expire 재귀 호출 문제 수정#522

Merged
yeonjinJoo merged 2 commits intodevelopfrom
hotfix/#520-redis-expire-fix
Feb 25, 2026
Merged

[HOTFIX] Redis expire 재귀 호출 문제 수정#522
yeonjinJoo merged 2 commits intodevelopfrom
hotfix/#520-redis-expire-fix

Conversation

@yeonjinJoo
Copy link
Collaborator

🚩 연관 이슈

closed #520

⏰ 우선순위(P1,P2,P3)

P1

🔧 작업 내용

기존에는 Spring Boot 기본 Redis 클라이언트인 Lettuce 기반 RedisConnectionFactory를 사용하고 있었습니다.

  • RedisTemplate → DefaultedRedisConnection → LettuceConnection
  • expire() 호출 시 Lettuce 구현체가 직접 Redis 명령을 실행

그러나 프로젝트의 다른 부분에 Redisson 설정이 추가되면서 RedisConnectionFactory가 RedissonConnectionFactory로 교체되었습니다.
이로 인해 모든 RedisTemplate 작업이 다음 경로를 따르게 되었습니다:

RedisTemplate
  → DefaultedRedisConnection
      → RedissonConnection

이 과정에서 Spring의 DefaultedRedisConnection이 expire() 호출 시 내부적으로 keyCommands().pExpire()를 사용하도록 설계된 구조와, Redisson 구현체가 pExpire()를 다시 connection.pExpire()로 위임하는 구조가 충돌했습니다.
그 결과 서로를 다시 호출하는 순환 위임이 발생하여 expire 호출이 정상적으로 동작하지 않는 문제가 발생했습니다.

따라서 해당 문제를

redissonClient.getScoredSortedSet(rankingKey)
                .expire(Duration.ofSeconds(HARD_TTL_SECONDS));

Redisson 라이브러리의 직접 호출을 통해 문제 해결

📝 고민내용(선택)

🏞️ 스크린샷 (선택)

🗣️ 리뷰 요구사항 (선택)

@yeonjinJoo yeonjinJoo linked an issue Feb 25, 2026 that may be closed by this pull request
@coli-geonwoo coli-geonwoo requested a review from joyjhm February 25, 2026 16:30
@coli-geonwoo coli-geonwoo self-requested a review February 25, 2026 16:30
@github-actions
Copy link

github-actions bot commented Feb 25, 2026

Test Results

105 files  105 suites   16s ⏱️
341 tests 333 ✅ 8 💤 0 ❌
343 runs  335 ✅ 8 💤 0 ❌

Results for commit 02618e9.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Feb 25, 2026

📝 Test Coverage Report

Overall Project 75.11% -0.36% 🍏
Files changed 0%

File Coverage
RedisRankingCache.java 1.49% -17.16%

Copy link
Collaborator

@joyjhm joyjhm left a comment

Choose a reason for hiding this comment

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

/noti-be
확인했습니다

Copy link
Collaborator

@coli-geonwoo coli-geonwoo left a comment

Choose a reason for hiding this comment

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

/noti-be

client 충돌 문제가 있군요.. 죄송합니다.

@yeonjinJoo yeonjinJoo merged commit a651366 into develop Feb 25, 2026
5 checks passed
@yeonjinJoo yeonjinJoo deleted the hotfix/#520-redis-expire-fix branch February 25, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[HOTFIX] Redis expire 재귀 호출 문제 수정

3 participants