Repository navigation
Description
Goal:
Run normal media-processing tasks without a stalled FFmpeg or FFprobe invocation blocking a background task for an unbounded amount of time.
Steps:
Two occurrences were reproduced on the same deployment.
Case 1: intro-marker detection
- Start the
detect_intro_markerstask on a TV library containing large 4K MKV files. - Allow it to reach the affected season.
- Observe the UI remain on “Analyzing intro group.”
- Inspect the FFmpeg child process.
- Cancel the task manually after it has made no observable progress for approximately 30 minutes.
The invoked command was equivalent to:
/usr/lib/jellyfin-ffmpeg/ffmpeg \
-hide_banner \
-loglevel warning \
-threads 1 \
-ss 0 \
-i <media-file>.mkv \
-t 600 \
-ac 2 \
-f chromaprint \
-fp_format raw -Case 2: library scan
- Restart Silo.
- Start a TV-library scan.
- Observe the scan quickly reach its final four files.
- Observe four concurrent FFprobe processes stop making progress for several minutes.
The FFprobe command was:
/usr/lib/jellyfin-ffmpeg/ffprobe -v quiet -print_format json -show_format -show_streams -show_chapters <media-file>.mkvExpected:
Silo should place a configurable deadline or no-progress watchdog around every FFmpeg and FFprobe invocation.
When a child process exceeds that threshold, Silo should:
- terminate it;
- record a useful timeout error;
- mark the affected file or analysis group as failed/skipped;
- release the worker slot;
- continue with the remaining work;
- allow the parent task to complete with errors rather than appear hung.
Actual:
Case 1: intro-marker detection
The FFmpeg process ran for approximately 30 minutes at 0% CPU. Its input position and I/O counters did not change across repeated observations. The task did not advance and no timeout was observed.
The only relevant log output appeared after manual cancellation. Raw log lines (media path and content identifier redacted):
2026-08-10T13:35:17.314252550Z time=2026-08-10T13:35:17.313Z level=INFO msg="task cancel requested" task=detect_intro_markers
2026-08-10T13:35:17.319960646Z time=2026-08-10T13:35:17.319Z level=WARN msg="intro marker fingerprint extraction failed" file_id=422 path="/media/tv/<redacted>/<redacted>.mkv" error="extracting chromaprint for file 422: signal: killed"
2026-08-10T13:35:17.320379570Z time=2026-08-10T13:35:17.320Z level=WARN msg="intro marker group analysis failed" season_id=<redacted> media_folder_id=2 group_key=default|default|en error="context canceled"
Case 2: library scan
The scan reached 2668 / 2672 and reported the same progress for several minutes:
2026-08-10T13:38:38.549637634Z time=2026-08-10T13:38:38.549Z level=INFO msg="scan queue: progress" scan_id=01KZNY9RXZWC49A6VJWC68Q6SD library_id=2 phase=processing message="Processing discovered files" processed_files=2668 total_files=2672 matched_files=0 retried_items=0
2026-08-10T13:42:48.551246867Z time=2026-08-10T13:42:48.551Z level=INFO msg="scan queue: progress" scan_id=01KZNY9RXZWC49A6VJWC68Q6SD library_id=2 phase=processing message="Processing discovered files" processed_files=2668 total_files=2672 matched_files=0 retried_items=0
At that point all four remaining worker processes were FFprobe invocations at 0% CPU. Raw process output (media paths redacted):
184503 180392 S 03:35 0.0 request_wait_answer /usr/lib/jellyfin-ffmpeg/ffprobe -v quiet -print_format json -show_format -show_streams -show_chapters /media/tv/<redacted>/<redacted>.mkv
184521 180392 S 03:35 0.0 request_wait_answer /usr/lib/jellyfin-ffmpeg/ffprobe -v quiet -print_format json -show_format -show_streams -show_chapters /media/tv/<redacted>/<redacted>.mkv
184522 180392 S 03:35 0.0 request_wait_answer /usr/lib/jellyfin-ffmpeg/ffprobe -v quiet -print_format json -show_format -show_streams -show_chapters /media/tv/<redacted>/<redacted>.mkv
184523 180392 S 03:35 0.0 request_wait_answer /usr/lib/jellyfin-ffmpeg/ffprobe -v quiet -print_format json -show_format -show_streams -show_chapters /media/tv/<redacted>/<redacted>.mkv
Their file positions and /proc/<pid>/io counters did not change during a five-second sample.
Two probes eventually completed after several additional minutes, allowing the scan to advance slowly to 2669 and then 2670. The remaining probes continued waiting. No Silo-side timeout was observed.
What is slow/broken:
A stalled or extremely slow external FFmpeg/FFprobe process can occupy a worker for many minutes without an observable deadline or no-progress watchdog.
This affected:
- intro-marker fingerprint extraction;
- the containing intro-analysis group;
- individual library-scan workers;
- overall scan completion when every available worker was waiting.
Scope:
Observed in two workflows on the same deployment:
- FFmpeg during intro-marker detection;
- FFprobe during a library scan.
The behavior is intermittent and file-dependent. Other files that returned immediate EOF or I/O errors were handled and skipped; the task-level stall occurs when the child process remains alive and does not return.
Version/branch:
- Image:
ghcr.io/silo-server/silo-server:latest - Image ID:
sha256:c15fd015ddf1bbce032a2f8375867aa5b1484f3b387892a204f69b00292b782d - FFmpeg/FFprobe:
7.1.4-Jellyfin
Deployment:
- Docker Compose
- Integrated Silo service
- Linux arm64
- Kernel:
6.8.0-137-generic - Media exposed to the container through the configured
/mediamount
Technical notes:
For the intro process:
- elapsed time exceeded 27 minutes;
- CPU usage remained at 0%;
- the demux thread was waiting in
folio_wait_bit_common; - the input offset remained fixed at
55,451,648; - I/O counters did not advance;
- no extraction timeout was logged before manual cancellation.
For the scan processes:
- all four initially remained at 0% CPU;
- all four were waiting in
request_wait_answer; - their observed input offsets were
397312,524288,258048, and258048; - their offsets and I/O counters did not advance during sampling;
- two eventually completed after multi-minute delays, while the other two remained blocked at the last observation.
A per-process deadline plus a no-progress watchdog would keep one problematic read from indefinitely occupying a worker. It would also help if the resulting error included the file ID/path, command type, elapsed time, and timeout reason.
AI Disclosure
- Tool(s): Codex Desktop
- Model(s): gpt-5
- Involvement: AI-assisted
- Adversarial review: Cross-checked the report against the live deployment, raw Silo logs, process state, file offsets, and
/procI/O counters. Removed an unverified root-cause theory, changed the claim from “indefinitely stuck” to “no observed timeout / multi-minute stalls” after two FFprobe processes eventually completed, and redacted all media filenames and content identifiers.
Activity
blurbery commentedon Oct 14, 2026
I'm picking this up.
Plan: give the intro marker ffmpeg runs (chromaprint head, credits tail and silence detection) per-attempt deadlines, the same way chapter thumbnails already do, and put a deadline on the scanner's ffprobe calls. When a run times out, Silo kills it, logs the file and the reason, fails that file or intro group, and the task carries on. A probe that times out won't be recorded as a rejected file, so the next scan tries it again.
I'm leaving out the no-progress watchdog to keep this simple. This won't fix #1026, where the Silo process itself is stuck in D state.
fix(scanner): kill a wrapper's ffprobe with it at the deadline
fix(scanner,markers): stop stalled ffprobe and ffmpeg runs at a deadl…