Find what keeps macOS CLI processes alive after commands

Abierto
#1,956 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

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
Activo
Stack tecnológico
macos, node.js, typescript
Área
cli, devtools

Línea de trabajo

Start with packages/cli/src/lib/force-exit.ts and trace the command shutdown path that calls scheduleForceExit(). The issue asks to identify any event-loop handle keeping commands alive on macOS; compare findings with the earlier fixes in getsentry/cli#1488 and the reported exit telemetry loss in #1448. Done means the lingering handle is reproduced and identified, with evidence that supports deciding whether the backstop is still needed.

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

Descripción

On macOS, scheduleForceExit() (packages/cli/src/lib/force-exit.ts) arms an unref'd 100 ms process.exit() after every command. It is a backstop, not a fix: we don't know which handle, if any, still keeps the event loop alive after a command finishes.

  • getsentry/cli#1237: commands hung after writing their output. getsentry/cli#1396 added the backstop for every command.
  • getsentry/cli#1488 then closed undici's global dispatcher, which fixed the known cause (pooled keep-alive sockets). The backstop stayed for "a libuv refcount quirk", which nobody has reproduced since.
  • The backstop has a cost: on macOS it cuts off the exit telemetry flush (#1448).
  • History: in getsentry/cli#782, #833, and #835, a forced exit after init was later removed once the real leak was found. That leak was the workaround itself.
  • #1955 adds the sentry-cli/no-process-exit lint rule. The backstop is one of its allowed exceptions, so it should not get wider (#1950).

Raised by BYK in review of #1955.

--

View Session in Sentry

Lenguaje dominante
TypeScript
Estrellas
957
Forks
174
Merge medio
22 h 56 min
PR fusionados (30 d)
345

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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 getsentry/toolkit

Todos los issues de getsentry/toolkit

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.