Yanislava commented on PR #77242:
URL: https://github.com/apache/airflow/pull/77242#issuecomment-7192032226

   I went through the review of the earlier attempt at this sensor, #73986 
(closed as stale), and checked each point against this PR. Fixed in Commit
   
[67c17f3](https://github.com/Yanislava/airflow/commit/67c17f38641038fd13b4c67b382d29d505baa8e0):
   Batch endpoints (audit log rows, ~ authorization): DAG runs are now read 
with GET dags/{dag_id}/dagRuns on both API versions, and Airflow 3 task 
instances with GET dags/{dag_id}/dagRuns/~/taskInstances?task_id=…, one call 
per task id. Missing read access now fails the task with a 403 instead of 
looking like "no run yet", and polling writes no audit log rows on the remote. 
Airflow 2 keeps POST dags/~/dagRuns/~/taskInstances/list: its GET has no 
task_id filter, and the batch endpoint there answers 403 for an unreadable DAG 
and is not action-logged.
   Retries: the HttpHook gets an HTTPAdapter with Retry(total=3, 
backoff_factor=1, status_forcelist=(429, 500, 502, 503, 504), 
allowed_methods=None), so connection resets, read timeouts, 429 and 5xx are 
retried, POSTs included, and Retry-After is honoured. After that, 429/5xx raise 
RemoteAirflowApiUnavailableException (task retries apply), other 4xx 
AirflowFailException.
   Timeouts: every request has one, timeout from the connection extra or 60 s 
by default.
   Private ExternalTaskSensor helpers as an extension contract: this sensor 
reuses only _get_dttm_filter, _handle_failed_states and _handle_skipped_states 
(all present since standard 1.0.0) and overrides poke/execute itself. It does 
not depend on new seams in standard, so an older standard cannot make it poll 
the local DB. To make a rename in standard fail loudly, the module now checks 
at import time that these helpers exist and raises 
AirflowOptionalProviderFeatureException pointing at 
apache-airflow-providers-http[standard]; there is a test for it.
   Already covered or not applicable here:
   Silent local polling with an old standard: execute calls 
BaseSensorOperator.execute directly, so the parent's deferrable branch (which 
reads the local DB) is never reached. Deferrable mode is not offered: 
deferrable=True warns and runs as a regular sensor.
   Task group filter version, run_ids in the trigger, sync_to_async in the 
triggerer: this PR has no trigger and no task group support yet.
   Tests that do not pin the arguments: the tests assert the full query or body 
of each request (states, dates, task ids, paging), so dropping allowed_states 
or a date filter fails them.
   Fork CI is green again: 
https://github.com/Yanislava/airflow/actions/runs/45810621186.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to