You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Jobs: completed_time is truncated to the second, so it can precede reserved_time #1600
The jobs table declares reserved_time and completed_time as datetime(3) (jobs.py:167-168). reserve() writes reserved_time as CURRENT_TIMESTAMP(3) (jobs.py:464), but complete() and error() take completed_time from SELECT CURRENT_TIMESTAMP (jobs.py:499, 529), which has no fractional seconds. MySQL truncates it to the whole second, so any job that finishes in the second it was reserved records a completed_time earlier than its reserved_time.
Error records carry no duration, so completed_time - reserved_time is the only measure of how long a failed job ran, and it comes out negative or up to a second short. With keep_completed = True, success records show the same inversion.
Reproduction
DataJoint 2.3.5.dev8 (master, a00b89f), MySQL 8.0.46, Python 3.11:
completed_time is recorded at the column's declared precision and on the same clock as reserved_time, so completed_time >= reserved_time always holds: SELECT CURRENT_TIMESTAMP(3) in complete() and error(). On PostgreSQL, CURRENT_TIMESTAMP is the start of the transaction rather than the statement; the statement-time adapter expression proposed in #1584 would serve here too.
Activity