http-server doesn't exit and hold on listening port

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

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
38/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, node.js
Lĩnh vực
backend, cli

Hướng nghiên cứu

Tái hiện trường hợp Windows 10 của gulp task được báo cáo, sử dụng lệnh http-server trên cổng 5001 và thao tác tắt bằng SIGINT. Theo dõi hành vi dọn dẹp tiến trình và cổng của server; được xem là hoàn tất khi tiến trình con thoát và cổng 5001 được giải phóng sau khi task gọi kill("SIGINT").

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

Mô tả

stale
Environment Versions
  1. OS Type windows 10
  2. Node version: v16.13.1
  3. http-server version: v14.1.0
Steps to reproduce
gulp.task("build:release", async () => {
  
  const httpServer = spawn("http-server dist/www --port 5001", {
    shell: true,
    stdio: "inherit",
  });
  const httpServerClose = new Promise((resolve) =>
    httpServer.on("close", (code, signal) => {
      console.log(
        `child process terminated due to receipt of signal ${signal}, code ${code}`
      );
      console.log("httpServer close");
      resolve();
    })
  );
  await new Promise((resolve) => setTimeout(resolve, 2e3));
  httpServer.kill("SIGINT");
  await httpServerClose;
  console.log("here");
}
Expected result

exit and release port 5001

Actual result

doesn't exit and hold port 5001

Other information

partial output of the code above

Available on:
  http://127.0.0.1:5001
  http://192.168.31.122:5001
  http://172.21.96.1:5001
  http://172.18.192.1:5001
Hit CTRL-C to stop the server

child process terminated due to receipt of signal SIGINT, code null
httpServer close
here
Ngôn ngữ chính
JavaScript
Star
14.2k
Fork
1.6k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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 http-party/http-server

Tất cả issue của http-party/http-server

Issue tương tự

Thêm issue về JavaScript

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.