#1436·photoview

The rescan doesn't complete, but constantly freezes.

Author: ElizarovEugeneCreated Jun 12, 2026Updated Jun 13, 2026
Labelsbughelp wantedscannerhigh prioritygo

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Settings'
  2. Set 'maximum amount of scanner jobs' > 4
  3. See free on log, cpu utilization = 0

Expected behavior A clear and concise description of what you expected to happen.

Your environment: Docker on VMware VM (16 vCPU, 16 Ram, 100Gb SSD)

  • Are you using Docker? [yes]
  • Database [mariadb 10.5]
  • Browser [safari]
  • Version [master-amd64 (b3aabfe) // 2026-06-11T10:51:04+00:00(UTC)]

Additional context Reason for the freeze

The photoview process (PID 59162) is stuck deadlocked on a mutex, not on actual I/O—that's why the CPU drops to 0% and the freeze appears as "silence" in the logs.

From the stack dump: goroutine 24681 [sync.Mutex.Lock, 68 minutes]: ... exif.MIMEType(...) exif.go:97 media_encoding.NewEncodeMediaData(...) encode_photo.go:106 scanner.ScanAlbum(...) scanner_album.go:102 scanner_queue.(*ScannerJob).Run(...)

Mechanism: Photoview maintains a single shared exiftool -stay_open process for metadata extraction, and access to it is serialized through a single sync.Mutex — only one worker can process files at a time. If exiftool "hangs" on a specific file (photo/video) and doesn't return a response, the worker that called it holds the mutex forever. The remaining 14 workers in the scanning queue (and the periodic scanner) queue up for the same lock, and the entire scan freezes. The exiftool process (PID 59259) is still alive, but it's just sitting there waiting for a command on stdin—meaning it either didn't receive a response to the previous request or is stuck on a specific file.