ES /docs

Api::V1::ElementRecordsController#bulk (avg 224651ms, max 224651ms)

Summary: Api::V1::ElementRecordsController#bulk latency (Cupix::HttpClient timeout 미설정)

결과#

Cupix::HttpClient 5개 verb 메서드에 명시적 open_timeout=5s / read_timeout=30s 를 도입하는 tesla PR을 생성했다. 이후 upstream(Siteinsights 등) hang 시에도 최악 ~97초 이내에 실패로 종료되어 Puma worker가 무기한 점유되는 것을 방지한다. Blind validator attempt 1에서 APPROVED.

Pull Requests#

Repo PR Branch
tesla https://dev.azure.com/cupix/tesla/_git/tesla/pullrequest/88794 feature/TSLA-13560

변경 내용#

  • tesla lib/cupix/http_client.rb: DEFAULT_OPEN_TIMEOUT = 5, DEFAULT_READ_TIMEOUT = 30 상수 추가. get/post/put/patch/delete 호출을 RestClient::Request.execute(method:, url:, [payload:,] headers:, open_timeout:, read_timeout:) 형태로 리팩터. RETRIABLE_STATUS_CODES + 지수 backoff 재시도 로직은 유지.
  • tesla spec/lib/cupix/http_client_spec.rb: mocks를 RestClient::Request.execute 기반으로 갱신하고, expected_args 헬퍼로 성공 케이스에서 timeout 인자 전달을 explicit with(...) matcher 로 검증.

후속 (본 PR 범위 외)#

RCA의 "단기 개선"(endpoint별 timeout 파라미터 확장, Rack::Timeout 도입 검토, Siteinsights bulk 비동기화)과 "장기 개선"(전역 lint로 RestClient 직접 사용 금지, circuit breaker, APM span attributes)은 별도 tracker로 분리 필요.

Cleanup#

bash
cd $REPOS_DIR/tesla
git worktree remove /home/ec2-user/error-sweeper/.worktrees/9777387c-a948-4d9b-89a2-e72255505230/tesla