Merged
Conversation
Cloud SQLでは管理者権限がないためpg_terminate_backendが使えない。 代わりにCloud Runサービスの--max-instances=0を設定することで、 アクティブな接続を確実に切断してからDBを削除する。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ウォークスルーCloud Build ステージング パイプラインの接続管理フローを再構成します。Cloud Run サービスを停止するステップを追加し、直接的なデータベース接続の終了ロジックをアクティブな SQL Proxy 準備確認に置き換え、パイプライン ステップの依存関係を再編成します。 変更内容
推定コードレビュー工数🎯 3 (標準的) | ⏱️ 約20分
関連する可能性のあるプルリクエスト
推奨ラベル
推奨レビュアー
詩
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
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 |
28 tasks
This was referenced Dec 11, 2025
This was referenced Jan 29, 2026
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.
Summary
--max-instances=0で停止することで、DBへの接続を確実に切断pg_terminate_backendが使えない問題を解決変更内容
背景
誰かがステージング環境にアクセスしているとDB削除ができずにデプロイが失敗する問題が長年ありました。Cloud SQLでは管理者権限を持つユーザーになることができないため、
pg_terminate_backendで接続を切断することができませんでした。解決策
Cloud Runサービス自体を停止することで、アプリケーションからのDB接続を確実に切断します。
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
リリースノート
✏️ Tip: You can customize this high-level summary in your review settings.