Files
egg d8e91624d4 feat(qc-gate): add Package column to LOT detail table + archive 3 completed changes
Add PACKAGE_LEF as a dedicated `package` field in the QC-GATE API payload
and display it as a new column after LOT ID in LotTable.vue. Archive
qc-gate-lot-package-column, historical-query-slow-connection, and
msd-multifactor-backward-tracing changes with their delta specs synced
to main specs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 08:44:26 +08:00

2.6 KiB
Raw Permalink Blame History

Why

歷史查詢頁面reject-history、query-tool、hold-history、resource-history、job-query、excel-query、mid-section-defect 目前共用 connection pool 的 55s call_timeout,前端也設有 60~120s AbortController timeout。 大範圍查詢(如長日期區間或大量 LOT經常逼近或超過 timeout使用者看到 "signal is aborted without reason" 錯誤。

歷史查詢屬於使用者手動觸發、非即時、可等待的操作,應採用獨立連線(read_sql_df_slow)配合 semaphore 並行控制,以「用時間換結果」的方式完成查詢,同時保護 connection pool 不被耗盡。

What Changes

  • 歷史查詢 service 從 read_sql_dfpool, 55s遷移到 read_sql_df_slow(獨立連線, 300s
  • read_sql_df_slow 加入 global semaphore 限制並行數(預設 3避免耗盡 Oracle 連線
  • read_sql_df_slow 的 timeout 預設從寫死 120s 改為 config 驅動(預設 300s
  • Gunicorn worker timeout 從 130s 提升到 360s 以容納長查詢
  • 前端歷史頁 timeout 統一提升到 360s6 分鐘)
  • 新增 DB_SLOW_CALL_TIMEOUT_MSDB_SLOW_MAX_CONCURRENT 環境變數設定
  • 即時監控頁wip、hold-overview、resource-status 等)完全不受影響

Capabilities

New Capabilities

  • slow-query-concurrency-control: read_sql_df_slow 的 semaphore 並行控制與 config 驅動 timeout

Modified Capabilities

  • reject-history-api: 底層 DB 查詢從 pooled 改為 dedicated slow connection
  • hold-history-api: 底層 DB 查詢從 pooled 改為 dedicated slow connection
  • query-tool-lot-trace: 移除 read_sql_df_slow 寫死的 120s timeout改用 config 預設
  • reject-history-page: 前端 API_TIMEOUT 從 60s 提升到 360s
  • hold-history-page: 前端 API_TIMEOUT 從 60s 提升到 360s
  • resource-history-page: 前端 API_TIMEOUT 從 60s 提升到 360s後端遷移至 slow connection
  • query-tool-equipment: 前端 timeout 從 120s 提升到 360s
  • progressive-trace-ux: DEFAULT_STAGE_TIMEOUT_MS 從 60s 提升到 360s

Impact

  • 後端 servicesreject_history_service、reject_dataset_cache、hold_history_service、resource_history_service、job_query_service、excel_query_service、query_tool_service
  • 核心模組database.pysemaphore + config、settings.py新設定、gunicorn.conf.pytimeout
  • 前端頁面reject-history、mid-section-defect、hold-history、resource-history、query-tool5 個 composable + 1 component、job-query、excel-query
  • 不影響即時監控頁wip-overview、wip-detail、hold-overview、hold-detail、resource-status、admin-performance