llama.cpp
10176e91 - server: run tool commands as a job ended with everything it started

Commit
4 hours ago
server: run tool commands as a job ended with everything it started run_subprocess read the output until EOF and the timeout only killed the shell, so a process the command left running kept the pipe open and the call with it. The command now runs as a job: a process group of its own on POSIX (posix_spawn), a Job Object on Windows (created suspended, then assigned). The output is polled against a deadline, and the whole job is killed once the command exits, times out, or the caller stops it. tools_io::run takes a should_stop, checked even while the command writes nothing, so dropping a /tools request stops its command. On Windows, cmd gets /d /s /c and the command as written, since it does not parse its command line with the C runtime rules.
Committer
Parents
Loading