Skip to content

πŸ”€ :: [#557] - Redis κ΄€λ ¨ 섀정을 ν•˜λ‚˜μ˜ κ°μ²΄μ—μ„œ κ΄€λ¦¬ν•˜λ„λ‘ μˆ˜μ •#558

Merged
dolong2 merged 4 commits intodevelopfrom
refac/redis-connection-config
Mar 17, 2025
Merged

Conversation

@dolong2
Copy link
Owner

@dolong2 dolong2 commented Mar 17, 2025

κ°œμš”

  • Redis κ΄€λ ¨ 섀정을 ν•˜λ‚˜μ˜ κ°μ²΄μ—μ„œ κ΄€λ¦¬ν•˜λ„λ‘ μˆ˜μ •ν•©λ‹ˆλ‹€.

μž‘μ—…λ‚΄μš©

  • RedissonConfig 제거
  • RedisConfigμ—μ„œ RedissonClientλ₯Ό 빈으둜 λ“±λ‘ν•˜λ„λ‘ μˆ˜μ •
  • Lock νšλ“ μ‹€νŒ¨μ‹œ λ‘œκΉ… 문ꡬ μˆ˜μ •
  • Lock νšλ“ μ‹€νŒ¨μ‹œ error 레벨둜 λ‘œκΉ…ν•˜λ„λ‘ μˆ˜μ •

체크리슀트

νƒ¬ν”Œλ¦Ώμ™Έμ— ν•„μš”ν•œ ν•­λͺ©μ΄ 있으면 μΆ”κ°€ν•΄μ£Όμ„Έμš”.

  • λ‘œμ»¬μ—μ„œ λΉŒλ“œκ°€ μ„±κ³΅ν•˜λ‚˜μš”?
  • μΆ”κ°€(μˆ˜μ •)ν•œ μ½”λ“œκ°€ μ •μƒμ μœΌλ‘œ λ™μž‘ν•˜λ‚˜μš”?
  • pr 타켓 λΈŒλžœμΉ˜κ°€ 맞게 μ„€μ •λ˜μ–΄ μžˆλ‚˜μš”?
  • prμ—μ„œ μž‘μ—…ν•  λ‚΄μš©μ™Έμ— μž‘μ—…ν•œ λ‚΄μš©μ΄ μžˆλ‚˜μš”?
  • κΈ°μ‘΄ API와 ν˜Έν™˜λ˜μ§€ μ•ŠλŠ” 사항이 μžˆλ‚˜μš”?

Summary by CodeRabbit

  • 버그 μˆ˜μ •
    • 잠금 μ‹€νŒ¨ μ‹œ λ‘œκ·Έκ°€ 였λ₯˜ 레벨둜 κΈ°λ‘λ˜μ–΄ 문제 인식이 더 μš©μ΄ν•΄μ‘ŒμŠ΅λ‹ˆλ‹€.
  • μ‹ κ·œ κΈ°λŠ₯
    • Redis μ—°κ²° 섀정이 κ°œμ„ λ˜μ–΄ 보닀 μ•ˆμ •μ μΈ λ°μ΄ν„°λ² μ΄μŠ€ 접근이 κ°€λŠ₯ν•΄μ‘ŒμŠ΅λ‹ˆλ‹€.
  • λ¦¬νŒ©ν† λ§
    • μ€‘λ³΅λœ Redis ꡬ성 μš”μ†Œκ°€ μ œκ±°λ˜μ–΄ μ‹œμŠ€ν…œ ꡬ성이 λ‹¨μˆœν™”λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

@dolong2 dolong2 added 3️⃣ Priority: ν•˜ μš°μ„ μˆœμœ„ ν•˜ πŸ”¨ Refactor μ½”λ“œ λ¦¬νŒ©ν† λ§ labels Mar 17, 2025
@dolong2 dolong2 self-assigned this Mar 17, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 17, 2025

Walkthrough

이번 PR은 μ„Έ κ°€μ§€ μ£Όμš” λ³€κ²½ 사항을 ν¬ν•¨ν•©λ‹ˆλ‹€. LockAspect 클래슀의 redissonLock λ©”μ„œλ“œμ—μ„œλŠ” 잠금 νšλ“ μ‹€νŒ¨ μ‹œ κΈ°λ‘λ˜λŠ” 둜그 λ ˆλ²¨μ„ λ””λ²„κ·Έμ—μ„œ μ—λŸ¬λ‘œ λ³€κ²½ν•˜μ˜€μŠ΅λ‹ˆλ‹€. λ˜ν•œ, κΈ°μ‘΄ Redis μ„€μ • 뢄산을 κ°œμ„ ν•˜κΈ° μœ„ν•΄ RedisConfig ν΄λž˜μŠ€μ— redissonClient() Bean λ©”μ„œλ“œκ°€ μΆ”κ°€λ˜μ—ˆμœΌλ©°, λ™μΌν•œ κΈ°λŠ₯을 μ œκ³΅ν•˜λ˜ RedissonConfig ν΄λž˜μŠ€λŠ” μ‚­μ œλ˜μ—ˆμŠ΅λ‹ˆλ‹€.

Changes

파일 λ³€κ²½ μš”μ•½
src/.../aop/LockAspect.kt redissonLock λ©”μ„œλ“œ λ‚΄ 둜그 λ ˆλ²¨μ„ debugμ—μ„œ error둜 μˆ˜μ •ν•˜μ—¬, μ‹€νŒ¨ν•œ 잠금 νšλ“ 상황을 μ—λŸ¬λ‘œ κΈ°λ‘ν•˜λ„λ‘ λ³€κ²½
src/.../global/config/RedisConfig.kt
src/.../global/config/RedissonConfig.kt
Redis μ„€μ • 톡합: RedisConfig에 redissonClient() λ©”μ„œλ“œλ₯Ό μΆ”κ°€ν•˜μ—¬ RedissonClient μΈμŠ€ν„΄μŠ€λ₯Ό μƒμ„±ν•˜κ³ , κΈ°μ‘΄ RedissonConfig 클래슀λ₯Ό μ‚­μ œ

Sequence Diagram(s)

sequenceDiagram
    participant Client as ν΄λΌμ΄μ–ΈνŠΈ μ½”λ“œ
    participant LockAspect as LockAspect
    participant Logger as λ‘œκΉ… μ‹œμŠ€ν…œ
    Client->>LockAspect: redissonLock 호좜
    alt 잠금 νšλ“ 성곡
        LockAspect-->>Client: 처리 μ§„ν–‰
    else 잠금 νšλ“ μ‹€νŒ¨
        LockAspect->>Logger: μ—λŸ¬ 둜그 기둝("Lock νšλ“ μ‹€νŒ¨: lockKey")
        LockAspect-->>Client: μ‹€νŒ¨ 처리 λ°˜ν™˜
    end
Loading
sequenceDiagram
    participant App as Spring μ• ν”Œλ¦¬μΌ€μ΄μ…˜
    participant RedisConfig as RedisConfig Bean λ©”μ„œλ“œ
    participant Redisson as Redisson.create(config)
    App->>RedisConfig: redissonClient() 호좜
    RedisConfig->>Redisson: Config 객체λ₯Ό μ‚¬μš©ν•΄ RedissonClient 생성
    Redisson-->>RedisConfig: μΈμŠ€ν„΄μŠ€ λ°˜ν™˜
    RedisConfig-->>App: μƒμ„±λœ RedissonClient λ°˜ν™˜
Loading

Possibly related PRs

  • πŸ”€ :: [#555] - 뢄산락 적용 #556: LockAspect 클래슀의 잠금 νšλ“ λ‘œκΉ… λ³€κ²½κ³Ό κ΄€λ ¨λ˜μ–΄, λ™μΌν•œ λΆ„μ‚° 잠금 관리 κΈ°λŠ₯에 λŒ€ν•œ μˆ˜μ •μ΄ 이루어진 PRμž…λ‹ˆλ‹€.

Suggested labels

:memo: Doc

Poem

λ‚˜λŠ” 깑총깑총 ν† λΌμ˜ˆμš”, μ½”λ“œ 숲 속을 λˆ„λΉ„λ©°
λ‘œκ·Έκ°€ μ—λŸ¬λ‘œ 반짝, 문제λ₯Ό μ•Œλ¦¬λŠ” 빛이 λ˜μ—ˆλ„€ πŸ‡
Redis μ„€μ • 길도 ν†΅ν•©λ˜μ–΄, μ½”λ“œκ°€ 더 κΉ”λ”ν•΄μ‘Œμ£ 
낑은 섀정듀은 사라지고, μƒˆ 봄을 λ§žμ΄ν•˜λ„€μš” 🌱
토끼 발자ꡭ 남기며, 즐거운 λ³€ν™”μ˜ λ…Έλž˜λ₯Ό λΆ€λ¦…λ‹ˆλ‹€!
πŸ₯•βœ¨ Happy coding!

Tip

⚑πŸ§ͺ Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

πŸ“œ Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 1cf6f24 and f4d8ad5.

πŸ“’ Files selected for processing (3)
  • src/main/kotlin/com/dcd/server/core/common/aop/LockAspect.kt (1 hunks)
  • src/main/kotlin/com/dcd/server/infrastructure/global/config/RedisConfig.kt (2 hunks)
  • src/main/kotlin/com/dcd/server/infrastructure/global/config/RedissonConfig.kt (0 hunks)
πŸ’€ Files with no reviewable changes (1)
  • src/main/kotlin/com/dcd/server/infrastructure/global/config/RedissonConfig.kt
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build and Test
πŸ”‡ Additional comments (3)
src/main/kotlin/com/dcd/server/core/common/aop/LockAspect.kt (1)

35-35: 둜그 레벨 λ³€κ²½ 및 λ©”μ‹œμ§€ ν˜•μ‹ κ°œμ„ μ΄ μ μ ˆν•©λ‹ˆλ‹€.

락 νšλ“ μ‹€νŒ¨ μ‹œ 둜그 λ ˆλ²¨μ„ debugμ—μ„œ error둜 λ³€κ²½ν•˜κ³ , λ©”μ‹œμ§€ ν˜•μ‹μ„ "Lock νšλ“ μ‹€νŒ¨: $lockKey"둜 κ°œμ„ ν•œ 것은 맀우 μ μ ˆν•©λ‹ˆλ‹€. μ΄λ ‡κ²Œ ν•˜λ©΄ 락 νšλ“ μ‹€νŒ¨μ™€ 같은 μ€‘μš”ν•œ μ΄λ²€νŠΈκ°€ 더 잘 κ΄€μ°°λ˜κ³ , λ‘œκ·Έμ—μ„œ 문제λ₯Ό 더 μ‰½κ²Œ 식별할 수 μžˆμŠ΅λ‹ˆλ‹€.

src/main/kotlin/com/dcd/server/infrastructure/global/config/RedisConfig.kt (2)

3-5: ν•„μš”ν•œ μž„ν¬νŠΈ μΆ”κ°€ 확인.

RedissonClient κ΄€λ ¨ κΈ°λŠ₯을 RedisConfig 클래슀둜 ν†΅ν•©ν•˜κΈ° μœ„ν•œ ν•„μš”ν•œ μž„ν¬νŠΈλ“€μ΄ μ μ ˆν•˜κ²Œ μΆ”κ°€λ˜μ—ˆμŠ΅λ‹ˆλ‹€.


28-33:

Details

❓ Verification inconclusive

Redis μ„€μ • 톡합이 μ μ ˆν•˜κ²Œ κ΅¬ν˜„λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

RedissonConfig ν΄λž˜μŠ€μ—μ„œ μ œκ³΅ν•˜λ˜ κΈ°λŠ₯을 RedisConfig 클래슀둜 ν†΅ν•©ν•œ 것은 쒋은 μ ‘κ·Ό λ°©μ‹μž…λ‹ˆλ‹€. μ΄λ ‡κ²Œ ν•˜λ©΄ Redis κ΄€λ ¨ 섀정이 ν•œ κ³³μ—μ„œ κ΄€λ¦¬λ˜λ―€λ‘œ μ½”λ“œμ˜ 가독성과 μœ μ§€λ³΄μˆ˜μ„±μ΄ ν–₯μƒλ©λ‹ˆλ‹€.

μ„€μ • 방식도 κΈ°μ‘΄κ³Ό λ™μΌν•˜κ²Œ μœ μ§€ν•˜μ—¬ ν˜Έν™˜μ„± 문제λ₯Ό μ΅œμ†Œν™”ν–ˆμŠ΅λ‹ˆλ‹€. 단일 Redis μ„œλ²„ μ—°κ²° 섀정이 κ°„κ²°ν•˜κ²Œ κ΅¬ν˜„λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

λ‹€λ§Œ, PR λͺ©ν‘œμ— μ–ΈκΈ‰λœ λŒ€λ‘œ API ν˜Έν™˜μ„± μ΄μŠˆκ°€ μžˆμ„ 수 μžˆμœΌλ‹ˆ 이 뢀뢄에 λŒ€ν•œ ν…ŒμŠ€νŠΈκ°€ μ§„ν–‰λ˜μ—ˆλŠ”μ§€ ν™•μΈν•˜λŠ” 것이 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€.


🏁 Script executed:

#!/bin/bash
# RedissonClientλ₯Ό μ£Όμž…λ°›λŠ” ν΄λž˜μŠ€λ“€μ„ μ°Ύμ•„ λ¦¬νŒ©ν† λ§ 이후에도 정상 μž‘λ™ν•˜λŠ”μ§€ 확인
echo "RedissonClientλ₯Ό μ‚¬μš©ν•˜λŠ” 클래슀 λͺ©λ‘:"
rg -l "RedissonClient" --type kotlin

Length of output: 239


Redis μ„€μ • 톡합 κ΅¬ν˜„ 확인 및 API ν˜Έν™˜μ„± ν…ŒμŠ€νŠΈ μž¬κ²€ν†  μš”μ²­

  • Redis μ„€μ • 톡합 방식은 μ½”λ“œ 가독성과 μœ μ§€λ³΄μˆ˜μ„±μ„ 크게 ν–₯μƒμ‹œν‚€λ©°, 단일 μ„œλ²„ μ—°κ²° 섀정도 κΈ°μ‘΄κ³Ό λ™μΌν•˜κ²Œ μœ μ§€λ˜μ–΄ 큰 문제 μ—†μ–΄ λ³΄μž…λ‹ˆλ‹€.
  • ν˜„μž¬ RedissonClientλŠ” μ•„λž˜ 두 νŒŒμΌμ—μ„œ μ‚¬μš© μ€‘μž„μ΄ ν™•μΈλ˜μ—ˆμŠ΅λ‹ˆλ‹€:
    • src/main/kotlin/com/dcd/server/infrastructure/global/config/RedisConfig.kt
    • src/main/kotlin/com/dcd/server/core/common/aop/LockAspect.kt
  • λ‹€λ§Œ, PR λͺ©ν‘œμ— μ–ΈκΈ‰λœ λŒ€λ‘œ API ν˜Έν™˜μ„± μ΄μŠˆμ— λŒ€ν•œ ν…ŒμŠ€νŠΈκ°€ μ§„ν–‰λ˜μ—ˆλŠ”μ§€ ν•œ 번 더 확인해 μ£Όμ‹œκΈ° λ°”λžλ‹ˆλ‹€.
✨ Finishing Touches
  • πŸ“ Generate Docstrings

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
πŸͺ§ Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@dolong2 dolong2 merged commit 6fa8ce2 into develop Mar 17, 2025
2 checks passed
@dolong2 dolong2 deleted the refac/redis-connection-config branch March 17, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

πŸ”¨ Refactor μ½”λ“œ λ¦¬νŒ©ν† λ§ 3️⃣ Priority: ν•˜ μš°μ„ μˆœμœ„ ν•˜

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redis κ΄€λ ¨ 섀정을 ν•˜λ‚˜μ˜ κ°μ²΄μ—μ„œ κ΄€λ¦¬ν•˜λ„λ‘ μˆ˜μ •

1 participant