Skip to content

[HCR-426] 함수 시그니처 변경#73

Merged
rettooo merged 1 commit into
mainfrom
hotfix/HSC-426
Mar 31, 2026
Merged

[HCR-426] 함수 시그니처 변경#73
rettooo merged 1 commit into
mainfrom
hotfix/HSC-426

Conversation

@rettooo
Copy link
Copy Markdown
Contributor

@rettooo rettooo commented Mar 31, 2026

📝작업 내용


👀변경 사항


🎫 Jira Ticket

  • Jira Ticket: HCR-426

#️⃣관련 이슈

@rettooo rettooo added 🏷️ release 릴리즈 준비/버전 태깅/릴리즈 노트/릴리즈 브랜치 작업 🗂️ area: BE 백엔드 영역 🚑 hotfix 프로덕션 긴급 수정(우회/긴급 패치 포함) 🚀 deploy 배포/런칭 작업(배포 스크립트, 환경 배포, 롤백 포함) 🔥 priority: P0 즉시 처리 필요(서비스/데모 블로커) release:patch 버전 patch bump: X.Y.(Z+1) deploy:intelligence-server labels Mar 31, 2026
@github-actions github-actions Bot added Customer Team ☁️ area: INFRA 인프라/운영/배포 영역 labels Mar 31, 2026
@github-actions github-actions Bot changed the title [HSC-426] fix: 함수 시그니처 변경 [HCR-426] 함수 시그니처 변경 Mar 31, 2026
@rettooo rettooo merged commit 0ccb64b into main Mar 31, 2026
5 checks passed
Copy link
Copy Markdown

@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

This pull request updates the run_recommendation_and_publish_to_kafka function to accept and propagate an optional trace_id for improved logging and tracking. The trace_id is passed to the Kafka publishing function and included in the error log context. Review feedback suggests extending this propagation to the get_recommendation call to ensure full observability across the recommendation logic. Additionally, there is a concern that the current exception handling block may be redundant if the underlying functions already catch and handle all exceptions internally.



async def run_recommendation_and_publish_to_kafka(member_id: int) -> None:
async def run_recommendation_and_publish_to_kafka(member_id: int, trace_id: str | None = None) -> None:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

trace_idpublish_recommendation_to_kafka에는 전달되지만, get_recommendation 호출 시에는 누락되어 있습니다. 추천 로직 내부(LLM 호출 등)에서 발생하는 로그와도 상관관계를 파악할 수 있도록 get_recommendation 함수에도 trace_id를 전달하는 것을 권장합니다. 이를 위해 get_recommendation 함수의 시그니처 변경이 함께 필요할 수 있습니다.

Comment on lines +152 to +158
logger.error(
"recommendation: 백그라운드 추천/Kafka 실패 member_id=%s trace_id=%s: %s",
member_id,
(trace_id or "").strip(),
e,
exc_info=True,
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

현재 get_recommendationpublish_recommendation_to_kafka 함수는 내부에서 모든 예외를 처리(catch)하고 로그를 남긴 뒤 결과를 반환하므로, 이 except Exception 블록은 실제로 실행될 가능성이 거의 없습니다. 의도한 대로 에러를 포착하여 로그를 남기려면 호출되는 함수들이 예외를 상위로 전파(raise)하도록 수정하거나, 반환된 응답의 상태를 체크하는 로직이 필요합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗂️ area: BE 백엔드 영역 ☁️ area: INFRA 인프라/운영/배포 영역 Customer Team deploy:intelligence-server 🚀 deploy 배포/런칭 작업(배포 스크립트, 환경 배포, 롤백 포함) 🚑 hotfix 프로덕션 긴급 수정(우회/긴급 패치 포함) 🔥 priority: P0 즉시 처리 필요(서비스/데모 블로커) release:patch 버전 patch bump: X.Y.(Z+1) 🏷️ release 릴리즈 준비/버전 태깅/릴리즈 노트/릴리즈 브랜치 작업

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant