Skip to content

io.launcher timeouts are flaky with try-output-process #307

Closed
@slavapestov

Description

try-output-process calls stream-contents before it calls wait-for-process, and it performs both calls in a with-timeout form with the process as the timeout object.

So when we're blocked inside of stream-contents and the timeout period expires, the process is killed. Normally, this should result in the pipes' other end being closed, and stream-contents returning with an EOF.

However, 'git pull' spawns several child processes which inherit standard output. When 'git pull' is killed, these child processes don't seem to die. As a result, they hold on to the pipes, and stream-contents does not receive an EOF. Since there's no timeout on the stream, only on the process, try-output-process can hang forever, even if a timeout period is set.

One problem that needs to be fixed is to have kill-process close the pipes from the factor side. This would solve the issue of stream-contents blocking forever.

However, even if we do this, the bogus subprocesses spawned by 'git pull' will stick around forever, even after try-output-process returns.

So we should change kill-process to close the pipes or otherwise unblock the stream-contents. We should also look into using process groups on Unix, so that all children spawned by the process are killed by kill-process. I'm not sure if there is an equivalent on Windows.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions