Skip to content

Problem with last_run and finished timing difference in the timetable.execution_log table #788

Description

@0xgouda

Describe the bug
The last_run and finished field in timetable.execution_log don't show correct timings, i.e. the chains we are running some of them might take days or hours to complete but we can only see a ~microsecond difference between the two fields.

To Reproduce
Steps to reproduce the behavior:

  1. Add the following chain SELECT timetable.add_job('test-finished-last_run', '* * * * *', 'select pg_sleep(90)');
    • It will take 90 seconds to finish
  2. Wait until it executes once
  3. Query timetable.execution_log and observe that finished - last_run is only smaller by a microsecond or so

Expected behavior
last_run and finished fields should contain precise start and end timing for the chain

Screenshots

select * from timetable.execution_log where chain_id = 7 order by last_run desc limit 1 \gx
-[ RECORD 1 ]+------------------------------
chain_id     | 7
task_id      | 6
txid         | 25769803876
last_run     | 2026-07-10 14:36:28.229226+03
finished     | 2026-07-10 14:36:28.229227+03
pid          | 781828130
returncode   | 0
ignore_error | t
kind         | SQL
command      | select pg_sleep(90)
output       | SELECT 1
client_name  | pg_timetable
params       | 

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions