ES /docs

CupixAuth#getSession missing retry on 504 — no retryable wrapper

Fix Plan: PotreeService::handlingMessageErrors — 502 Bad Gateway on GET /api/v1/sessions

Changes#

cupixworks: applications/agents/packages/api/src/authentication/cupix-auth.ts#

  • What: getSession() 메서드 본문에서 this.sessionApi().getSession(['id']) 호출을 기존 this.retryable(...) 헬퍼로 감싼다. retryable은 이미 같은 파일에 존재하며 e.statusCode > 500 조건으로 exponential backoff 재시도를 수행한다 (최대 Constants.MaxRetries=3회).
  • Why: RCA 근본 원인은 upstream ALB의 일시적 502이며, 애플리케이션 측 취약점은 세션 확인 호출에 재시도가 없다는 점이다 (Root Cause Summary). 동일 파일 내 헬퍼가 이미 5xx 재시도를 구현하므로 신규 로직 추가 없이 해당 호출부만 감싸는 것이 최소 변경.
  • Lines: 318-328 (getSession 메서드 본문).

cupixworks: applications/agents/packages/cupix-tesla-potree-agent/src/potree-service.ts#

  • What: handlingMessageErrors의 최종 logger.error('PotreeService::handlingMessageErrors | Error and message object - %s', ...) 호출을 재시도로 흡수 가능한 upstream 5xx (statusCode >= 500 && < 600)에 대해 logger.warn으로 downgrade. 그 외 케이스는 logger.error를 유지한다.
  • Why: RCA 단기 개선 항목 — 재시도 소진 후에도 남는 transient upstream 5xx는 자체 회복 가능하므로 error 소음을 줄인다. 메모리 (AUTH20022/AUTH20023 에피소드)에서 확인된 유사 패턴 (사후 로그 레벨 downgrade)을 사전 반영.
  • Lines: 502-525 (handlingMessageErrors 메서드).

Acceptance Criteria#

  • applications/agents/packages/api/src/authentication/cupix-auth.tsgetSession 본문에서 this.sessionApi().getSession(['id']) 호출이 this.retryable(...)로 감싸져 있다.
  • handlingMessageErrors 최종 로그가 5xx (>=500, <600) 에러에 대해 logger.warn, 그 외에는 logger.error로 분기된다.
  • 기존 fingerprint 로그 포맷 문자열 (PotreeService::handlingMessageErrors | Error and message object - %s)이 그대로 유지된다 (Datadog fingerprint / 알림 규칙 보존).
  • retryable 헬퍼의 signature/동작은 변경하지 않는다.
  • TypeScript tsc --build로 lint/type 이슈 없음.

Tests#

  • 기존 테스트: applications/agents/packages/api/src/cupix-api.spec.ts (기존 CupixApi 스모크 테스트 — 통과 유지).
  • 신규 테스트: 추가하지 않음. 해당 파일에 별도 cupix-auth.spec.ts가 없으며 (신규 테스트 하네스 도입은 스코프 초과), retryable은 이미 존재하는 검증된 헬퍼로서 새로운 로직 아님. 기존 spec 세트가 getSession 호출 경로를 커버하지 않으므로 회귀 리스크는 최소.