Skip to content

Make HttpSensor defer when response_check is provided - #74434

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

yuseok89 wants to merge 4 commits 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
@yuseok89
yuseok89 marked this pull request as draft November 5, 2026 07:25
@yuseok89
yuseok89 marked this pull request as ready for review November 8, 2026 13:50
@github-actions github-actions Bot added the fork ci required Gated by AIP-120: CI must pass in the contributor's fork. Managed by the fork CI reconciler. label Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Fork CI: green. CI for the latest commit passed in your fork. The pull request is ready for maintainer review.

Pull requests from contributors run their CI in the contributor's own fork. GitHub Actions is free and has no minute limit on public forks, while the CI capacity of the Apache Software Foundation is shared by every ASF project and is finite.

Fork CI tested this branch merged with main at 2cf9195e03, as project CI would, 4 commits behind main when the run turned green.

Latest run: https://github.com/yuseok89/airflow/actions/runs/44638812688

How this works: CI in your fork.


This comment was posted automatically by the fork CI monitor from templates drafted with an AI-assisted tool, so it may contain mistakes. An Apache Airflow maintainer, a real person, will review the pull request once its fork CI is green. Why the first pass is automated.

@github-actions github-actions Bot added the ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. label Nov 8, 2026
@yuseok89
yuseok89 marked this pull request as draft November 8, 2026 14:50
@github-actions github-actions Bot removed the ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. label Nov 10, 2026
@yuseok89
yuseok89 marked this pull request as ready for review November 19, 2026 13:32
@github-actions github-actions Bot added the ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. label Nov 19, 2026
…sensor-response-check-v2

# Conflicts:
#	providers/http/src/airflow/providers/http/sensors/http.py
@github-actions github-actions Bot added ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. and removed ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. labels Nov 19, 2026

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

Labels

area:providers fork ci required Gated by AIP-120: CI must pass in the contributor's fork. Managed by the fork CI reconciler. provider:http ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green.

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