Repository navigation
fix(k-skill-proxy): 상위 연결 실패를 503/504로 구분 (#700) - #704
Merged
Merged
Conversation
apis.data.go.kr·kosis.kr 같은 상위가 TCP timeout이면 라우트가 불투명한 500 proxy_error + "fetch failed"만 돌려줘 원인을 구분할 수 없었다. upstream-errors.js의 classifyUpstreamFailure로 DNS/connect 실패를 503 upstream_unreachable, connect/response timeout을 504 upstream_timeout 으로 매핑하고, setErrorHandler가 upstream.cause와 upstream.route를 함께 응답한다. gpu01 이관 문서에 상위 연결 트리아지 절차를 추가한다.
…c DOMException codes (#700)
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.
Refs #700 (원인 일부는 gpu01 egress 밖 상위/경로 문제라 이 PR만으로 라우트가 복구되지는 않습니다)
진단 결과
이슈의 실패 라우트는 모두 같은 상위 네트워크를 공유합니다.
/v1/korea-weather/forecastapis.data.go.kr(27.101.236.63)proxy_error/ "fetch failed"/v1/korean-holiday/calendarapis.data.go.krfetch failed/v1/kosis/searchkosis.kr(27.101.194.203)fetch failed/v1/fine-dust/reportapis.data.go.krupstream_fetch_failed/v1/fsc/corp-outlineapis.data.go.krupstream_timeout27.101.0.0/16(KMA·AirKorea·MOLIT·KOSIS 호스트)로의 TCP 443/80 연결이 모두 timeout(DNS는 1.1.1.1/KT DNS 모두 정상 해석).api.odcloud.kr(NTS, Naver Cloud)는 정상 → 일반 네트워크 장애 아님.www.data.go.kr는 응답 → 프록시 설정 문제 아님.변경
packages/k-skill-proxy/src/upstream-errors.js신규:classifyUpstreamFailure()가 DNS/connect 실패를503 upstream_unreachable, connect/response timeout을504 upstream_timeout으로 매핑.setErrorHandler가 이 분류를 사용해upstream.cause(소켓 코드)와upstream.route를 함께 응답. 기존error.code/statusCode(예: AirKoreaupstream_fetch_failed502, FSCupstream_timeout504)는 그대로 유지.docs/deploy-k-skill-proxy.md에 "Upstream connectivity triage" 절차 추가.검증
packages/k-skill-proxy/test/server.test.js: 분류기 단위 테스트 + weather/KOSIS/holiday 라우트가 fetch 실패 시 503upstream_unreachable(causeECONNREFUSED), timeout 시 504upstream_timeout(causeABORT_ERR)을 반환하는 통합 테스트.node --test430 pass / 0 fail.npm run lint통과.남은 작업 (이 PR 범위 밖)
27.101.0.0/16도달성/라우팅과 ISP 경로 확인, 상위 복구 후 재현 명령·/health·/privacy재실행. 복구 전까지#700은 열어 둡니다.