Repository navigation
[FIX] 포트에 여러 프로세스가 물린 경우 배포 스크립트 종료 실패 수정 - #271
Merged
Merged
Conversation
lsof -t가 PID를 여러 개 반환하면 kill -15 "$pid"가 줄바꿈이 포함된 단일 인자를 받아 파싱에 실패했고, set -e로 인해 배포가 실패했다. PID 목록을 xargs로 전달해 각 프로세스에 개별 시그널을 보내도록 수정한다. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository: debate-timer/debate-timer-be/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Test Results169 files 169 suites 50s ⏱️ Results for commit 50178b9. |
📝 Test Coverage Report
|
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.
배경
dev CD 실패 (run 36146349024).
배포 자체는 정상 완료됐고(health check 200, nginx 8080 전환 완료), 마지막 구버전 정리 단계에서만 실패했습니다.
원인
kill_process_on_port()에서lsof -t -i:$port는 해당 포트를 점유한 PID를 줄바꿈으로 구분해 반환합니다. 8081 포트에 프로세스가 2개 물려 있어$pid가 다중 값이 됐고, 따옴표로 묶인"$pid"를kill이 단일 인자로 받아 파싱에 실패했습니다.set -e때문에 스크립트가 exit 1로 종료되면서 CD가 실패로 표시됐습니다.graceful shutdown이나 WebSocket 연결 유지와는 무관한 스크립트 버그입니다.
변경 사항
kill_process_on_port()에서 PID 목록을xargs로 전달해 각 프로세스에 개별적으로kill -15/kill -9를 보내도록 수정pid→pids로 변경하고 로그에 PID 목록을 공백 구분으로 출력참고
포트에 PID가 2개 잡힌 원인 자체는 별도 확인이 필요합니다. 이전 배포에서 프로세스가 완전히 정리되지 않고 남았을 가능성이 있어, dev 서버에서
sudo lsof -i:8081로 확인이 필요합니다. 이 PR은 그 상황에서도 스크립트가 실패하지 않도록 하는 수정입니다.🤖 Generated with Claude Code
Summary by CodeRabbit