Fix deferrable HttpSensor: HttpAsyncHook falls back to https when port == 443 #52585
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related: #52319
Why
HttpSensor
in deferrable mode fails after the task is resumed by the Triggerer: the schema field is missing, soHttpAsyncHook
silently downgradeshttps://host
tohttp://host
.airflow/providers/http/src/airflow/providers/http/hooks/http.py
Line 465 in eac9a92
The root cause seems to be here. I guess Triggerer fetches the connection from the metadata DB on the first run and then serves subsequent requests from its cache. However, cache no longer contains
schema_
in3.0.0
somehow. In2.11.0
the same DAG still works.(The explanation above is my current understanding based on quick code-reading and logs. If I've misinterpreted how the Triggerer caches connections, please feel free to correct me, feedback is very welcome 😄)
airflow/task-sdk/src/airflow/sdk/execution_time/context.py
Line 155 in d3a33da
The example DAG in the issue works as expected on 2.11.0 but not on 3.0.0. Here is how the DAG runs on 2.11.0:

How
conn.port
is still present in every run, so fall back tohttps
whenport == 443
.Investigate why
schema_
disappears in the Triggerer cache, maybe open a follow-up issue if needed.What
With this patch the OP’s example DAG now uses

https
.