mirror of
https://github.com/neovim/neovim.git
synced 2026-04-29 10:44:08 +00:00
job-control: mitigate process-kill race
children_kill_cb() is racey. One obvious problem is that process_close_handles() is *queued* by on_process_exit(), so when children_kill_cb() is invoked, the dead process might still be in the `loop->children` list. If the OS already reclaimed the dead PID, Nvim may try to SIGKILL it. Avoid that by checking `proc->status`. Vim doesn't have this problem because it doesn't attempt to kill processes that ignored SIGTERM after a timeout. closes #8269
This commit is contained in:
@@ -5033,10 +5033,9 @@ jobstart({cmd}[, {opts}]) *jobstart()*
|
||||
width : (pty only) Width of the terminal screen
|
||||
height : (pty only) Height of the terminal screen
|
||||
TERM : (pty only) $TERM environment variable
|
||||
detach : (non-pty only) Detach the job process from the
|
||||
nvim process. The process will not get killed
|
||||
when nvim exits. If the process dies before
|
||||
nvim exits, "on_exit" will still be invoked.
|
||||
detach : (non-pty only) Detach the job process: it will
|
||||
not be killed when Nvim exits. If the process
|
||||
exits before Nvim, "on_exit" will be invoked.
|
||||
|
||||
{opts} is passed as |self| dictionary to the callback; the
|
||||
caller may set other keys to pass application-specific data.
|
||||
|
||||
Reference in New Issue
Block a user