[pve-devel] r5735 - pve-manager/pve2/bin

svn-commits at proxmox.com svn-commits at proxmox.com
Mon Mar 21 10:08:31 CET 2011


Author: dietmar
Date: 2011-03-21 10:08:31 +0100 (Mon, 21 Mar 2011)
New Revision: 5735

Modified:
   pve-manager/pve2/bin/pvestatd
Log:
update worker list.


Modified: pve-manager/pve2/bin/pvestatd
===================================================================
--- pve-manager/pve2/bin/pvestatd	2011-03-21 08:46:21 UTC (rev 5734)
+++ pve-manager/pve2/bin/pvestatd	2011-03-21 09:08:31 UTC (rev 5735)
@@ -13,6 +13,7 @@
 use PVE::Cluster qw(cfs_read_file);
 use PVE::Storage;
 use PVE::QemuServer;
+use PVE::RPCEnvironment;
 
 $SIG{'__WARN__'} = sub {
     my $err = $@;
@@ -28,8 +29,6 @@
 
 die "please run as root\n" if $> != 0;
 
-PVE::INotify::inotify_init();
-
 my $nodename = PVE::INotify::nodename();
 
 my $opt_debug;
@@ -116,6 +115,8 @@
     exit (0);
 };
 
+PVE::INotify::inotify_init();
+
 my $reload_config;
 
 if ($restart) {
@@ -211,10 +212,20 @@
 
 sub update_status {
 
+    # update worker list. This is not really required and
+    # we just call this to make sure that we have a correct
+    # list in case of an unexpected crash.
     eval {
+	my $tlist = PVE::RPCEnvironment::active_workers();
+	PVE::Cluster::broadcast_tasklist($tlist);
+    };
+    my $err = $@;
+    syslog('err', $err) if $err;
+
+    eval {
 	update_node_status();
     };
-    my $err = $@;
+    $err = $@;
     syslog('err', "node status update error: $err") if $err;
 
     eval {



More information about the pve-devel mailing list