.vbw-planning/milestones/07-rails-audit-and-refactoring/04-job-pipeline-reliability/02-PLAN.md
Add transient vs fatal error classification to FaviconFetchJob and DownloadContentImagesJob (S6), add deadlock rescue to jobs that lack it, remove dead code from ImportSessionHealthCheckJob (S1), and fix ScrapeItemJob log levels (S5 partial).
rescue ActiveRecord::Deadlocked; raise at lines 58-59 (rescue_from at line 13 catches first)info level instead of warn/errorrescue_from ActiveRecord::Deadlocked: ScheduleFetchesJob, ItemCleanupJob, LogCleanupJob, ScrapeItemJobCreate/update test files:
test/jobs/source_monitor/favicon_fetch_job_test.rb: test transient error (Faraday::TimeoutError) re-raises; test fatal error (RuntimeError) calls record_failed_attempt without re-raisingtest/jobs/source_monitor/download_content_images_job_test.rb: test transient error (Faraday::TimeoutError) re-raises entire job; test per-image fatal error (URI::InvalidURIError) skips image and continuesModify app/jobs/source_monitor/favicon_fetch_job.rb:
TRANSIENT_ERRORS constant: [Timeout::Error, Errno::ETIMEDOUT, Faraday::TimeoutError, Faraday::ConnectionFailed, Net::OpenTimeout, Net::ReadTimeout].freeze*TRANSIENT_ERRORS BEFORE the StandardError rescueModify app/jobs/source_monitor/download_content_images_job.rb:
TRANSIENT_ERRORS constant*TRANSIENT_ERRORS and re-raise (abort entire job for retry)rescue StandardError for per-image fatal errors but add warn-level logging with image URLActiveRecord::Deadlocked rescue remains above bothApply to multiple jobs:
rescue ActiveRecord::Deadlocked; raise block at lines 58-59rescue_from ActiveRecord::Deadlocked with jitter retry; change error log level from info to warn/errorrescue_from ActiveRecord::Deadlocked with jitter retryrescue_from ActiveRecord::Deadlocked with jitter retryrescue_from ActiveRecord::Deadlocked with jitter retrybin/rails test test/jobs/source_monitor/ -- all job tests passbin/rails test -- full suite passesbin/rubocop -- zero offensesgrep -r "rescue ActiveRecord::Deadlocked" app/jobs/ confirms all jobs have rescue_from or inline rescue