Zombie processes and goroutine leak in ScriptRun / CustomSync executors on cancellation

オープン
#6,734 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

  • #6735 @pulkitvats2007-crypto による — マージされずにクローズ

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
go, kubernetes

調査の方向性

ScriptRun と CustomSync executor のキャンセルとタイムアウト処理を追跡し、Kubernetes の rollback も含めて、基盤となる shell プロセスがどのように起動され、追跡されるかを確認します。長時間実行される sleep 300 コマンドで問題を再現し、キャンセル後に agent のプロセス一覧とログを調べます。stage がキャンセルまたはタイムアウトした後にプロセスツリーが終了し、goroutine や子プロセスが残らなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

area/piped kind/bug

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:

  1. Create a PipeCD application with a ScriptRun stage that executes a long-running command (e.g., run: sleep 300).
  2. Trigger a deployment for this application.
  3. Once the ScriptRun stage is active, click the "Cancel" button in the PipeCD web UI.
  4. Observe the PipeCD UI and logs; the stage will be reported as CANCELLED.
  5. 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pipe-cd/pipecd のほかの issue

pipe-cd/pipecd の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。