Skip to content

fix(app-gateway): fixed IP 조회 결과 캐시 추가#76

Open
Choi-Eunseok wants to merge 1 commit into
mainfrom
feat/choi-cache-app-gateway-fixed-ip
Open

fix(app-gateway): fixed IP 조회 결과 캐시 추가#76
Choi-Eunseok wants to merge 1 commit into
mainfrom
feat/choi-cache-app-gateway-fixed-ip

Conversation

@Choi-Eunseok

Copy link
Copy Markdown
Member

요약

  • app-gateway에서 OpenStack Nova fixed IP 조회 결과를 TTL 기반으로 캐시하도록 추가했습니다.
  • 캐시 만료 후 Nova 조회가 실패하면 마지막으로 성공했던 fixed IP를 fallback으로 사용하도록 했습니다.
  • 캐시 동작, TTL 만료 후 refresh, refresh 실패 시 stale fallback에 대한 테스트를 추가했습니다.

배경

일정 시간 후 앱 도메인에 다시 접속하면 1~2회 502 Bad Gateway가 발생하는 문제가 있었습니다.

app-gateway 로그상 원인은 VM 서비스 자체보다는 OpenStack Nova fixed IP 조회 실패였습니다.

fixed ip resolve failed ... Client.Timeout exceeded while awaiting headers
fixed ip resolve failed ... lookup nova.khu-return.com ... i/o timeout
fixed ip resolve failed ... context deadline exceeded

기존 구조에서는 사용자 요청마다 Nova에 fixed IP를 조회했기 때문에, Nova/DNS/Cloudflare 쪽이 잠깐 지연되면 사용자 요청이 바로 502로 이어졌습니다.

상세

  • instance_id -> fixed_ip를 app-gateway 프로세스 메모리에 캐시합니다.
  • 성공한 fixed IP 조회만 캐시합니다.
  • 첫 조회 실패는 기존처럼 에러를 반환합니다.
  • TTL이 지나면 Nova에 refresh를 시도합니다.
  • refresh가 실패하면 캐시에 남아 있는 마지막 fixed IP를 사용합니다.
  • 기본 TTL은 5m입니다.

@Choi-Eunseok Choi-Eunseok self-assigned this Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants