]> git.proxmox.com Git - pve-common.git/commitdiff
restenv: catch broadcast_tasklist errors gracefully
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 25 Jul 2017 13:32:23 +0000 (15:32 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 18 Aug 2017 08:39:36 +0000 (10:39 +0200)
Don't die because the tasklist could not be broadcasted, just log the
error.
Else we may hinder all task to run with a quite confusing error (i.e.
"ipcc_send_rec: file to big").

This may happen if there are a lot currently running tasks at once.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/RESTEnvironment.pm

index 15eef90c97fbae3dcf5a9a9cf83c82e0e222692e..bab4a2e1843fa763dbeeb0a76ccd973590f1725b 100644 (file)
@@ -47,7 +47,8 @@ my $log_task_result = sub {
     }
 
     my $tlist = $rest_env->active_workers($upid);
     }
 
     my $tlist = $rest_env->active_workers($upid);
-    $rest_env->broadcast_tasklist($tlist);
+    eval { $rest_env->broadcast_tasklist($tlist); };
+    syslog('err', $@) if $@;
 
     my $task;
     foreach my $t (@$tlist) {
 
     my $task;
     foreach my $t (@$tlist) {
@@ -558,7 +559,8 @@ sub fork_worker {
     $self->log_cluster_msg('info', $user, "starting task $upid");
 
     my $tlist = $self->active_workers($upid, $sync);
     $self->log_cluster_msg('info', $user, "starting task $upid");
 
     my $tlist = $self->active_workers($upid, $sync);
-    $self->broadcast_tasklist($tlist);
+    eval { $self->broadcast_tasklist($tlist); };
+    syslog('err', $@) if $@;
 
     my $res = 0;
 
 
     my $res = 0;