Open avnish30jn opened 6 years ago
@mmlb @joshie @EdwardBetts Could you please review the PR ?
Special care will have to be taken for send/recv since the upper bounds for these commands may not be predictable in advance.
yes if we use this, we can always unset the environment variable before send/receive command and set it again, else by default there is no timeout for any command.
@trisk i have updated to the code to set the timeout for all zfs/zpool commands except zfs send/receive commands as it cannot be predicted in advance.
In 2024 this can easily be done with CommandContext. You can even send SIGTERM and wait for a while before sending SIGKILL to attempt a clean exit. If implemented would it get merged?
@antonag32 sure
This Pr adds the support to add timeout to the commands that we run.
Eg:- export COMMAND_TIMEOUT=5m will set context to the command
supported timeout values are the ones that can be parsed by golang time.ParseDuration method. Supported time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".