PowerShell / PowerShell/PowerShellEditorServices

Close stray process when stdio pipe is closed or possibly when parent process is killed (daemon flag?)

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

Chưa có ai nhận issue này.

Area-Tasks Issue-Bug
Ngôn ngữ chính
C#
Star
767
Fork
266
Merge trung bình
3 ngày 16 giờ
Pull request đã merge (30 ngày)
1

Mô tả

This is continuation of the effort from:

  1. Issue https://github.com/PowerShell/PowerShellEditorServices/issues/655 PSES needs to shutdown itself when it's supposed to
  2. PR https://github.com/PowerShell/PowerShellEditorServices/pull/663 Close stray processes on exit

#655 was closed by @TylerLeonhardt as it was satisfied by PR #663. However I still believe we can easily get into the situation when LSP text editor that launches PSES gets killed and orphans the PSES process, that keeps running without a purpose. Actually this is the case with Sublime Text and LSP plugin, where other language LSP providers shutdown themselves when the Sublime Text quits without a need to use exit or any other means.

Therefore I propose 2 options for consideration (alternatives):

  1. Introduce new -daemon flag, that unless specified, makes PSES to shutdown itself when the parent process disappears. This will make PSES behave like most of the command line tools, i.e. shutdown itself when the shell or launching process quits.

    The only purpose for PSES to run despite of parent process being alive or not is when it is it intended to be ran as a daemon, and I believe this intent should not be default (as it is now).

  2. Shutdown itself when running as -stdio and when pipe is closed, as I was commenting in other ticket, there is no point running when pipe is closes, because there is nobody that will be able to issue exit and any other command anyways.

Thank you in advance for considering my suggestion. If you prefer I can try to get this behavior adapter myself and send the PR, but you (maintainers) may come to more elegant solution much quicker than me, therefore I post this issue first.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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.

Hướng nghiên cứu

Trước tiên, hãy xem issue #655 và PR #663, sau đó lần theo các entry point của PSES cho chế độ -stdio và flag -daemon được đề xuất. Xác định hành vi shutdown nào được định intended khi parent biến mất hoặc pipe stdio đóng; hoàn tất có nghĩa là không còn các tiến trình PSES mồ côi trong kịch bản được đề cập mà không làm hỏng việc sử dụng daemon.

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

Đánh giá

Công nghệ
csharp
Lĩnh vực
devtools
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
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
30/100

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.