[pve-devel] [RFC PATCH] Explain that concurrent modifications of the VM config are the error cause

Emmanuel Kasper e.kasper at proxmox.com
Mon Dec 11 11:51:23 CET 2017


Signed-off-by: Emmanuel Kasper <e.kasper at proxmox.com>
---
While doing PVE trainings last week, I noticed that this error message
was not clear to most people when it popped up on the GUI.

Reusing here the wording that apt uses when called multiple times
( Unable to lock the administration directory (/var/lib/dpkg/), 
is another process using it?) 

Is is worth to return the PID of the process holding the flock ? 

 src/PVE/Tools.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm
index 6d579d8..9bce28f 100644
--- a/src/PVE/Tools.pm
+++ b/src/PVE/Tools.pm
@@ -196,7 +196,7 @@ sub lock_file_full {
 	weaken $lockhash->{$filename};
 	$local_fh = eval { run_with_timeout($timeout, $get_locked_file) };
 	if ($@) {
-	    $@ = "can't lock file '$filename' - $@";
+	    $@ = "can't lock file '$filename', is another process using it ? - $@";
 	    return undef;
 	}
 	$check = 1;
-- 
2.11.0





More information about the pve-devel mailing list