forked from j62/ctbrec
1
0
Fork 0

(Logging) some tracing

This commit is contained in:
reusedname 2025-02-15 15:10:17 +05:00
parent 6f9024838c
commit 8ca70a510c
2 changed files with 9 additions and 3 deletions

View File

@ -37,6 +37,7 @@ import static ctbrec.SubsequentAction.*;
import static ctbrec.event.Event.Type.MODEL_ONLINE; import static ctbrec.event.Event.Type.MODEL_ONLINE;
import static java.lang.Thread.MAX_PRIORITY; import static java.lang.Thread.MAX_PRIORITY;
import static java.lang.Thread.MIN_PRIORITY; import static java.lang.Thread.MIN_PRIORITY;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.SECONDS; import static java.util.concurrent.TimeUnit.SECONDS;
@Slf4j @Slf4j
@ -260,6 +261,7 @@ public class SimplifiedLocalRecorder implements Recorder {
} catch (RejectedExecutionException e) { } catch (RejectedExecutionException e) {
log.error("Could not start post-processing for {} {}:{}. Execution rejected by thread pool", recording, recording.getModel().getSite().getName(), recording.getModel().getDisplayName()); log.error("Could not start post-processing for {} {}:{}. Execution rejected by thread pool", recording, recording.getModel().getSite().getName(), recording.getModel().getDisplayName());
} }
log.trace("submitPostProcessingJob(): {}", postProcessing);
} }
private void runPostProcessing(Recording recording) throws IOException, InterruptedException { private void runPostProcessing(Recording recording) throws IOException, InterruptedException {

View File

@ -81,6 +81,7 @@ public class MergedFfmpegHlsDownload extends AbstractHlsDownload {
downloadExecutor.submit(() -> { downloadExecutor.submit(() -> {
ffmpegStreamLock.lock(); ffmpegStreamLock.lock();
try { try {
LOG.trace("Starting streaming segments to file {}", targetFile);
while (!queue.isEmpty() && !Thread.currentThread().isInterrupted()) { while (!queue.isEmpty() && !Thread.currentThread().isInterrupted()) {
try { try {
Future<SegmentDownload> future = queue.peek(); Future<SegmentDownload> future = queue.peek();
@ -95,11 +96,13 @@ public class MergedFfmpegHlsDownload extends AbstractHlsDownload {
break; break;
} }
} catch (InterruptedException e) { } catch (InterruptedException e) {
LOG.trace("Segment download interrupted for model {}", model, e);
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
} catch (Exception e) { } catch (Exception e) {
LOG.error("Segment download failed for model {}", model, e); LOG.error("Segment download failed for model {}", model, e);
} }
} }
LOG.trace("Finishing streaming segments to file {}", targetFile);
} finally { } finally {
ffmpegStreamLock.unlock(); ffmpegStreamLock.unlock();
} }
@ -146,6 +149,7 @@ public class MergedFfmpegHlsDownload extends AbstractHlsDownload {
@Override @Override
protected void execute(SegmentDownload segmentDownload) { protected void execute(SegmentDownload segmentDownload) {
queue.add(segmentDownloadService.submit(segmentDownload)); queue.add(segmentDownloadService.submit(segmentDownload));
LOG.trace("Enqueuing segment for file {}", targetFile);
} }
@Override @Override