Branch Coverage

blib/lib/DBIx/QuickDB/Watcher.pm
Criterion Covered Total %
branch 25 118 21.1


line true false branch
36 0 0 if $self->{'master_pid'} == $$
41 0 0 if $self->{'server_pid'}
44 0 0 unless pipe $rh, $wh
47 0 0 unless defined $pid
49 0 0 if ($pid)
55 0 0 unless $self->{'watcher_pid'}
56 0 0 unless $self->{'server_pid'}
64 0 0 unless defined $pid
65 0 0 if $pid
71 0 0 unless eval { do { $self->watch($wh); 1 } }
94 0 0 unless my $spid = $self->{'server_pid'}
153 0 0 unless open STDIN, "<", \$blah
155 0 0 unless my $master_pid = $params{'master_pid'}
156 0 0 unless my $server_pid = $params{'server_pid'}
157 0 0 unless my $data_dir = $params{'data_dir'}
163 0 0 if ($hup and not $hupped)
165 0 0 unless open STDOUT, ">", \$blah
167 0 0 unless open STDERR, ">", \$blah
172 0 0 if kill 0, $master_pid
176 0 0 unless (eval { do { $class->_watcher_terminate("send_sig", $signal, "fast_sig", $fast_signal, "got_sig", $kill, "pid", $server_pid, "dir", $data_dir); 1 } })
188 0 0 if $self->{'server_pid'}
205 0 0 unless my $pid = $params{'pid'}
206 0 0 unless my $dir = $params{'dir'}
216 0 0 if ($got_sig and $got_sig eq "FAST_TERM")
221 0 0 if -d $dir
228 0 0 if ($got_sig and $got_sig eq "TERM")
231 0 0 if -d $dir
241 0 3 unless kill $sig, $pid
260 2 200 if ($escalated)
268 1 199 if $check
270 1 198 if (&DBIx::QuickDB::Watcher::time() - $start > 2)
278 0 3 unless $check
279 0 3 if $check < 0
280 0 3 if $pid != $check
291 0 2 unless kill $sig, $pid
301 0 2 unless defined $kill_after and $kill_after =~ /^\d+$/ and $kill_after > 0
313 0 2 $kill_after > 1 ? :
323 2 31 if ($delta >= $fast_at and not $sent_fast)
329 1 32 if ($delta >= $kill_at and not $sent_kill)
330 1 0 unless $fast_sig eq "KILL"
343 1 32 if ($sent_kill)
352 1 31 if $check
357 0 2 unless $check
358 0 2 if $check < 0
359 0 2 if $pid != $check
373 0 0 if $self->{'stopped'}++ or $self->{'eliminated'}
374 0 0 unless my $pid = $self->{'watcher_pid'}
380 0 0 if $self->{'eliminated'}++ or $self->{'stopped'}
381 0 0 unless my $pid = $self->{'watcher_pid'}
392 0 0 if $self->{'eliminated'}++ or $self->{'stopped'}
393 0 0 unless my $pid = $self->{'watcher_pid'}
399 0 0 if $self->{'detached'}++
400 0 0 if $self->{'stopped'} or $self->{'eliminated'}
401 0 0 unless my $pid = $self->{'watcher_pid'}
407 0 0 unless my $pid = $self->{'watcher_pid'}
415 0 0 unless defined $grace and $grace =~ /^\d+$/ and $grace > 0
421 0 0 if ($waited > $timeout)
436 0 0 if ($self->{'master_pid'} == $$) { }
441 0 0 if $self->{'log_file'}