Skip to content

Make HttpSensor defer when response_check is provided - #74434

Open
yuseok89 wants to merge 1 commit into
apache:mainfrom
yuseok89:fix-deferrable-httpsensor-response-check-v2
Open

yuseok89 wants to merge 1 commit into
apache:mainfrom
yuseok89:fix-deferrable-httpsensor-response-check-v2

Conversation

@yuseok89

@yuseok89 yuseok89 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

closes: #40209
related: #71922

HttpSensor(deferrable=True) with a response_check falls back to the synchronous poke loop and holds a worker slot for the whole wait. It now defers, and the check runs on the worker after the trigger returns. If the check returns False, the task defers again.

Unlike #44557 and #47719, nothing is pickled and the callable never leaves the worker. The trigger returns the response through the existing JSON-based HttpResponseSerializer, and re-deferring follows S3KeySensor with check_fn.

HttpSensorTrigger gets an initial_delay so that a re-deferred trigger waits poke_interval before its first request. Each deferral also passes the remaining sensor timeout, so timeout still applies overall.

Verified with a live Dag

An HttpSensor(deferrable=True, poke_interval=20) with a response_check that passes two minutes after the run starts. Before the change the task stayed running. After the change it defers, rechecks every 20 seconds, and succeeds once the check passes.

image
Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)
    • Claude Code (Opus 5.5)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@yuseok89
yuseok89 marked this pull request as ready for review October 8, 2026 04:06

This branch has not been deployed

No deployments
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.

Deferrable HttpSensor does not move to Triggerer when using response_check

1 participant