Skip to content

[TD-1] 크롤링 트랜잭션 분리 (커넥션 점유 → 502) #96

Description

@ohhalim

문제

CollectService.collectOne()@Transactional 메서드 안에서 collector.collect()(수십 초 네트워크 I/O)를 호출.
DB 커넥션을 크롤링 종료까지 점유 → 소스 N개면 커넥션 N개가 수십 초 묶임 → t3.small 커넥션 풀 고갈 → 502.

해결

  • 크롤링(I/O)을 트랜잭션 에서 실행
  • 수집 결과를 받아 DB 저장(saveAll)만 별도 @Transactional 메서드로 분리
  • afterCommit 알림 트리거는 저장 트랜잭션에 연결

영향 파일

  • collect/service/CollectService.java

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions