You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Linux, the timeout on waitForExit() is ignored in some cases.
Example
import osproc
import streams
let args = ["-c", "cat"]
let process =startProcess(command ="/bin/sh", args = args)
let ret =waitForExit(p = process, timeout =1000)
let strm = process.outputStream()
echo strm.readAll()
echo ret
On MacOS the timeout is respected, on Linux the timeout is ignored while cat is blocked on reading input.
Interestingly this only happens when cat is invoked in a subshell,
let process = startProcess(command = "cat", args = args)
handles the timeout correct, as well as
let args = ["-c", "sleep 100"]
let process = startProcess(command = "/bin/sh", args = args)
Version
# nim -v
Nim Compiler Version 1.4.8 [Linux: amd64]
Compiled at 2021-05-25
Copyright (c) 2006-2021 by Andreas Rumpf
git hash: 44e653a9314e1b8503f0fa4a8a34c3380b26fff3
active boot switches: -d:release -d:danger
The text was updated successfully, but these errors were encountered:
On Linux, the timeout on
waitForExit()
is ignored in some cases.Example
https://play.nim-lang.org/#ix=3zQo
On MacOS the timeout is respected, on Linux the timeout is ignored while
cat
is blocked on reading input.Interestingly this only happens when
cat
is invoked in a subshell,handles the timeout correct, as well as
Version
The text was updated successfully, but these errors were encountered: