PowerShell / PowerShell/PowerShellEditorServices
Close stray process when stdio pipe is closed or possibly when parent process is killed (daemon flag?)
还没有人认领这个 Issue。
- 主要语言
- C#
- 星标
- 767
- 派生
- 266
- 平均合并
- 3 天 16 小时
- 30 天内合并 PR
- 1
描述
This is continuation of the effort from:
- Issue https://github.com/PowerShell/PowerShellEditorServices/issues/655 PSES needs to shutdown itself when it's supposed to
- 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):
-
Introduce new
-daemonflag, 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).
-
Shutdown itself when running as
-stdioand 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 issueexitand 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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
先查看 issue #655 和 PR #663,然后跟踪 PSES 在 -stdio 模式和提议的 -daemon 标志下的入口点。确定当父进程消失或 stdio 管道关闭时预期的关闭行为;完成的标准是,在涵盖的场景中不再残留孤立的 PSES 进程,同时不影响 daemon 的使用。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp
- 领域
- devtools
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 30/100