Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/production-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ jobs:
envs: NLB_ID,ACCESS_TOKEN_SECRET_KEY,REFRESH_TOKEN_SECRET_KEY,DB_URL,DB_USERNAME,DB_PASSWORD
script: |
cd ~/snackgame-server/repo
git fetch origin main
git checkout -B main origin/main
git pull --ff-only origin main --no-recurse-submodules
git fetch origin main
git reset --hard origin/main
chmod +x scripts/deploy-rolling.sh
scripts/deploy-rolling.sh \
${{ secrets.NLB_BACKEND_02_HTTP }} \
Expand Down Expand Up @@ -99,8 +98,7 @@ jobs:
script: |
cd ~/snackgame-server/repo
git fetch origin main
git checkout -B main origin/main
git pull --ff-only origin main --no-recurse-submodules
git reset --hard origin/main
chmod +x scripts/deploy-rolling.sh
scripts/deploy-rolling.sh \
${{ secrets.NLB_BACKEND_01_HTTP }} \
Expand Down
14 changes: 6 additions & 8 deletions scripts/deploy-rolling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,18 @@ set_drain() {
--network-load-balancer-id "$NLB_ID" \
--backend-set-name snackgame-http \
--backend-name "$HTTP_BACKEND" \
--is-drain "$is_drain"
--is-drain "$is_drain" \
--wait-for-state SUCCEEDED \
--max-wait-seconds 120

oci nlb backend update \
--auth instance_principal \
--network-load-balancer-id "$NLB_ID" \
--backend-set-name snackgame-https \
--backend-name "$HTTPS_BACKEND" \
--is-drain "$is_drain"


if [ "$is_drain" = "true" ]; then
echo "[NLB] 드레인 적용 대기 중 (10초)..."
sleep 10
fi
--is-drain "$is_drain" \
--wait-for-state SUCCEEDED \
--max-wait-seconds 120
Comment on lines +39 to +50
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The removal of the explicit sleep timer after setting the drain state might lead to race conditions if the OCI CLI command returns success before the load balancer has fully propagated the drain state to all nodes. While --wait-for-state SUCCEEDED is used, it is safer to retain a small buffer or ensure the OCI API consistency is sufficient for your specific environment.

}


Expand Down
Loading