Add deferrable mode to AzureContainerInstancesOperator#62772
Open
cruseakshay wants to merge 3 commits intoapache:mainfrom
Open
Add deferrable mode to AzureContainerInstancesOperator#62772cruseakshay wants to merge 3 commits intoapache:mainfrom
cruseakshay wants to merge 3 commits intoapache:mainfrom
Conversation
2 tasks
nailo2c
reviewed
Mar 3, 2026
| Raises an AirflowException on failure; returns the exit code on success. | ||
| """ | ||
| if event is None: | ||
| raise AirflowException("Trigger error: event is None") |
Contributor
There was a problem hiding this comment.
Thanks for implementing this!
Nit: per the contributing guide, we avoid raising AirflowException directly. Could you raise a built-in exception here instead? https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#dont-raise-airflowexception-directly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add
deferrable=Truesupport toAzureContainerInstancesOperatorsotasks release their worker slot while waiting for long-running containers,
offloading polling to the lightweight Triggerer process.
Changes
New
AzureContainerInstanceAsyncHook— async counterpart to theexisting sync hook, using
azure.mgmt.containerinstance.aiofornon-blocking state/log/delete calls.
New
AzureContainerInstanceTrigger— polls ACI at a configurableinterval and yields a
TriggerEventwhen the container reaches aterminal state.
AzureContainerInstancesOperator— three new parameters:deferrable(default fromconf) — enables deferrable modepolling_interval(default5.0s) — trigger poll frequencyremove_on_success(defaultTrue) — controls cleanup on successfinallycleanup block would delete astill-running container group immediately after
self.defer()raisedTaskDeferred.provider.yaml+get_provider_info.pyupdated to register thenew trigger.
closes: #62433
Was generative AI tooling used to co-author this PR?