Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`supabase status` spins at ~160% CPU forever when stdout and stderr share a pipe whose reader closes early

Đang mở
#6,846 1 bình luận 0 reaction 1 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
67/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ệ
typescript
Lĩnh vực
cli

Hướng nghiên cứu

Start by reproducing npx supabase status 2>&1 | head -3 and compare it with the non-hanging commands listed in the issue. Trace the supabase status handling of stdout and stderr when the shared pipe closes early. Done means the CLI exits instead of spinning after an EPIPE, while normal output and draining consumers still complete.

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

Mô tả

🐛 Bug supabase/cli

Environment

  • Supabase CLI 2.116.0 (npm supabase, @supabase/cli-darwin-arm64); also observed on 2.118.0
  • macOS 27.0 (26A428), Apple Silicon (arm64)
  • Local stack running (supabase start)

Steps to reproduce

  1. npx supabase status 2>&1 | head -3

Expected

head prints three lines and exits; the CLI receives EPIPE/SIGPIPE on its next write and exits.

Actual

head exits, but the CLI process never does. It stays at 157-161% CPU until killed. sample shows the main thread looping in kevent64. Because the shell waits on every member of a pipeline, the command never completes. One background invocation ran for 14 hours before it was noticed.

Measurements (each run killed by a watchdog after 15-25 s)

Command Result
npx supabase status 2>&1 | head -3 hangs, 159.8% CPU after 24 s
npx supabase status 2>&1 | grep -q Stopped hangs, 157.5% CPU
node_modules/@supabase/cli-darwin-arm64/bin/supabase status 2>&1 | head -1 hangs, 161.2% CPU
npx supabase status 2>/dev/null | head -3 exits 0
npx supabase status 2>&1 >/dev/null | head -1 exits 0
npx supabase status 2>&1 | cat >/dev/null exits 0
X=$(npx supabase status -o json 2>/dev/null) exits 0

The hang requires both stdout and stderr in the same pipe, with a reader that closes before the CLI has finished writing. Piping only one stream, or draining everything, exits normally. Setting SUPABASE_NO_UPDATE_NOTIFIER=1 does not change the result.

Suggested fix

Exit (or stop writing) when a write to stdout or stderr fails with EPIPE, rather than retrying in the event loop.

Workaround

Capture the whole output first (X=$(supabase status -o json 2>/dev/null)) or redirect to a file, then read that.

Ngôn ngữ chính
TypeScript
Star
2.4k
Fork
526
Merge trung bình
1 ngày 38 phút
Pull request đã merge (30 ngày)
271

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

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 supabase/cli

Tất cả issue của supabase/cli

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.