[Devel,libvzctl,2/2] Kill tasks before freezing on fast stop

Submitted by Stanislav Kinsburskiy on July 10, 2017, 12:49 p.m.


Message ID 20170710124936.494266.27976.stgit@skinsbursky-vz7.qa.sw.ru
State New
Series "Fix container stop with spfs mount and"
Headers show

Commit Message

Stanislav Kinsburskiy July 10, 2017, 12:49 p.m.
This patch is not only an optimization. It also allows to stop restored
container with NFS but unreachable network, because tasks can be blocked in
kernel (due to SPFS "Stub" mode) and can't be frozen.
Killing tasks before freezing will kill spfs process, thus either killing
all the container tasks without freezing (and optimization), or at least
release processes, waiting for spfs reply in kernel.


Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
 lib/env_nsops.c |    4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/lib/env_nsops.c b/lib/env_nsops.c
index 221fad7..4ecd46e 100644
--- a/lib/env_nsops.c
+++ b/lib/env_nsops.c
@@ -1110,6 +1110,10 @@  static int ns_env_stop_force(struct vzctl_env_handle *h)
 	logger(0, 0, "Forcibly stop the Container...");
+	ret = ns_env_kill(h, 0);
+	if (ret)
+		goto release_sunrpc;
 	ret = cg_freezer_cmd(EID(h), VZCTL_CMD_FREEZE);
 	if (ret)
 		goto release_sunrpc;