]> git.ipfire.org Git - thirdparty/bacula.git/commit
metaplugin: Add a proper job cancel handling.
authorRadosław Korzeniewski <radoslaw@korzeniewski.net>
Wed, 23 Jun 2021 16:03:18 +0000 (18:03 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:02 +0000 (09:03 +0100)
commit4e7bd08dd3cf54de7f8af22ca97d6c1516fd6c4d
tree7273effefe1b9b31667856aa1f848d4cc94f22e4
parent774889e3d64f7850e37bd5a71eb8db57024a60c1
metaplugin: Add a proper job cancel handling.

With this patch you can receive information about a cancel event
as a SIGUSR1 signal. Now the backend can intercept this signal to
handle clean and finish procedures. After that for about 5 secs,
which is the default but you can customize it using
CUSTOMCANCELSLEEP compile-in variable, the backend receive
a termination - bpipe communication will be closed and SIGTERM
sent. It is assumed that after receiving SIGUSR1 no standard
metaplugin protocol communication is expected and supported.
In this case the metaplugin return bRC_Error on every plugin
entrypoint except freePlugin().
bacula/src/plugins/fd/pluginlib/metaplugin.cpp
bacula/src/plugins/fd/pluginlib/metaplugin.h
bacula/src/plugins/fd/pluginlib/ptcomm.h
bacula/src/plugins/fd/pluginlib/test_metaplugin_backend.c