Skip to content

fix: 헬스체크 grep 쿼팅 버그 수정#757

Merged
Hexeong merged 4 commits into
developfrom
refactor/607-adjust-blue-green-deploy
Jun 15, 2026
Merged

fix: 헬스체크 grep 쿼팅 버그 수정#757
Hexeong merged 4 commits into
developfrom
refactor/607-adjust-blue-green-deploy

Conversation

@Hexeong

@Hexeong Hexeong commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

관련 이슈

작업 내용

SSH 단일 인용부호 내부에서 '"status":"UP"' 패턴이 올바르게 전달되지 않는 쉘 쿼팅 버그를 수정합니다.

문제

SSH 명령이 single-quote로 감싸진 상태에서 내부의 '"status":"UP"'가 파싱될 때, bash가 single-quote를 닫았다 열면서 grep -o status:UP으로 해석됩니다. {"status":"UP"} 응답에서 status:UP은 매칭되지 않아 헬스체크가 항상 실패했습니다.

변경 내용

grep -o '"status":"UP"' 방식 → HTTP 상태코드 확인 방식으로 변경

# AS-IS (quoting 버그)
STATUS=$(curl ... | grep -o '"status":"UP"' || true)
[ "$STATUS" = '"status":"UP"' ] && break

# TO-BE (quoting 문제 없음)
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" ... || true)
[ "$HTTP_CODE" = "200" ] && break

Spring Boot는 상태가 UP이면 HTTP 200, DOWN이면 503을 반환하므로 상태코드로 판단합니다.

변경 파일: .github/workflows/dev-cd.yml, .github/workflows/prod-cd.yml

특이 사항

  • 로직 변경 없음, 쿼팅 방식만 변경
  • %{http_code}는 single-quote 내부에서도 올바르게 전달됨

리뷰 요구사항 (선택)

  • SSH heredoc 내부 single-quote 쿼팅 이슈가 원인이 맞는지 확인 부탁드립니다

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Hexeong, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 9 minutes and 58 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 88cb5896-21a5-48e2-8d30-e0d22683b085

📥 Commits

Reviewing files that changed from the base of the PR and between 615f17a and 3934f41.

📒 Files selected for processing (4)
  • .github/workflows/dev-cd.yml
  • .github/workflows/prod-cd.yml
  • docker-compose.dev.yml
  • docker-compose.prod.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/607-adjust-blue-green-deploy

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Hexeong Hexeong self-assigned this Jun 15, 2026
@Hexeong Hexeong added 인프라 진행 중 자유롭게 merge 가능 labels Jun 15, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3934f4145e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +141 to +143
ACTIVE_SLOT="blue"; ACTIVE_PORT=8080; NEW_SLOT="green"; NEW_PORT=9080; MANAGEMENT_PORT=9081
else
ACTIVE_SLOT="green"; ACTIVE_PORT=8081; NEW_SLOT="blue"; NEW_PORT=8080; MANAGEMENT_PORT=9080
ACTIVE_SLOT="green"; ACTIVE_PORT=9080; NEW_SLOT="blue"; NEW_PORT=8080; MANAGEMENT_PORT=8081

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid reusing ports held by the active slot

On the first rollout from the parent version, the active container is still running until after the nginx switch, and the compose file uses network_mode: "host". If blue is active, it still owns management port 9080 while this starts green with APP_PORT=9080; if green is active, it still owns app port 8081 while this starts blue with MANAGEMENT_PORT=8081. In either current production state, the new Spring process cannot bind the port before the old slot is stopped, so the deployment fails instead of remaining zero-downtime. Keep the old app/management port pairs during migration or explicitly drain/stop the old listener before reusing those ports.

Useful? React with 👍 / 👎.

@Hexeong Hexeong merged commit aedf4bc into develop Jun 15, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

인프라 진행 중 자유롭게 merge 가능

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant