fix(messaging): inbox 트랜잭션 runner가 쓰기와 같은 30초 상한으로 트랜잭션을 연다 #21

Closed
donghyeon.kang wants to merge 0 commits from claude/r9-tx-timeouts into main
Owner

무엇을, 왜

round9 리뷰 RR9-01-01(Medium)을 고친다. inbound messaging의 IdempotentConsumer.TransactionRunner가 new TransactionTemplate(transactionManager)를 상한 없이 썼다. handler의 유스케이스가 부르는 TransactionPort.inWrite는 이 트랜잭션에 합류하고, 합류한 쓰기는 자기 상한(app.persistence-jpa.transaction.write-timeout 30s)을 걸지 않는다. 그래서 막힌 문장이나 잠금 대기가 연결과 partition을 그 시간 내내 쥐었다. docs/work/reference/decisions.md 2.5 JPA 기본값 「트랜잭션 제한 30초」와 다르다.

고른 방법과 버린 대안

  • TransactionTemplate에 쓰기와 같은 30초를 건다(상수 TRANSACTION_TIMEOUT_SECONDS). 설정 키는 더하지 않았다. 쓰기 상한과 따로 움직일 이유가 아직 없고, 키를 더하면 env 계약도 늘어난다.
  • 버린 안: persistence-jpa의 write-timeout 설정을 읽어 쓰기. 이 leaf가 persistence-jpa 설정에 기대게 되어 registry edge가 생긴다.
  • 같은 묶음(B9)의 나머지 발견(RR9-01-03·07·09·10·14·25·26)은 병렬 그룹 B가 맡는다.

위험과 영향

  • 30초를 넘기던 handler는 이제 롤백되고 재전달된다. 그런 handler는 원래 쓰기 상한도 넘긴 것이다.

검증

desktop, --no-build-cache, 로그 ~/r9-be-logs/b9a-{red,green2}.log.

  • RED: 기준 a7e38c10 + 시험만으로 MessagingInboxAutoConfigurationTest 8건 중 새 시험 1건 실패(상한이 걸리지 않음).
  • GREEN: :adapter:inbound:messaging:check(spotless·error-prone·시험 12건) rc=0.
  • 노트북(main fe0f8141 병합 뒤): check-docs.py·check-work-docs.py·check-repo-layout.py rc=0.

리뷰어가 볼 곳

  • MessagingInboxAutoConfiguration.messagingInboxTransactions의 setTimeout 한 줄과 시험의 RecordingTransactions(begin 때 definition.getTimeout()을 기록).

관련

  • 리뷰 기록: PR #17 docs/reviews/2026-11-12-round9-review/ RR9-01-01.
