Repository navigation
fix: 회원 한 명의 Slack 사진 동기화를 회원 행 잠금 밖에서 한다 - #153
Merged
Merged
Conversation
syncProfileImageFromSlack이 회원 행을 FOR UPDATE로 잠근 트랜잭션 안에서 Slack HTTP를 기다려, 그동안 같은 회원의 로그인·토큰 갱신(같은 행을 잠근다)이 막혔다. - SlackProfileSyncService.syncOne으로 옮겨, 잠금 없이 회원을 읽고 트랜잭션 밖에서 Slack을 부른 뒤 저장만 기존 updatePhotoUrl 트랜잭션으로 한다(전체 동기화 syncAll과 같은 방식). - 응답과 에러는 그대로다.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 7 minutes. View limit details
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
POST /v1/admin/members/{id}/photo/slack-sync(MemberDirectoryService.syncProfileImageFromSlack)가 회원 행을FOR UPDATE로 잠근 트랜잭션 안에서 Slack HTTP 응답을 기다렸다. 그동안(Slack 타임아웃까지 수 초) DB 커넥션을 쥐고, 같은 회원 행을 잠그는 로그인·토큰 갱신이 기다려야 했다. 코드베이스의 다른 외부 호출(메일, 전체 동기화)은 이미 트랜잭션 밖에서 한다.변경
SlackProfileSyncService.syncOne(memberId)로 옮겼다: 잠금 없이 회원을 읽고 → 트랜잭션 밖에서 Slack 이메일 조회 → 저장만 기존MemberDirectoryService.updatePhotoUrl트랜잭션(짧은 행 잠금)으로 한다. 전체 동기화syncAll과 같은 방식이다.{photoUrl})과 에러(회원 없음 404, Slack 프로필 없음)는 그대로다.MemberDirectoryService는 더 이상SlackClient에 의존하지 않는다.테스트
MemberSlackIdIntegrationTest: Slack 호출 시점에 트랜잭션이 없고(TransactionSynchronizationManager.isActualTransactionActive() == false) 사진이 저장된다../gradlew test: 549건 중 548 통과, 1 스킵.