Zombie processes and goroutine leak in ScriptRun / CustomSync executors on cancellation
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
- #6735 @pulkitvats2007-crypto による — マージされずにクローズ
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- go, kubernetes
- 領域
- devops, infrastructure
調査の方向性
ScriptRun と CustomSync executor のキャンセルとタイムアウト処理を追跡し、Kubernetes の rollback も含めて、基盤となる shell プロセスがどのように起動され、追跡されるかを確認します。長時間実行される sleep 300 コマンドで問題を再現し、キャンセル後に agent のプロセス一覧とログを調べます。stage がキャンセルまたはタイムアウトした後にプロセスツリーが終了し、goroutine や子プロセスが残らなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
What happened:
When a deployment is cancelled or times out during a ScriptRun, CustomSync, or Kubernetes rollback stage, the Piped agent stops tracking the stage but fails to terminate the underlying shell process. This results in orphaned "zombie" processes (e.g., kubectl, terraform, sleep) and leaked goroutines on the Piped agent host. These orphaned processes continue to run and mutate cluster state even after a rollback has been initiated, leading to potential data corruption and agent resource exhaustion.
What you expected to happen:
When a stage is cancelled or times out, the Piped agent should immediately and definitively terminate the underlying OS process tree associated with that stage's command. This ensures that no unauthorized mutations occur after cancellation and that agent resources are correctly reclaimed.
How to reproduce it:
- Create a PipeCD application with a ScriptRun stage that executes a long-running command (e.g.,
run: sleep 300). - Trigger a deployment for this application.
- Once the ScriptRun stage is active, click the "Cancel" button in the PipeCD web UI.
- Observe the PipeCD UI and logs; the stage will be reported as
CANCELLED. - Check the process list on the Piped agent host (e.g.,
ps aux | grep sleep). You will find that the sleep process is still running in the background.
Environment:
- piped version: master / latest
- control-plane version: master / latest
- Others: This is a platform-agnostic bug affecting any Piped agent utilizing ScriptRun or CustomSync executors.
- 主要言語
- Go
- スター
- 1.4k
- フォーク
- 391
- 平均マージ
- 4日 1時間
- マージ済み PR(30日)
- 58
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pipe-cd/pipecd のほかの issue
-
Applications at the repository root are not triggered by new commits対応中かも @Daksha1611 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 2 日以内に返信
-
pipedv1 kubernetes plugins ignore trafficRouting.istio.host in K8S_TRAFFIC_ROUTING対応中かも @Dhirenderchoudhary が今日担当しました。 オープン
難易度 2/5 半日 初心者へのやさしさ 74/100
pipe-cd/pipecd#7626 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
pipectl transfer restore application drops backed-up labels対応中かも @bhavishyajain545 が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
pipe-cd/pipecd#7622 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
docker-compose: postgres healthcheck should probe TCP (pg_isready -h localhost)対応中かも @zezo-mohamed22 が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
OneBusAway/watchdog#305 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
self-care self-care:agent-discoverability
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
githubnext/gh-cao#20928 ·
メンテナーはふだん 1 日以内に返信
-
automation documentation
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
SocialGouv/iterion#3287 ·
メンテナーはふだん 1 日以内に返信