-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deferrable support for HttpOperator #45228
Deferrable support for HttpOperator #45228
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
5daaacd
to
b4d0b88
Compare
@Lee-W Thank you for reviewing! I will resume work on this matter from January 6th, so please wait for two days. |
@Lee-W I've made modifications according to your review! Please check again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, sorry for taking so long. Thanks for your contribution! Everything looks good and we're in a good shape to merge. I'll keep it open for 1 or 2 days so that others can check as well. Please ping me again if I forget to merge it. Thanks!
The CI seems weird 🤔 let me rebase and see how it works |
052b6b2
to
470678d
Compare
Thank you! |
Opps, I notice there's a static check error. Should be a quick fix. 🙂 |
Co-authored-by: Wei Lee <[email protected]>
Co-authored-by: Wei Lee <[email protected]>
470678d
to
9c83c8a
Compare
i did rebase and work on the quick fix! |
@Lee-W Corrections have been made concerning the linter! Please check. |
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Enabling deferrable for HttpOperator causes an error.
The minimum test case is as follows
For connections, set Connection Id to “google_http_default”, Connection Type to “HTTP” and HOST to “https://www.google.com”.
If you place it in airflow/files/dags/ and run it you will get the following error
Causes:.
https://github.com/apache/airflow/blob/9178f8f0b1ffd80b8eacf4d02b732528fde218e5/providers/src/airflow/providers/http/triggers/http .py#L97
A session object is created by the above caller.
It is at the following link
https://github.com/apache/airflow/blob/9178f8f0b1ffd80b8eacf4d02b732528fde218e5/providers/src/airflow/providers/http/hooks/http.py #L413
The following is then called.
https://github.com/apache/airflow/blob/9178f8f0b1ffd80b8eacf4d02b732528fde218e5/providers/src/airflow/providers/http/triggers/http .py#L103
https://github.com/apache/airflow/blob/9178f8f0b1ffd80b8eacf4d02b732528fde218e5/providers/src/airflow/providers/http/triggers/http .py#L117
It is expected that the ClientSession is alive at this point, but it is already out of scope and disconnected.
To properly correct this, we changed the configuration to the following Previously, the opposite was the case, which caused the bug.
Correct.
ClientSession scope {
ClientResponse scope{
response.read
}
}
Incorrect
ClientResponse scope {
ClientSession scope {
}
response.read expect session living (error)
}
With the interface changes, we modified the required tests, re-ran the required tests, and verified that they completed successfully. I would be happy to check and review! Best regards.
Takayuki Tanabe
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.