busya
de023c7a31
fix(backend+frontend): migration deadlock, async pattern, timeout safety, fire-and-forget translations
Backend:
- MigrationPlugin.execute — remove AsyncJobRunner.run() deadlock on post-migration
ID sync (2 deadlocks total: plugins/migration.py + api/routes/migration.py
trigger_sync_now). Replace blocking runner.run with direct await.
- MigrationPlugin.execute — fix temp file leak (dry_run=True prevented cleanup).
- MigrationPlugin.execute — IdMappingService(SessionLocal()) now closed in finally.
- MigrationPlugin.execute — wire IdMappingService into MigrationEngine constructor
so cross-filter patching actually works instead of silently skipping.
- MigrationPlugin.execute — SupersetClient.aclose() in finally to prevent
httpx connection pool leak.
- TaskManager — _async_tasks dict leak (add_done_callback cleanup).
- JobLifecycle — CancelledError handler (tasks stuck in RUNNING after cancel).
- JobLifecycle — persist_task BEFORE _broadcast_task_status (crash consistency).
- JobLifecycle — wait_for_resolution/wait_for_input now have 3600s timeout.
- AsyncJobRunner.run — 300s timeout on future.result() (APScheduler thread safety).
Translate scheduler:
- execute_scheduled_translation — replace blocking runner.run(orch.execute_run(run))
with fire-and-forget TranslationOrchestrator.execute_background(). APScheduler
thread is freed in ms instead of blocking for the full translation duration.
Translation runs of 10k+ rows (200+ LLM batches, hours) no longer hit the
300s runner timeout.
- TranslationOrchestrator.execute_background — new static method: opens own DB
session, dispatches asyncio.create_task, handles errors + notification.
- Scheduler last_run_at updated at dispatch time (not after completion).
Frontend:
- MigrationModel.stepReady[3] now requires dryRunResult != null (was always
true, allowing UI to reach step 3 without dry-run).
- WizardModel.goToStep gate for step 3 uses stepReady[3].
- +page.svelte — dryRunResult no longer self-clears via reactive loop.
- Progress bar step 3 indicator gate fixed for new readiness logic.
Tests:
- 2 new regression tests for migration sync (deadlock-free, completes cleanly).
- test_migration_plugin.py — _make_mock_superset_client/_make_mock_mapping_service
helpers for proper async mock behavior (aclose, sync_environment AsyncMock).
- 10 scheduled-translation tests updated for fire-and-forget pattern.
- MigrationModel.test.ts — step 3 invariant + goToStep block test.
- All affected tests: 104 backend + 79 frontend = 183 passed.
2026-07-07 21:04:23 +03:00
..
2026-07-07 21:04:23 +03:00
2026-07-01 20:47:25 +03:00
2026-07-04 22:47:17 +03:00
2026-07-07 10:23:49 +03:00
2026-06-16 00:12:49 +03:00
2026-07-07 21:04:23 +03:00
2026-06-16 00:12:49 +03:00
2026-06-16 11:01:31 +03:00
2026-07-06 01:23:20 +03:00
2026-07-07 15:18:24 +03:00
2026-07-01 20:47:25 +03:00
2026-07-06 13:45:22 +03:00
2026-06-01 16:34:07 +03:00
2026-05-26 19:18:28 +03:00
2026-05-26 19:18:28 +03:00
2026-06-16 00:12:49 +03:00
2026-06-10 14:57:18 +03:00
2026-06-10 14:57:18 +03:00
2026-06-15 22:04:40 +03:00
2026-06-16 11:01:31 +03:00
2026-06-10 14:57:18 +03:00
2026-06-16 11:01:31 +03:00
2026-06-16 11:01:31 +03:00
2026-07-06 01:23:09 +03:00
2026-06-15 17:31:43 +03:00
2026-06-16 12:11:49 +03:00
2026-05-26 19:18:28 +03:00
2026-06-17 16:22:30 +03:00
2026-06-16 12:01:03 +03:00
2026-06-05 15:43:35 +03:00
2026-06-16 12:11:49 +03:00
2026-06-16 12:11:49 +03:00
2026-07-06 01:23:09 +03:00
2026-05-26 19:18:28 +03:00
2026-07-07 17:37:36 +03:00
2026-05-26 19:18:28 +03:00
2026-06-15 19:31:56 +03:00
2026-05-26 19:18:28 +03:00
2026-05-26 19:18:28 +03:00
2026-06-16 00:12:49 +03:00
2026-06-05 15:43:35 +03:00
2026-06-15 17:31:43 +03:00
2026-06-16 11:01:31 +03:00
2026-06-15 17:31:43 +03:00
2026-06-15 16:45:49 +03:00
2026-06-15 17:31:43 +03:00
2026-07-02 08:53:19 +03:00
2026-06-15 17:31:43 +03:00
2026-06-16 12:01:03 +03:00
2026-06-16 12:11:49 +03:00
2026-05-26 19:18:28 +03:00
2026-06-18 23:54:57 +03:00
2026-06-16 12:01:03 +03:00
2026-05-26 19:18:28 +03:00
2026-07-06 01:23:09 +03:00
2026-06-16 12:11:49 +03:00
2026-06-16 12:01:03 +03:00
2026-06-16 00:12:49 +03:00
2026-06-16 00:12:49 +03:00
2026-05-26 19:18:28 +03:00
2026-05-25 08:36:33 +03:00
2026-06-29 17:15:25 +03:00
2026-06-15 19:31:56 +03:00
2026-06-11 19:12:45 +03:00
2026-05-26 19:18:28 +03:00
2026-06-11 19:12:45 +03:00
2026-06-11 19:12:45 +03:00
2026-07-07 21:04:23 +03:00
2026-07-07 21:04:23 +03:00
2026-07-07 21:04:23 +03:00
2026-06-15 22:04:40 +03:00