## 무엇을, 왜 round9 리뷰 RR9-01-01(Medium)을 고친다. inbound messaging의 `IdempotentConsumer.TransactionRunner`가 `new TransactionTemplate(transactionManager)`를 상한 없이 썼다. handler의 유스케이스가 부르는 `TransactionPort.inWrite`는 이 트랜잭션에 합류하고, 합류한 쓰기는 자기 상한(`app.persistence-jpa.transaction.write-timeout` 30s)을 걸지 않는다. 그래서 막힌 문장이나 잠금 대기가 연결과 partition을 그 시간 내내 쥐었다. `docs/work/reference/decisions.md` 2.5 JPA 기본값 「트랜잭션 제한 30초」와 다르다. ## 고른 방법과 버린 대안 - `TransactionTemplate`에 쓰기와 같은 30초를 건다(상수 `TRANSACTION_TIMEOUT_SECONDS`). 설정 키는 더하지 않았다. 쓰기 상한과 따로 움직일 이유가 아직 없고, 키를 더하면 env 계약도 늘어난다. - 버린 안: persistence-jpa의 write-timeout 설정을 읽어 쓰기. 이 leaf가 persistence-jpa 설정에 기대게 되어 registry edge가 생긴다. - 같은 묶음(B9)의 나머지 발견(RR9-01-03·07·09·10·14·25·26)은 병렬 그룹 B가 맡는다. ## 위험과 영향 - 30초를 넘기던 handler는 이제 롤백되고 재전달된다. 그런 handler는 원래 쓰기 상한도 넘긴 것이다. ## 검증 desktop, `--no-build-cache`, 로그 `~/r9-be-logs/b9a-{red,green2}.log`. - RED: 기준 `a7e38c10` + 시험만으로 `MessagingInboxAutoConfigurationTest` 8건 중 새 시험 1건 실패(상한이 걸리지 않음). - GREEN: `:adapter:inbound:messaging:check`(spotless·error-prone·시험 12건) rc=0. - 노트북(main `fe0f8141` 병합 뒤): `check-docs.py`·`check-work-docs.py`·`check-repo-layout.py` rc=0. ## 리뷰어가 볼 곳 - `MessagingInboxAutoConfiguration.messagingInboxTransactions`의 `setTimeout` 한 줄과 시험의 `RecordingTransactions`(begin 때 `definition.getTimeout()`을 기록). ## 관련 - 리뷰 기록: PR #17 `docs/reviews/2026-11-12-round9-review/` RR9-01-01.
donghyeon.kang added 2 commits 2026-11-12 18:23:35 +00:00
문제: inbound messaging의 IdempotentConsumer.TransactionRunner는
new TransactionTemplate(transactionManager)를 상한 없이 썼다. handler의
유스케이스가 부르는 TransactionPort.inWrite는 이 트랜잭션에 합류하고, 합류한
쓰기는 자기 상한(app.persistence-jpa.transaction.write-timeout 30s)을 걸지
않는다. 그래서 막힌 문장이나 잠금 대기가 연결과 partition을 그 시간 내내
쥐었다. docs/work/reference/decisions.md 2.5 JPA 기본값
「트랜잭션 제한 30초」와 다르다.

고른 방법: TransactionTemplate에 쓰기와 같은 30초를 건다. 값은 상수 하나
(TRANSACTION_TIMEOUT_SECONDS)이고, 설정 키는 더하지 않았다 — 쓰기 상한과
따로 움직일 이유가 아직 없고, 키를 더하면 env 계약도 늘어난다.
버린 대안: 쓰기 상한 설정(write-timeout)을 읽어 쓰기 — 이 leaf가
persistence-jpa 설정에 기대게 되어 registry edge가 생긴다.

위험·한계: 30초를 넘기던 handler는 이제 롤백되고 재전달된다. 그런
handler는 원래 쓰기 상한도 넘긴 것이다.

검증(desktop, --no-build-cache):
- RED: 기준 a7e38c10 + 시험만으로
  MessagingInboxAutoConfigurationTest 8건 중 새 시험 1건 실패(상한이 걸리지 않음).
- GREEN: :adapter:inbound:messaging:check rc=0.
donghyeon.kang added 1 commit 2026-11-12 18:59:04 +00:00
Merge branch 'main' into claude/r9-tx-timeouts
pr / done (pull_request) Canceled after 0s
b6263053aa
Author
Owner

#28로 병합됐다(main 3d31896a). 이 PR의 head b6263053가 #28 브랜치에 merge 커밋으로 들어 있고, #28의 runner pr / done이 그 합친 트리로 초록이었다. runner 대기를 줄이려고 이번만 쓴 방식이다(소유자 승인, 2026-11-13).

#28로 병합됐다(main `3d31896a`). 이 PR의 head `b6263053`가 #28 브랜치에 merge 커밋으로 들어 있고, #28의 runner `pr / done`이 그 합친 트리로 초록이었다. runner 대기를 줄이려고 이번만 쓴 방식이다(소유자 승인, 2026-11-13).
donghyeon.kang closed this pull request 2026-11-12 23:28:31 +00:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: donghyeon.kang/clean-architecture-backend-template#21