Skip to content

[FIX] 다중 finding 분석 시 DB 이벤트 루프 충돌 및 작업 timeout 보완 - #40

Merged
dldusgh318 merged 2 commits into
SeCause:developfrom
dldusgh318:develop
Sep 27, 2026
Merged

dldusgh318 merged 2 commits into
SeCause:developfrom
dldusgh318:develop

Conversation

@dldusgh318

@dldusgh318 dldusgh318 commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

‼️ 관련 이슈

close #39


🔎 개요

다중 finding 처리 시 반복 생성된 이벤트 루프로 인해 asyncpg DB 연결이 충돌하는 문제를 수정했습니다.


📝 작업 내용

  • 분석 작업당 asyncio.run() 1회만 호출하도록 변경
  • 여러 finding의 DB 조회가 동일한 이벤트 루프에서 실행되도록 변경
  • finding별 RAG 검색 및 LLM 설명 생성 진행 로그 추가
  • RQ enqueue에 job_timeout 명시
  • 다중 finding 처리 및 이벤트 루프 회귀 테스트 추가

👀 변경 사항

  • ANALYSIS_JOB_TIMEOUT_SECONDS 환경변수 추가
  • 기본값: 1800초
  • .env.example 갱신

✅ 체크리스트

  • label, milestone, assignees, reviewers 등을 지정했습니다.
  • 성능 개선/최적화 관련 내용을 확인했습니다.
  • 전체 59개 테스트를 통과했습니다.
  • 테스트 시 사용한 로그를 삭제했습니다.

💬 고민사항 및 리뷰 요구사항

  • 다중 finding의 DB 조회가 동일한 이벤트 루프에서 실행되는지 확인 부탁드립니다.
  • RQ 작업 제한 시간 기본값 30분이 운영 환경에 적절한지 검토 부탁드립니다.

Summary by CodeRabbit

  • 개선 사항
    • 분석 작업에 최대 실행 시간 설정이 적용됩니다. 기본값은 30분입니다.
    • 여러 분석 항목의 근거를 순차적으로 검색하며, 개별 검색에 실패해도 나머지 항목의 처리를 이어갑니다.
    • 분석 및 근거 검색의 진행 상황과 완료 상태를 로그에 기록합니다.

@dldusgh318 dldusgh318 self-assigned this Sep 27, 2026
@dldusgh318 dldusgh318 added the 🐛 BUG Something isn't working label Sep 27, 2026
@coderabbitai

coderabbitai Bot commented Sep 27, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 0d40631f-d3c6-473c-ab07-97655454d706

📥 Commits

Reviewing files that changed from the base of the PR and between a6d9bf6 and 3da1b7c.

📒 Files selected for processing (9)
  • .env.example
  • app/api/routes/analyze.py
  • app/core/config.py
  • app/jobs/analysis_job.py
  • app/services/rag/hybrid_search.py
  • tests/api/test_analyze.py
  • tests/jobs/test_analysis_job.py
  • tests/services/rag/__init__.py
  • tests/services/rag/test_hybrid_search.py
 __________________________________________________
< Deploying the charm offensive against your bugs. >
 --------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

@boogiewooki02

Copy link
Copy Markdown
Contributor

확인했습니다!
머지하면 될 것 같아요~

@dldusgh318
dldusgh318 merged commit 69dfdaa into SeCause:develop Sep 27, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 BUG Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FIX] 다중 finding 분석 시 DB 이벤트 루프 충돌 및 작업 timeout 보완

2 participants