Find what keeps macOS CLI processes alive after commands

Đang mở
#1,956 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
macos, node.js, typescript
Lĩnh vực
cli, devtools

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
957
Fork
174
Merge trung bình
22 giờ 56 phút
Pull request đã merge (30 ngày)
345

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của getsentry/toolkit

Tất cả issue của getsentry/toolkit

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.