_job_start_time records the populating host's local time, with no zone
維護者通常 1 天內回覆
@dimitri-yatsenko 已經在處理了。
開始於 2026年10月12日。
評估
這個 Issue 還沒有評估資料。
描述
populate() stores _job_start_time as naive local time on whichever host runs it: start_time = time.time() (autopopulate.py:665), then written as datetime.datetime.fromtimestamp(start_time) (autopopulate.py:742). Two hosts in different time zones write different values for the same instant, and nothing in the row records which zone applies. A populate() run from a laptop in US Central and one from a worker in UTC leave start times five hours apart for computations that ran at the same moment.
The other timestamps the framework writes use a known clock:
_prov.timeis UTC:datetime.datetime.now(datetime.timezone.utc).isoformat()(provenance.py:103).- The job table's
completed_timeis the server'sCURRENT_TIMESTAMP(jobs.py:499,529).
A reader cannot place _job_start_time on either of those scales unless every host that populates the schema runs in the same zone.
Proposal
- Take
_job_start_timefrom the server's clock, as the job table already does forcompleted_time(jobs.py:498-499) andscheduled_time(jobs.py:388). Compute it in theUPDATEthat already writes the hidden columns (autopopulate.py:874), as the server's current time minus_job_duration. That adds no round trip, and every host that populates the schema then writes on one clock, whatever zone the host runs in. - The server expression must be statement time, not transaction time:
NOW(3)on MySQL, andstatement_timestamp()on PostgreSQL, whereCURRENT_TIMESTAMPis the start of the transaction. It belongs in the adapter, besidecurrent_user_expr(). - Keep measuring
_job_durationon the worker. It is a difference of two readings on one clock, so neither zone nor skew affects it. TheUPDATEruns after the commit that_job_durationalready includes, so the derived start is late by the one-way latency of that statement, which is the same error a separateSELECTat start would carry. - State in
job-metadata.md(datajoint-docs) that_job_start_timeuses the server's clock from the release that ships the change, and that rows written earlier carry the populating host's local time. Those rows cannot be corrected after the fact, because the zone was never recorded.
- 主要語言
- Python
- 星號
- 197
- 分支
- 98
- 平均合併
- 15 小時 31 分鐘
- 30 天內合併 PR
- 9
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
datajoint/datajoint-python 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 70/100
datajoint/datajoint-python#1581 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
datajoint/datajoint-python#1539 · 3 則留言 ·
維護者通常 1 天內回覆
-
database.name should namespace schema names on MySQL, as it does on PostgreSQL可能已有人在做 @dimitri-yatsenko 於 3 天前認領。 未關閉feature
難度 4/5 3-5 天 新手友好度 15/100
datajoint/datajoint-python#1582 ·
維護者通常 1 天內回覆
-
難度 3/5 1-2 天 新手友好度 40/100
datajoint/datajoint-python#1580 ·
維護者通常 1 天內回覆
-
A column copied by a foreign key loses the parent's core type (int32 becomes int)可能已有人在做 @dimitri-yatsenko 於 4 天前認領。 未關閉
難度 3/5 半天 新手友好度 25/100
datajoint/datajoint-python#1578 ·
維護者通常 1 天內回覆
查看 datajoint/datajoint-python 的全部 Issue
相似的 Issue
-
effort: low prio: low ready
難度 2/5 1-3 小時 新手友好度 82/100
digitalfabrik/integreat-cms#4616 ·
維護者通常 5 天內回覆
-
bug difficulty:2 good first issue help wanted
難度 2/5 1-3 小時 新手友好度 88/100
MakazhanAlpamys/Soup#1865 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
FinanceFlash/unvibecode#233 ·
維護者通常 1 天內回覆
-
area: agents area: docs good first issue
難度 2/5 1-3 小時 新手友好度 88/100
openapi/gknowledge#23 ·
-
useless-suppression reported for deprecated-* messages that should be exempt可能已有人在做 @adityasinha-ghub 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 88/100
pylint-dev/pylint#11656 ·
維護者通常 1 天內回覆