Skip to content

Conversation

@lee-si-yeon
Copy link
Collaborator

@lee-si-yeon lee-si-yeon commented Feb 10, 2026

🔗 Related Issue

📝 Summary

서버 타임아웃 대응으로 Gemini 재시도 지수 백오프(2→4→8… 최대 60~90초)를 추가

🔄 Changes

  • API 변경 (추가/수정)
  • 데이터 및 도메인 변경 (DB, 비즈니스 로직)
  • 설정 또는 인프라 관련 변경
  • 리팩토링

💬 Questions & Review Points

📸 API Test Results (Swagger)

✅ Checklist

  • API 테스트 완료
  • 테스트 결과 사진 첨부
  • 빌드 성공 확인 (./gradlew build)

@lee-si-yeon lee-si-yeon self-assigned this Feb 10, 2026
@lee-si-yeon lee-si-yeon added the ♻️ refactor 코드 구조 개선 label Feb 10, 2026
@lee-si-yeon lee-si-yeon linked an issue Feb 10, 2026 that may be closed by this pull request
2 tasks
@lee-si-yeon lee-si-yeon added the 시연 시연 label Feb 10, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @lee-si-yeon, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 Gemini API 호출 시 발생하는 서버 타임아웃 문제를 개선하기 위해 재시도 메커니즘을 강화합니다. 재시도 횟수와 전체 제한 시간을 늘리고, 지수 백오프 전략을 조정하여 실패 시 대기 시간을 효과적으로 늘림으로써, 일시적인 네트워크 문제나 서버 부하로 인한 타임아웃에 더욱 견고하게 대응할 수 있도록 합니다.

Highlights

  • 재시도 횟수 증가: Gemini API 호출의 최대 재시도 횟수를 2회에서 4회로 늘렸습니다.
  • 전체 제한 시간 확장: Gemini API 호출의 전체 제한 시간을 70초에서 240초로 확장했습니다.
  • 최대 백오프 시간 조정: 재시도 시 적용되는 최대 백오프 시간을 2초(2,000ms)에서 90초(90,000ms)로 대폭 늘렸습니다.
  • 지수 백오프 로직 개선: 지수 백오프 계산 로직을 수정하여 attempt=1 실패 후 2초, attempt=2 실패 후 4초 등으로 동작하도록 개선했습니다.
  • 지터(Jitter) 적용 방식 변경: 백오프에 적용되는 지터(jitter)를 고정값(150ms)에서 백오프 시간의 0~10%로 동적으로 조정하도록 변경했습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/main/java/org/umc/valuedi/global/external/genai/client/GeminiClient.java
    • Gemini API 호출 관련 상수(MAX_ATTEMPTS, OVERALL_DEADLINE, MAX_BACKOFF_MILLIS)가 업데이트되었습니다.
    • 재시도 시 백오프 대기 시간을 계산하는 sleepBackoff 메서드의 로직이 수정되었습니다.
    • 백오프 로깅 메시지가 상세화되었습니다.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

안녕하세요. Gemini API 재시도 로직 변경에 대한 코드 리뷰입니다.
전반적으로 타임아웃 문제를 해결하기 위해 재시도 횟수와 백오프 간격을 조정한 점이 좋아 보입니다. 특히 지수 백오프와 jitter를 도입하여 재시도 로직을 견고하게 만든 점이 인상적입니다.

다만, 한 가지 우려되는 점이 있습니다. PR 설명과 코드 주석에는 백오프 간격이 2초, 4초, 8초로 명시되어 있지만, 실제 코드 구현은 BASE_BACKOFF_MILLIS 값으로 인해 0.4초, 0.8초, 1.6초로 동작합니다. 이는 의도한 것보다 훨씬 짧은 간격으로, 타임아웃 개선 효과가 기대에 미치지 못할 수 있습니다. 이 부분에 대한 확인이 필요해 보입니다. 자세한 내용은 코드에 남긴 개별 코멘트를 참고해주세요.

@lee-si-yeon lee-si-yeon merged commit 8c7e0c5 into main Feb 10, 2026
1 check passed
@seamooll seamooll deleted the fix/#96-gemini-retry-backoff branch February 10, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♻️ refactor 코드 구조 개선 시연 시연

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FIX] 제미나이 재시도 간격 조정 및 타임아웃 완화

2 participants