path: root/tools/ctf
diff options
authorAndriy Gapon <avg@FreeBSD.org>2019-10-16 06:44:37 +0000
committerAndriy Gapon <avg@FreeBSD.org>2019-10-16 06:44:37 +0000
commit35b885b060938f1f618e83e93a871548e64005c4 (patch)
treec66f243d0d88d56db7c802eb8b943ccd352865ac /tools/ctf
parent66c1f9ba9cf0a53ae881ffbcd3a921ceed60d338 (diff)
9425 allow channel programs to be stopped via signals
illumos/illumos-gate@d0cb1fb92629bc0283c88d4719df7285c1612700 https://github.com/illumos/illumos-gate/commit/d0cb1fb92629bc0283c88d4719df7285c1612700 https://www.illumos.org/issues/9425 Problem Statement ZFS Channel program scripts currently require a timeout, so that hung or long- running scripts return a timeout error instead of causing ZFS to get wedged. This limit can currently be set up to 100 million Lua instructions. Even with a limit in place, it would be desirable to have a sys admin (support engineer) be able to cancel a script that is taking a long time. Proposed Solution Make it possible to abort a channel program by sending an interrupt signal.In the underlying txg_wait_sync function, switch the cv_wait to a cv_wait_sig to catch the signal. Once a signal is encountered, the dsl_sync_task function can install a Lua hook that will get called before the Lua interpreter executes a new line of code. The dsl_sync_task can resume with a standard txg_wait_sync call and wait for the txg to complete. Meanwhile, the hook will abort the script and indicate that the channel program was canceled. The kernel returns a EINTR to indicate that the channel program run was canceled. Author: Don Brady <don.brady@delphix.com>
Notes: svn path=/vendor-sys/illumos/dist/; revision=353617
Diffstat (limited to 'tools/ctf')
0 files changed, 0 insertions, 0 deletions