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

peer-link: closing a displaced server unlinks the winner's socket

Đang mở
#756 1 bình luận 0 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
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
Lĩnh vực
backend, cli

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):

  1. A and B both clear the corpse; B displaces A. Both are inside stillOurs, and A's 250 ms expires first.
  2. A mismatches and stands down: A.close() unlinks the path, which now names B's socket.
  3. 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, which brokerConfirmed exists 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

  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 diffplug/dormouse

Tất cả issue của diffplug/dormouse

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.