Skip to content

[v3-2-test] fix(scheduler): catch StaleDataError in verify_integrity to prevent scheduler crash (#64503)#66727

Merged
potiuk merged 1 commit into
v3-2-testfrom
backport-dcfa271-v3-2-test
May 12, 2026
Merged

[v3-2-test] fix(scheduler): catch StaleDataError in verify_integrity to prevent scheduler crash (#64503)#66727
potiuk merged 1 commit into
v3-2-testfrom
backport-dcfa271-v3-2-test

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Closes #63926

StaleDataError raised by SQLAlchemy's optimistic locking when a concurrent
session modifies the same row can cause the scheduler to crash during
verify_integrity. Fix by catching StaleDataError alongside IntegrityError
in dagrun.verify_integrity() and adding it to the retry exceptions in
run_with_db_retries()/retry_db_transaction() so the operation is retried
automatically.
(cherry picked from commit dcfa271)

Co-authored-by: Pradeep Kalluri 128097794+kalluripradeep@users.noreply.github.com

…to prevent scheduler crash (#64503)

Closes #63926

StaleDataError raised by SQLAlchemy's optimistic locking when a concurrent
session modifies the same row can cause the scheduler to crash during
verify_integrity. Fix by catching StaleDataError alongside IntegrityError
in dagrun.verify_integrity() and adding it to the retry exceptions in
run_with_db_retries()/retry_db_transaction() so the operation is retried
automatically.
(cherry picked from commit dcfa271)

Co-authored-by: Pradeep Kalluri <128097794+kalluripradeep@users.noreply.github.com>
@potiuk potiuk force-pushed the backport-dcfa271-v3-2-test branch from e5762a4 to fc8f2a2 Compare May 12, 2026 01:38
@potiuk potiuk merged commit 1ff7aac into v3-2-test May 12, 2026
110 checks passed
@potiuk potiuk deleted the backport-dcfa271-v3-2-test branch May 12, 2026 03:10
@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.2.2 milestone May 18, 2026
@vatsrahul1001 vatsrahul1001 added the type:bug-fix Changelog: Bug Fixes label May 18, 2026
vatsrahul1001 pushed a commit that referenced this pull request May 20, 2026
…to prevent scheduler crash (#64503) (#66727)

Closes #63926

StaleDataError raised by SQLAlchemy's optimistic locking when a concurrent
session modifies the same row can cause the scheduler to crash during
verify_integrity. Fix by catching StaleDataError alongside IntegrityError
in dagrun.verify_integrity() and adding it to the retry exceptions in
run_with_db_retries()/retry_db_transaction() so the operation is retried
automatically.
(cherry picked from commit dcfa271)

Co-authored-by: Pradeep Kalluri <128097794+kalluripradeep@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants