Skip to content

Handle triggerer cross-loop connection fallback (#64213)#64282

Closed
deepujain wants to merge 1 commit intoapache:mainfrom
deepujain:fix-64213-triggerer-aws-conn-loop
Closed

Handle triggerer cross-loop connection fallback (#64213)#64282
deepujain wants to merge 1 commit intoapache:mainfrom
deepujain:fix-64213-triggerer-aws-conn-loop

Conversation

@deepujain
Copy link
Copy Markdown
Contributor

Title: Handle triggerer cross-loop connection RuntimeError in Task SDK (#64213)

Summary

The Task SDK connection backend now treats the triggerer worker-thread cross-loop RuntimeError the same way it already treats the existing AsyncToSync event-loop error, so deferrable AWS hooks can keep resolving connections instead of silently falling back to empty credentials.

Changes

  • task-sdk/src/airflow/sdk/execution_time/secrets/execution_api.py -- broadened the greenback fallback gate to recognize the cross-loop Future attached to a different loop error in addition to the existing AsyncToSync event-loop message.
  • task-sdk/tests/task_sdk/execution_time/test_secrets.py -- extended the regression test to cover both runtime-error variants and verify the greenback fallback still returns the expected connection.

Test plan

  • uv run --project task-sdk ruff check task-sdk/src/airflow/sdk/execution_time/secrets/execution_api.py task-sdk/tests/task_sdk/execution_time/test_secrets.py
  • uv run --project task-sdk ruff format --check task-sdk/src/airflow/sdk/execution_time/secrets/execution_api.py task-sdk/tests/task_sdk/execution_time/test_secrets.py
  • uv run --project task-sdk pytest task-sdk/tests/task_sdk/execution_time/test_secrets.py -xvs

Fixes #64213

@deepujain
Copy link
Copy Markdown
Contributor Author

Pushed a targeted Task SDK fix for the triggerer cross-loop RuntimeError path, plus regression coverage for both RuntimeError variants. Ruff checks and the focused task-sdk/tests/task_sdk/execution_time/test_secrets.py run passed locally.

@deepujain
Copy link
Copy Markdown
Contributor Author

duplicate of #64238.

@deepujain deepujain closed this Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

amazon provider: deferrable AWS hook in triggerer can lose connection when TriggerCommsDecoder.send() hits cross-loop RuntimeError

1 participant