Branch Coverage

blib/lib/MogileFS/ProcManager.pm
Criterion Covered Total %
branch 1 170 0.5


line true false branch
74 0 0 unless my $pidfile = 'MogileFS'->config('pidfile')
77 0 0 unless (open $fh, ">$pidfile")
81 0 0 unless (print $fh "$$\n" and close $fh)
91 0 0 unless my $pidfile = 'MogileFS'->config('pidfile')
120 0 0 unless my $suffix = $class->job_to_class_suffix($job)
132 0 0 if $healthy
136 0 0 if $todie{$pid} and $todie{$pid} == 2
153 0 0 unless $nowish > $lastspawntime
161 0 0 unless $pid > 0
167 0 0 if ($jobconn = delete $child{$pid})
169 0 0 $todie{$pid} ? :
174 0 0 if (my $jobstat = $jobs{$job})
178 0 0 unless (my $true = delete $todie{$pid})
186 0 0 if $allkidsup
192 0 0 if not $want_job_master and $needs_job_master{$job}
195 0 0 if ($need > 0)
198 0 0 unless my $jobconn = make_new_child($job)
229 0 0 unless sigprocmask(0, $sigset)
232 0 0 unless socketpair my $parents_ipc, my $childs_ipc, 1, 1, 0
235 0 0 unless defined($pid = fork)
243 0 0 if ($pid)
244 0 0 unless sigprocmask(1, $sigset)
270 0 0 unless sigprocmask(1, $sigset)
274 0 0 unless my $class = 'MogileFS::ProcManager'->job_to_class($job)
337 0 0 unless $class->is_valid_job($job)
338 0 0 if $job =~ /^(?:job_master|monitor)$/i and $n > 1
340 0 0 if $job eq 'job_master'
346 0 0 if $job eq 'queryworker'
386 0 0 if delete $ChildrenByJob{$job}{$pid}
402 4 0 unless %ErrorsTo
428 0 0 if ($worker->job eq 'queryworker')
444 0 0 if (@PendingQueries)
458 0 0 if (job_needs_reduction('queryworker'))
496 0 0 if $IsChild
497 0 0 unless $worker and $Mappings{$worker->{'fd'}}
504 0 0 unless $client
508 0 0 if $client->{'closed'}
512 0 0 if ($line =~ /^(\d+-\d+)\s+(\-?\d+\.\d+)\s+(.+)$/)
521 0 0 unless ($id and $id eq "$worker->{'pid'}-$worker->{'reqid'}")
522 0 0 unless defined $id
523 0 0 unless defined $line
534 0 0 if scalar @RecentQueries > 50
548 0 0 if $IsChild
551 0 0 unless @$queue
552 0 0 unless $idle_workers{$job} and keys %{$idle_workers{$job};}
556 0 0 if (not defined $worker or $worker->{'closed'})
566 0 0 unless @$queue
573 0 0 if $IsChild
580 0 0 unless $clref = shift @PendingQueries
582 0 0 if ($clref->[0]{'closed'})
587 0 0 unless $clref
591 0 0 if (not defined $worker or $worker->{'closed'})
640 0 0 if ($IsChild)
650 0 0 unless $child->job
653 0 0 if ($cmd =~ /^error (.+)$/i) { }
0 0 elsif ($cmd =~ /^debug (.+)$/i) { }
0 0 elsif ($cmd =~ /^queue_depth (\w+)/) { }
0 0 elsif ($cmd =~ /^queue_todo (\w+) (.+)/) { }
0 0 elsif ($cmd =~ /^worker_bored (\d+) (.+)/) { }
0 0 elsif ($cmd eq ':ping') { }
0 0 elsif ($cmd eq ':still_alive') { }
0 0 elsif ($cmd =~ /^:monitor_events/) { }
0 0 elsif ($cmd eq ':monitor_just_ran') { }
0 0 elsif ($cmd =~ /^:wake_a (\w+)$/) { }
0 0 elsif ($cmd =~ /^:set_config_from_child (\S+) (.+)/) { }
0 0 elsif ($cmd =~ /^:refresh_monitor$/) { }
663 0 0 if ($job eq 'all') { }
670 0 0 if ($pending_work{$job})
684 0 0 if (job_needs_reduction($child->job)) { }
687 0 0 unless (exists $idle_workers{$child->job})
704 0 0 if (job_needs_reduction($child->job)) { }
737 0 0 if length $cmd > 80
758 0 0 unless defined $childref and %$childref
762 0 0 if $exclude_child and $exclude_child == $child
766 0 0 if $just_one
774 0 0 if $IsChild
778 0 0 unless $worker
781 0 0 unless defined $fd
784 0 0 if ($Mappings{$fd})
800 0 0 unless defined $jobs{$job}
804 0 0 unless $todie{$pid}
815 0 0 if (not $want_job_master and $needs_job_master{$job} and $jobs{'job_master'}[1] == 0 and ($q = $pending_work{$job}) && !@$q || !$q)
831 0 0 if ($child) { }
841 0 0 if $exclude and $child == $exclude
849 0 0 unless ($monitor_good)