Skip to content

Conversation

@tomtom215
Copy link

Broaden exception handler in run_analysis() from (NameError, TypeError) to Exception to prevent infinite retry loops when librosa.load() fails.

Previous behavior:

  • NameError/TypeError: file processed with empty detections, deleted
  • Other exceptions (ValueError, RuntimeError, audioread.DecodeError): propagated to process_file(), file NOT deleted, retried on restart
  • This caused infinite loops when a corrupted file kept failing

New behavior:

  • All Python exceptions: file processed with empty detections, deleted
  • Prevents infinite retry loops for corrupted/malformed audio files
  • Improved logging: shows filename and exception type for debugging

This is a bug fix, not a breaking change. The "keep retrying forever" behavior for non-NameError/TypeError exceptions was unintended.

Note: C-level crashes (segfaults from ffmpeg/libsndfile) are still not catchable by Python manual intervention to delete corrupted files in the backlog

Broaden exception handler in run_analysis() from (NameError, TypeError)
to Exception to prevent infinite retry loops when librosa.load() fails.

Previous behavior:
- NameError/TypeError: file processed with empty detections, deleted
- Other exceptions (ValueError, RuntimeError, audioread.DecodeError):
  propagated to process_file(), file NOT deleted, retried on restart
- This caused infinite loops when a corrupted file kept failing

New behavior:
- All Python exceptions: file processed with empty detections, deleted
- Prevents infinite retry loops for corrupted/malformed audio files
- Improved logging: shows filename and exception type for debugging

This is a bug fix, not a breaking change. The "keep retrying forever"
behavior for non-NameError/TypeError exceptions was unintended.

Note: C-level crashes (segfaults from ffmpeg/libsndfile) are still not
catchable by Python and require the quarantine script approach.
@alexbelgium
Copy link

This is a good idea I encountered this bug once that was a bit annoying

@tomtom215 tomtom215 closed this Dec 30, 2025
@tomtom215 tomtom215 deleted the claude/fix-infinite-retry-loop-21g1K branch December 30, 2025 15:37
@tomtom215 tomtom215 restored the claude/fix-infinite-retry-loop-21g1K branch January 19, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants