Skip to content

Fix async engine datetimes being shifted on non-UTC MySQL servers - #76505

Merged
vatsrahul1001 merged 1 commit into
apache:mainfrom
jason810496:fix/db/async-engine-event-handlers
Nov 5, 2026
Merged

vatsrahul1001 merged 1 commit into
apache:mainfrom
jason810496:fix/db/async-engine-event-handlers

Conversation

@jason810496

Copy link
Copy Markdown
Member

related: #76416 (comment)

The async engine skipped the connection setup the sync engine gets, so its MySQL sessions use the server time zone and every datetime it writes or reads is shifted by the server's UTC offset. On a +08:00 MySQL 8 server, task heartbeats (async since #67800) and audit log rows (#76416) are stored 8h early. This also turns on SQLite foreign keys for async connections, matching the sync engine. To be backported to v3-4-test.


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

Generated-by: Claude Code (Opus 5.5) following the guidelines

@jason810496 jason810496 added backport-to-v3-4-test Backport to v3-4-test area:API Airflow's REST/HTTP API labels Nov 5, 2026
@jason810496 jason810496 added this to the Airflow 3.4.0 milestone Nov 5, 2026
@jason810496 jason810496 self-assigned this Nov 5, 2026
@jason810496
jason810496 marked this pull request as ready for review November 5, 2026 02:37
@jason810496
jason810496 requested review from kaxil, pierrejeambrun and vatsrahul1001 and removed request for vatsrahul1001 November 5, 2026 02:37
The async engine skipped the connection setup the sync engine gets, so its
MySQL sessions kept the server time zone and stored task heartbeats and audit
log rows shifted by the server's UTC offset.
@jason810496
jason810496 force-pushed the fix/db/async-engine-event-handlers branch from 62efed6 to fdb4648 Compare November 5, 2026 02:42
@vatsrahul1001
vatsrahul1001 enabled auto-merge (squash) November 5, 2026 02:58
@vatsrahul1001
vatsrahul1001 merged commit 494f65e into apache:main Nov 5, 2026
71 checks passed
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-4-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-4-test PR Link

github-actions Bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Nov 5, 2026
… servers (apache#76505)

The async engine skipped the connection setup the sync engine gets, so its
MySQL sessions kept the server time zone and stored task heartbeats and audit
log rows shifted by the server's UTC offset.
(cherry picked from commit 494f65e)

Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com>
aws-airflow-bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Nov 5, 2026
… servers (apache#76505)

The async engine skipped the connection setup the sync engine gets, so its
MySQL sessions kept the server time zone and stored task heartbeats and audit
log rows shifted by the server's UTC offset.
(cherry picked from commit 494f65e)

Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com>
@jason810496
jason810496 deleted the fix/db/async-engine-event-handlers branch November 5, 2026 05:12
vatsrahul1001 pushed a commit that referenced this pull request Nov 5, 2026
… servers (#76505) (#76517)

The async engine skipped the connection setup the sync engine gets, so its
MySQL sessions kept the server time zone and stored task heartbeats and audit
log rows shifted by the server's UTC offset.
(cherry picked from commit 494f65e)
vatsrahul1001 pushed a commit that referenced this pull request Nov 5, 2026
… servers (#76505) (#76517)

The async engine skipped the connection setup the sync engine gets, so its
MySQL sessions kept the server time zone and stored task heartbeats and audit
log rows shifted by the server's UTC offset.
(cherry picked from commit 494f65e)
vatsrahul1001 pushed a commit that referenced this pull request Nov 5, 2026
… servers (#76505) (#76517)

The async engine skipped the connection setup the sync engine gets, so its
MySQL sessions kept the server time zone and stored task heartbeats and audit
log rows shifted by the server's UTC offset.
(cherry picked from commit 494f65e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API backport-to-v3-4-test Backport to v3-4-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants