Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timeout to zfs/zpool commands #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

avnish30jn
Copy link

@avnish30jn avnish30jn commented Jul 27, 2018

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".

@avnish30jn
Copy link
Author

@mmlb @joshie @EdwardBetts Could you please review the PR ?

@trisk
Copy link
Member

trisk commented Jul 31, 2018

Special care will have to be taken for send/recv since the upper bounds for these commands may not be predictable in advance.

@avnish30jn
Copy link
Author

avnish30jn commented Jul 31, 2018

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.

@avnish30jn
Copy link
Author

@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.

@mmlb mmlb changed the title Issue-70: Add timeout to zfs/zpool commands Add timeout to zfs/zpool commands Mar 30, 2022
@antonag32
Copy link

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?

@mmlb
Copy link
Member

mmlb commented Jul 29, 2024

@antonag32 sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants