Skip to content

Include DMS stop reason in DmsTaskBaseSensor failure message - #75240

Merged
vincbeck merged 1 commit into
apache:mainfrom
aws-mwaa:onikolas/dms-sensor-stop-reason
Oct 21, 2026
Merged

vincbeck merged 1 commit into
apache:mainfrom
aws-mwaa:onikolas/dms-sensor-stop-reason

Conversation

@o-nikolas

Copy link
Copy Markdown
Contributor

When a replication task reached a termination status the sensor only reported the status name ("Unexpected status: stopped"), even though the DescribeReplicationTasks response it already reads on every poke carries StopReason and LastFailureMessage. Once the task is deleted (e.g. by a teardown task) that information is gone, so a task that stopped unexpectedly could not be diagnosed after the fact.

Status and reason are read from the same describe call so they always describe the same snapshot, and the number of API calls per poke stays the same.


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

  • 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.

When a replication task reached a termination status the sensor only
reported the status name ("Unexpected status: stopped"), even though the
DescribeReplicationTasks response it already reads on every poke carries
StopReason and LastFailureMessage. Once the task is deleted (e.g. by a
teardown task) that information is gone, so a task that stopped
unexpectedly could not be diagnosed after the fact.

Status and reason are read from the same describe call so they always
describe the same snapshot, and the number of API calls per poke stays
the same.
@boring-cyborg boring-cyborg Bot added area:providers provider:amazon AWS/Amazon - related issues labels Oct 20, 2026

@seanghaeli seanghaeli 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.

Looks good. Small thing I noticed when I was testing around with DMS last week is that often StopReason and LastFailureMessage are identical. Could be worth a quick guard to only show one if they match?

@vincbeck
vincbeck merged commit 4fb12b3 into apache:main Oct 21, 2026
70 of 71 checks passed
@vincbeck
vincbeck deleted the onikolas/dms-sensor-stop-reason branch October 21, 2026 13:49
ramitkataria added a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Nov 3, 2026
The example_dms system test intermittently fails in await_task_start
because DMS stops the replication task a few seconds after starting it,
before it reaches the running state. The StopReason added to the sensor
failure message in apache#75240 only said "Stop Reason NORMAL", with no
failure message, so the DMS API does not explain the stop. The DMS task
logs are the next place to look.

Copying the task logs into the Airflow task log puts them next to the
rest of the system test output, and deleting the log group afterwards
keeps the hourly runs from leaving one behind each time.
o-nikolas pushed a commit that referenced this pull request Nov 3, 2026
The example_dms system test intermittently fails in await_task_start
because DMS stops the replication task a few seconds after starting it,
before it reaches the running state. The StopReason added to the sensor
failure message in #75240 only said "Stop Reason NORMAL", with no
failure message, so the DMS API does not explain the stop. The DMS task
logs are the next place to look.

Copying the task logs into the Airflow task log puts them next to the
rest of the system test output, and deleting the log group afterwards
keeps the hourly runs from leaving one behind each time.
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.

4 participants