Process does not exit after https request with keepAlive enabled (now default in Node 19)
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 122k
- Fork
- 37.4k
- Merge trung bình
- 4 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 272
Mô tả
Version
v19.8.1
Platform
Linux Jake-Framework 6.2.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 18 Mar 2023 01:06:36 +0000 x86_64 GNU/Linux
Subsystem
https
What steps will reproduce the bug?
Run a script containing:
const https = require("https");
const url = "https://github.com/dprint/dprint/releases/download/0.35.3/dprint-x86_64-unknown-linux-gnu.zip";
https.get(url, { method: "HEAD" }, console.log);
This will hang.
How often does it reproduce? Is there a required condition?
100% of the time; downgrade to Node 18 and it no longer hangs.
What is the expected behavior? Why is that the expected behavior?
No hang. Run this:
const https = require("https");
const url = "https://github.com/dprint/dprint/releases/download/0.35.3/dprint-x86_64-unknown-linux-gnu.zip";
https.get(url, { method: "HEAD", agent: new https.Agent({ keepAlive: false }) }, console.log);
And it will succeed.
What do you see instead?
Hang; the request succeeds and the response is given, but the process never exits.
Additional information
This is a change I saw in the Node 19 release blog post; keep-alive is enabled by default now, but, it seems to cause a hang.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách chạy bản tái hiện https.get được cung cấp trên Node v19.8.1 và so sánh với biến thể keepAlive:false và Node 18. Theo dõi vòng đời của yêu cầu https và agent để xác định tại sao phản hồi HEAD thành công vẫn giữ tiến trình hoạt động. Công việc được xem là hoàn tất khi hành vi keep-alive mặc định không còn khiến tiến trình này bị treo và bản tái hiện đã báo cáo được kiểm thử bao phủ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, nodejs
- Lĩnh vực
- backend, networking
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 42/100