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

Abierto
#6,734 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

  • #6735 de @pulkitvats2007-crypto — cerrado sin fusionar

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
go, kubernetes

Línea de trabajo

Rastrea la cancelación y el manejo de tiempos de espera de los ejecutores ScriptRun y CustomSync, incluido el rollback de Kubernetes, y sigue cómo se inicia y se monitoriza el proceso de shell subyacente. Reproduce el problema con un comando sleep 300 de larga duración e inspecciona la lista de procesos del agente y los logs después de la cancelación. Se considera terminado cuando el árbol de procesos termina y no quedan goroutines ni procesos secundarios después de que la etapa se cancele o se agote el tiempo de espera.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Go
Estrellas
1.4k
Forks
391
Merge medio
4 d 1 h
PR fusionados (30 d)
58

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pipe-cd/pipecd

Todos los issues de pipe-cd/pipecd

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.