soulsync/tests/downloads
Broque Thomas 2c19d7d1f2 Per-source lock sharding on the engine
Per JohnBaumb: the single state_lock serialized progress callbacks
across every source. Pre-refactor each client owned its own download
lock, so Deezer / YouTube / Tidal workers never blocked each other.
Multi-source concurrent downloads under the unified lock fought for
the same RLock on every progress update.

Replaced the engine-wide state_lock with per-source RLocks. Each
source gets its own lock, lazily created via _source_lock() on first
use (meta-lock guards the create-race). All record mutations
(add/update/update_unless_state/remove/get/iter) take only that
source's lock — Deezer progress updates no longer block Tidal writes.

Cancelled-preserve semantics still hold because cancel + worker
terminal write target the same source, so they share that source's
lock. New test pins lock independence: holding source-A's lock from
one thread does not block a write on source-B from another.
2026-05-05 11:56:09 -07:00
..
__init__.py PR4a: lift sync history recording to core/downloads/history.py 2026-04-27 20:37:16 -07:00
test_background_download_worker.py Cin review: alias resolution, atomic terminal write, generic accessors 2026-05-04 22:58:46 -07:00
test_deezer_pinning.py C6: Migrate Deezer to engine.worker 2026-05-04 14:02:03 -07:00
test_download_engine.py Per-source lock sharding on the engine 2026-05-05 11:56:09 -07:00
test_download_orchestrator.py Cin-5: Drop per-source attrs from orchestrator 2026-05-04 23:14:05 -07:00
test_downloads_cancel.py PR4b: lift cancel + clear download routes to core/downloads/cancel.py 2026-04-27 21:41:35 -07:00
test_downloads_candidates.py Cin-6: Rename soulseek_client global → download_orchestrator 2026-05-04 23:23:32 -07:00
test_downloads_cleanup.py PR4c: lift _automatic_wishlist_cleanup_after_db_update to core/downloads/cleanup.py 2026-04-27 22:23:41 -07:00
test_downloads_history.py PR4a: lift sync history recording to core/downloads/history.py 2026-04-27 20:37:16 -07:00
test_downloads_lifecycle.py Rename wishlist lifecycle helper 2026-04-30 08:06:02 +03:00
test_downloads_master.py Cin-6: Rename soulseek_client global → download_orchestrator 2026-05-04 23:23:32 -07:00
test_downloads_post_processing.py Cin-6: Rename soulseek_client global → download_orchestrator 2026-05-04 23:23:32 -07:00
test_downloads_staging.py Lift _try_staging_match to core/downloads/staging.py 2026-04-28 23:26:15 -07:00
test_downloads_status.py PR4e: lift status helpers + 3 routes to core/downloads/status.py 2026-04-27 23:26:26 -07:00
test_downloads_task_worker.py Filter SoundCloud previews at every entry point + fix hybrid fallback regression 2026-05-05 10:26:25 -07:00
test_downloads_validation.py Filter SoundCloud previews at every entry point + fix hybrid fallback regression 2026-05-05 10:26:25 -07:00
test_hifi_pinning.py C5: Migrate HiFi to engine.worker 2026-05-04 13:57:01 -07:00
test_lidarr_pinning.py A8: Pin LidarrDownloadClient download lifecycle behavior 2026-05-04 12:10:49 -07:00
test_qobuz_pinning.py C4: Migrate Qobuz to engine.worker 2026-05-04 13:52:55 -07:00
test_rate_limit_policy.py E1: Add RateLimitPolicy declaration mechanism 2026-05-04 14:38:20 -07:00
test_soulseek_pinning.py A1: Pin SoulseekClient download lifecycle behavior 2026-05-04 11:45:44 -07:00
test_soundcloud_pinning.py C7: Migrate SoundCloud to engine.worker 2026-05-04 14:24:50 -07:00
test_tidal_pinning.py C3: Migrate Tidal to engine.worker 2026-05-04 13:49:36 -07:00
test_youtube_pinning.py E2: Migrate YouTube to declared rate-limit policy 2026-05-04 14:45:52 -07:00