Skip to content

Fix: handle cross-event-loop RuntimeError in ExecutionAPISecretsBackend#64238

Open
abhijeets25012-tech wants to merge 1 commit intoapache:mainfrom
abhijeets25012-tech:fix-triggerer-aws-connection-runtimeerror
Open

Fix: handle cross-event-loop RuntimeError in ExecutionAPISecretsBackend#64238
abhijeets25012-tech wants to merge 1 commit intoapache:mainfrom
abhijeets25012-tech:fix-triggerer-aws-connection-runtimeerror

Conversation

@abhijeets25012-tech
Copy link
Contributor

What happened

In triggerer context, ExecutionAPISecretsBackend.get_connection() may fail when
TriggerCommsDecoder.send() raises a RuntimeError with message:

"Future attached to a different loop"

Currently, only the AsyncToSync RuntimeError is handled. Other RuntimeError variants
fall through and return None, causing the connection lookup to silently fail.

This leads to incorrect behavior in deferrable operators (e.g. AWS hooks),
where the connection appears missing and falls back to default credentials.

What is fixed

Extended RuntimeError handling to also cover the "attached to a different loop"
case and fallback to async connection retrieval using greenback.await_.

Why this is safe

  • Maintains existing fallback behavior (return None)
  • Only extends handling for an additional RuntimeError variant
  • No change to behavior outside this edge case

Reproduction

Deferrable AWS hooks (e.g. S3KeySensor) in triggerer context fail to resolve
connections and log "Unable to find AWS Connection ID" due to this issue.

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.

1 participant