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

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Mon Jul 10 15:49:36 MSK 2017


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.

https://jira.sw.ru/browse/PSBM-68232

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

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;



More information about the Devel mailing list