diff --git a/lib/OpenQA/Shared/Controller/Running.pm b/lib/OpenQA/Shared/Controller/Running.pm index 8d3c60db2fa..28e1662f1f2 100644 --- a/lib/OpenQA/Shared/Controller/Running.pm +++ b/lib/OpenQA/Shared/Controller/Running.pm @@ -111,12 +111,6 @@ sub streamtext ($self, $file_name, $start_hook = undef, $close_hook = undef) { # Check for new lines from the logfile using recurring timer # Setup utility function to close the connection if something goes wrong my $timer_id; - my $close_connection = sub ($self) { - Mojo::IOLoop->remove($timer_id); - $close_hook->(); - $self->finish; - close $log; - }; $timer_id = Mojo::IOLoop->recurring( TEXT_STREAMING_INTERVAL() => sub (@) { if (!$ino) { @@ -126,10 +120,9 @@ sub streamtext ($self, $file_name, $start_hook = undef, $close_hook = undef) { $size = -s $logfile; } - # Zero tolerance for any shenanigans with the logfile, such as - # truncation, rotation, etc. my @st = stat $logfile; - return $close_connection->() unless @st && $st[1] == $ino && $st[3] > 0 && $st[7] >= $size; + die "Zero tolerance for any shenanigans with the logfile, such as truncation, rotation, etc." + unless @st && $st[1] == $ino && $st[3] > 0 && $st[7] >= $size; # If there's new data, read it all and send it out. Then # seek to the current position to reset EOF.