From cfb7a70165199eca25f92272490c863551efcd89 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 23 Nov 2016 11:40:41 +0100 Subject: [PATCH] increase timeout from guest-fsfreeze-freeze The qmp command 'guest-fsfreeze-freeze' issues in linux a FIFREEZE ioctl call on all mounted guest FS. This ioctl call locks the filesystem and gets it into an consistent state. For this all caches must be synced after blocking new writes to the FS, which may need a relative long time, especially under high IO load on the backing storage. In windows a VSS (Volume Shadow Copy Service) request_freeze will issued. As of the closed Windows nature the exact mechanisms cannot be checked but some microsoft blog posts and other forum post suggest that it should return fast but certain workloads can still trigger a long delay resulting an similar problems. Thus try to minimize the error probability and increase the timeout significantly. We use 60 minutes as timeout as this seems a limit which should not get trespassed in a somewhat healthy system. See: https://forum.proxmox.com/threads/22192/ see the 'freeze_super' and 'thaw_super' function in fs/super.c from the linux kernel tree for more details on the freeze behavior in Linux guests. Signed-off-by: Thomas Lamprecht --- PVE/QMPClient.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/PVE/QMPClient.pm b/PVE/QMPClient.pm index a527ffc4..991a8f4a 100755 --- a/PVE/QMPClient.pm +++ b/PVE/QMPClient.pm @@ -107,8 +107,13 @@ sub cmd { $timeout = 60*60; # 1 hour } elsif ($cmd->{execute} =~ m/^(eject|change)/) { $timeout = 60; # note: cdrom mount command is slow - } elsif ($cmd->{execute} eq 'guest-fsfreeze-freeze' || - $cmd->{execute} eq 'guest-fsfreeze-thaw') { + } elsif ($cmd->{execute} eq 'guest-fsfreeze-freeze') { + # freeze syncs all guest FS, if we kill it it stays in an unfreezable + # locked state with high probability, so use an generous timeout + $timeout = 60*60; # 1 hour + } elsif ($cmd->{execute} eq 'guest-fsfreeze-thaw') { + # thaw has no possible long blocking actions, either it returns + # instantly or never (dead locked) $timeout = 10; } elsif ($cmd->{execute} eq 'savevm-start' || $cmd->{execute} eq 'savevm-end' ||