Repository navigation
Include DMS stop reason in DmsTaskBaseSensor failure message - #75240
Merged
Merged
Conversation
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.
seanghaeli
approved these changes
Oct 20, 2026
seanghaeli
left a comment
Contributor
There was a problem hiding this comment.
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?
eladkal
approved these changes
Oct 21, 2026
vincbeck
approved these changes
Oct 21, 2026
28 of 93 tasks
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.
1 task done
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.
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.
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?
{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.