peer-link: closing a displaced server unlinks the winner's socket
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
- 40/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
Hướng nghiên cứu
The bug is in vscode-ext/src/peer-link.ts, specifically the closeServer function. Start by reading the linked libuv source to understand uv__pipe_close's behavior. Reproduce the race condition with Node 26.9 as described. The fix likely involves creating a unique socket path and using link() atomically, so study Node's fs module for atomic operations. Check docs/specs/vscode.md for the brokerConfirmed logic to understand the broader context.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
closeServer in vscode-ext/src/peer-link.ts documents "Unlink only when the path still names our socket", but unlink only gates the explicit rm. closing.close() unlinks the path on its own: libuv's uv__pipe_close unlinks pipe_fname unconditionally. Reproduced on Node 26.9: A binds, B unlinks and rebinds, A.close() removes B's socket.
So the reclaim stand-down (closeServer(false)) removes the winner's socket too, not only disposal. Trace (from the #753 review):
- A and B both clear the corpse; B displaces A. Both are inside
stillOurs, and A's 250 ms expires first. - A mismatches and stands down:
A.close()unlinks the path, which now names B's socket. - If B's stat landed before that unlink, B confirms and serves an unreachable socket. A's next round
tryBinds the free path uncontested and confirms immediately. That leaves two confirmed brokers, whichbrokerConfirmedexists to prevent (docs/specs/vscode.md→ "A bind is not a role until it is believed").
A likely fix direction is an atomic create-only publish: bind a unique path, then link() it onto the fixed one, which fails EEXIST instead of displacing. The unique path is then the one libuv unlinks on close.
Surfaced in #753, which narrows a different race and doesn't address this.
- Ngôn ngữ chính
- TypeScript
- Star
- 5
- Fork
- 1
- Merge trung bình
- 16 giờ 56 phút
- Pull request đã merge (30 ngày)
- 253
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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.
Issue khác của diffplug/dormouse
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Tất cả issue của diffplug/dormouse
Issue tương tự
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Mend: dependency security vulnerability untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100