Skip to content

[v3-2-test] Add fast-path heartbeat UPDATE to avoid row lock in the common case (#65029)#65137

Merged
vatsrahul1001 merged 2 commits intov3-2-testfrom
backport-c97d1a5-v3-2-test
Apr 15, 2026
Merged

[v3-2-test] Add fast-path heartbeat UPDATE to avoid row lock in the common case (#65029)#65137
vatsrahul1001 merged 2 commits intov3-2-testfrom
backport-c97d1a5-v3-2-test

Conversation

@github-actions
Copy link
Copy Markdown

  • Add fast-path heartbeat UPDATE to avoid row lock in the common case

The ti_heartbeat endpoint now attempts a single guarded UPDATE
(matching id, state, hostname, and pid) before falling back to the
existing SELECT FOR UPDATE path. When the task is still running on
the expected host this returns immediately, eliminating the row lock
and a round trip for the vast majority of heartbeat calls.

  • fixup! Add fast-path heartbeat UPDATE to avoid row lock in the common case

  • Apply suggestions from code review

Co-authored-by: Copilot 175728472+Copilot@users.noreply.github.com

  • Fix static checks

  • fixup! Fix static checks


(cherry picked from commit c97d1a5)

Co-authored-by: Ephraim Anierobi splendidzigy24@gmail.com
Co-authored-by: Copilot 175728472+Copilot@users.noreply.github.com

@boring-cyborg boring-cyborg bot added area:API Airflow's REST/HTTP API area:task-sdk labels Apr 13, 2026
@eladkal eladkal marked this pull request as ready for review April 13, 2026 16:48
@ephraimbuddy ephraimbuddy force-pushed the backport-c97d1a5-v3-2-test branch 2 times, most recently from a9db9fd to 9351f72 Compare April 14, 2026 15:00
…ommon case (#65029)

* Add fast-path heartbeat UPDATE to avoid row lock in the common case

The ti_heartbeat endpoint now attempts a single guarded UPDATE
(matching id, state, hostname, and pid) before falling back to the
existing SELECT FOR UPDATE path. When the task is still running on
the expected host this returns immediately, eliminating the row lock
and a round trip for the vast majority of heartbeat calls.

* fixup! Add fast-path heartbeat UPDATE to avoid row lock in the common case

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix static checks

* fixup! Fix static checks

---------
(cherry picked from commit c97d1a5)

Co-authored-by: Ephraim Anierobi <splendidzigy24@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ephraimbuddy ephraimbuddy force-pushed the backport-c97d1a5-v3-2-test branch from 9351f72 to cf59b7c Compare April 14, 2026 21:08
@vatsrahul1001 vatsrahul1001 merged commit 8ef216c into v3-2-test Apr 15, 2026
111 checks passed
@vatsrahul1001 vatsrahul1001 deleted the backport-c97d1a5-v3-2-test branch April 15, 2026 05:27
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 area:task-sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants