Skip to content

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

Open
github-actions[bot] wants to merge 1 commit intov3-2-testfrom
backport-c97d1a5-v3-2-test
Open

[v3-2-test] Add fast-path heartbeat UPDATE to avoid row lock in the common case (#65029)#65137
github-actions[bot] wants to merge 1 commit 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

…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>
@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
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.

1 participant