Skip to content

[Fix] McpRateLimiter의 windows 맵이 TTL 없이 무한정 커지는 문제 수정 - #294

Merged
kangcheolung merged 3 commits into
developfrom
fix/292
Aug 24, 2026
Merged

[Fix] McpRateLimiter의 windows 맵이 TTL 없이 무한정 커지는 문제 수정#294
kangcheolung merged 3 commits into
developfrom
fix/292

Conversation

@kangcheolung

Copy link
Copy Markdown
Member

Summary

  • McpRateLimiterwindows 맵을 ConcurrentHashMap → Caffeine 캐시(expireAfterAccess 2분)로 교체
  • 한 번이라도 호출된 사용자·도구 조합이 서버 재시작 전까지 메모리에 영구히 쌓이던 문제 해소
  • checkLimit()의 rate limit 로직(고정 윈도우 판단/리셋/증가) 자체는 변경 없음
  • #117에 알려진 한계로 남아있던 이슈를 해소 (신규 발견 아님)

closes #292

Test plan

  • checkLimit_evictsEntry_afterTtlExpires 신규 단위 테스트 추가
  • 기존 McpRateLimiter 테스트 6개(동시성/레이스 포함) 회귀 확인
  • ./backend/gradlew -p backend test 전체 통과

문서

  • docs/design/kangcheolung-#292-mcp-rate-limiter-ttl.md

🤖 Generated with Claude Code

kangcheolung and others added 3 commits August 24, 2026 14:42
ConcurrentHashMap을 Caffeine 캐시(expireAfterAccess 2분)로 교체해, 한 번이라도
호출된 사용자·도구 조합이 서버 재시작 전까지 메모리에 영구히 쌓이던 문제를 해소.
checkLimit()의 rate limit 로직(고정 윈도우 판단/리셋/증가) 자체는 변경 없음.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 26 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7f50a852-9a3f-4933-8c7e-fde41342e1d4

📥 Commits

Reviewing files that changed from the base of the PR and between b2487fc and 8843754.

📒 Files selected for processing (4)
  • backend/build.gradle
  • backend/src/main/java/com/opensource/docgrid/domain/mcp/security/McpRateLimiter.java
  • backend/src/test/java/com/opensource/docgrid/domain/mcp/security/McpRateLimiterTest.java
  • docs/design/kangcheolung-#292-mcp-rate-limiter-ttl.md

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.

@kangcheolung
kangcheolung merged commit 5cd974e into develop Aug 24, 2026
1 check 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.

[Fix] McpRateLimiter의 windows 맵이 TTL 없이 무한정 커지는 문제 수정

1 participant