Skip to content

Fix TaskInstance duration calculation with SQLite - #68142

Merged
jason810496 merged 1 commit into
apache:mainfrom
henry3260:fix-sqlite-task-instance-duration
Jun 25, 2026
Merged

jason810496 merged 1 commit into
apache:mainfrom
henry3260:fix-sqlite-task-instance-duration

Conversation

@henry3260

Copy link
Copy Markdown
Contributor

Why

In SQLite, %s already includes the whole seconds, while %f returns seconds within the current minute including its integer portion. Combining them counts whole seconds twice and can produce incorrect or negative durations when the
timestamps cross a minute boundary.

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@henry3260
henry3260 requested review from XD-DENG and ashb as code owners June 6, 2026 19:48
@henry3260
henry3260 force-pushed the fix-sqlite-task-instance-duration branch from 5a8266b to 45240e0 Compare June 7, 2026 09:18
@henry3260
henry3260 force-pushed the fix-sqlite-task-instance-duration branch from 45240e0 to 00815c3 Compare June 7, 2026 09:46
@potiuk potiuk added the ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. label Jun 8, 2026

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@jason810496 jason810496 added this to the Airflow 3.3.1 milestone Jun 25, 2026
@jason810496
jason810496 merged commit 7dd84f3 into apache:main Jun 25, 2026
77 checks passed
karenbraganz pushed a commit to karenbraganz/airflow that referenced this pull request Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants