[Devel] [PATCH libvzctl] Suppress SUNRPC traffic on "fast stop".

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Mon Jun 26 17:00:10 MSK 2017


Please, drop this patch.

I'll sent next version.


23.06.2017 15:42, Stanislav Kinsburskiy пишет:
> This is needed to break infinite loop in SUNRPC state machine, leading to
> unstoppable container in case of unreachable network.
>
> https://jira.sw.ru/browse/PSBM-67544
>
> Note: needs kernel rh7-3.10.0-514.16.1.vz7.32.12 or newer
>
> Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
> ---
>   lib/env_nsops.c |   16 +++++++++++++---
>   1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/lib/env_nsops.c b/lib/env_nsops.c
> index d62dff4..e46a1e6 100644
> --- a/lib/env_nsops.c
> +++ b/lib/env_nsops.c
> @@ -1071,23 +1071,33 @@ static int ns_env_stop_force(struct vzctl_env_handle *h)
>   {
>   	int ret, rc;
>   
> +	ret = cg_set_param(EID(h), CG_VE, "ve.sunrpc_abort", "1");
> +	if (ret)
> +		return ret;
> +
>   	logger(0, 0, "Forcibly stop the Container...");
>   
>   	ret = cg_freezer_cmd(EID(h), VZCTL_CMD_FREEZE);
>   	if (ret)
> -		return ret;
> +		goto release_sunrpc;
>   
>   	rc = ns_env_kill(h);
>   
>   	/* Unfreeze unconditionally */
>   	ret = cg_freezer_cmd(EID(h), VZCTL_CMD_RESUME);
> -	if (ret || rc)
> -		return ret ?: rc;
> +	if (ret || rc) {
> +		ret = ret ?: rc;
> +		goto release_sunrpc;
> +	}
>   
>   	if (wait_env_state(h, VZCTL_ENV_STOPPED, MAX_SHTD_TM))
>   		return vzctl_err(-1, 0, "Failed to stop Container:"
>   				" operation timed out");
>   	return 0;
> +
> +release_sunrpc:
> +	(void) cg_set_param(EID(h), CG_VE, "ve.sunrpc_abort", "0");
> +	return ret;
>   }
>   
>   static int ns_env_cleanup(struct vzctl_env_handle *h, int flags)
>
> _______________________________________________
> Devel mailing list
> Devel at openvz.org
> https://lists.openvz.org/mailman/listinfo/devel



More information about the Devel mailing list