Skip to content

Fix Comprehend document classifier timing out after 20 minutes - #71969

Open
ramitkataria wants to merge 2 commits into
apache:mainfrom
aws-mwaa:ramitkataria/fix-comprehend-classifier-waiter-defaults
Open

Fix Comprehend document classifier timing out after 20 minutes#71969
ramitkataria wants to merge 2 commits into
apache:mainfrom
aws-mwaa:ramitkataria/fix-comprehend-classifier-waiter-defaults

Conversation

@ramitkataria

@ramitkataria ramitkataria commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Classifier training routinely takes 8 to 20+ minutes, but the operator's default waiter budget was 20 x 60s in both sync and deferrable paths, a cap the training time regularly exceeded. Double it to 40 x 60s. (The companion sensor and trigger allow 75 x 120s, but jumping the operator's implicit wait to 150 minutes would block Dag runs unexpectedly long, so they are intentionally left as is.) This also lets the system test Dag drop its wait_for_completion=False workaround, so the test exercises the operator's default wait path.


Was generative AI tooling used to co-author this PR?
  • Yes (Claude Fable 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.

Classifier training routinely takes 8 to 20+ minutes, but the operator's
default waiter budget was 20 x 60s in both sync and deferrable paths, while
its trigger and companion sensor default to 75 x 120s; align the operator
with them. This also lets the system test Dag drop its
wait_for_completion=False workaround, so the test exercises the operator's
default wait path.
@boring-cyborg boring-cyborg Bot added area:providers provider:amazon AWS/Amazon - related issues labels Aug 21, 2026

@o-nikolas o-nikolas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One could argue that this is a breaking change since the operator will now exhibit a different behaviour than before (Dags may take longer than they usually do). But I think this fits as bug fix since before the timeout needed to be increased otherwise the operation wouldn't have succeeded anyway, which is the ultimate goal.

wait_for_completion: bool = True,
waiter_delay: int = 60,
waiter_max_attempts: int = 20,
waiter_delay: int = 120,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having the delay be 60 was convenient for reasoning about the total number of minutes, so I'd maybe keep it configured to 60 here. Also, 60*75 leads to a MUCH bigger timeout than before, going from 20m to well over 2 hours. I think that is too big of a jump. Dag runs will be blocked for a long long time unexpectedly as a result.

Maybe double the existing total timeout? so waiter_delay=60 and waiter_max_attempts=40?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sensor and trigger are at 75 × 120s and there was 1 run in the last month where the sensor waited for 44 mins. So maybe 50 or 60 mins? Either way, I guess we're leaving the sensor without any changes because that would be an unnecessary breaking change, right?

@eladkal

eladkal commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

One could argue that this is a breaking change since the operator will now exhibit a different behaviour than before (Dags may take longer than they usually do). But I think this fits as bug fix since before the timeout needed to be increased otherwise the operation wouldn't have succeeded anyway, which is the ultimate goal.

That merits a warning note at the top of the changelog so can be added to the bugfix release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:amazon AWS/Amazon - related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants