Trace pipeline pool isolation: - Switch event_fetcher and lineage_engine to read_sql_df_slow (non-pooled) - Reduce EVENT_FETCHER_MAX_WORKERS 4→2, TRACE_EVENTS_MAX_WORKERS 4→2 - Add 60s timeout per batch query, cache skip for CID>10K - Early del raw_domain_results + gc.collect() for large queries - Increase DB_SLOW_MAX_CONCURRENT: base 3→5, dev 2→3, prod 3→5 Test fixes (51 pre-existing failures → 0): - reject_history: WORKFLOW CSV header, strict bool validation, pareto mock path - portal shell: remove non-existent /tmtt-defect route from tests - conftest: add --run-stress option to skip stress/load tests by default - migration tests: skipif baseline directory missing - performance test: update Vite asset assertion - wip hold: add firstname/waferdesc mock params - template integration: add /reject-history canonical route Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1.1 KiB
1.1 KiB
1. Config 調整
- 1.1
settings.py: Config baseDB_SLOW_MAX_CONCURRENT3→5, DevelopmentConfig 2→3, ProductionConfig 3→5
2. 後端 service 遷移
- 2.1
event_fetcher.py: importread_sql_df_slow as read_sql_df(line 16) - 2.2
event_fetcher.py:EVENT_FETCHER_MAX_WORKERSdefault 4→2 (line 22) - 2.3
event_fetcher.py:_fetch_batch加timeout_seconds=60(line 247) - 2.4
event_fetcher.py: 新增CACHE_SKIP_CID_THRESHOLD,fetch_events大 CID 集跳過 cache +del grouped - 2.5
lineage_engine.py: importread_sql_df_slow as read_sql_df(line 10)
3. Route 層修改
- 3.1
trace_routes.py:TRACE_EVENTS_MAX_WORKERSdefault 4→2 (line 39) - 3.2
trace_routes.py: events endpoint 中del raw_domain_results早期釋放 - 3.3
trace_routes.py: 大查詢後gc.collect() - 3.4
trace_routes.py: 大查詢跳過 route-level events cache
4. Tests
- 4.1
test_event_fetcher.py: 新增 regression test 驗證 slow path import - 4.2
test_lineage_engine.py: 新增 regression test 驗證 slow path import - 4.3 執行
pytest tests/ -v確認全部通過