Skip to content

fix: errors while trying to stop queue fleet associations that are already stopped/ing#194

Merged
lucaseck merged 1 commit intoaws-deadline:mainlinefrom
lucaseck:fix_qfa_stopping
Jun 16, 2025
Merged

fix: errors while trying to stop queue fleet associations that are already stopped/ing#194
lucaseck merged 1 commit intoaws-deadline:mainlinefrom
lucaseck:fix_qfa_stopping

Conversation

@lucaseck
Copy link
Contributor

@lucaseck lucaseck commented Jun 16, 2025

What was the problem/requirement? (What/Why)

If a qfa is already set to STOP_SCHEDULING_AND_CANCEL_TASKS or STOPPED then trying to stop it again results in an uncaught exception like:

An error occurred (ConflictException) when calling the UpdateQueueFleetAssociation operation: Request could not be completed. Status STOP_SCHEDULING_AND_CANCEL_TASKS of resource queue-xxxxxxxxxxxxxxxxxxxxxxxxxx/fleet-xxxxxxxxxxxxxxxxxxxxxxxxxxx does not permit the operation. The valid statuses are [ACTIVE]

What was the solution? (How)

  • Add a check that the qfa is in ACTIVE in which case either of the stop options are valid. Add an additional check that if that status is STOP_SCHEDULING_AND_COMPLETE_TASKS that is a valid state to then set to STOP_SCHEDULING_AND_CANCEL_TASKS as well
  • Renamed STOP_SCHEDULING_AND_FINISH_TASKS to STOP_SCHEDULING_AND_COMPLETE_TASKS because that is what it's actually called in the API...
    • If you try to provide STOP_SCHEDULING_AND_FINISH_TASKS you'll get a validation error :
         An error occurred (ValidationException) when calling the UpdateQueueFleetAssociation operation: [instance value ("STOP_SCHEDULING_AND_FINISH_TASKS") not found in enum (possible values: ["ACTIVE","STOP_SCHEDULING_AND_COMPLETE_TASKS","STOP_SCHEDULING_AND_CANCEL_TASKS"])]
      

What is the impact of this change?

  • Tests relying on these fixtures should be more reliable and you can actually set the association to wait for tasks to complete now

How was this change tested?

  • Ran existing unit tests and created new ones
  • Ran some tests of QFA deletion and stopping in my own account

Was this change documented?

No

Is this a breaking change?

It may look like one, but I've decided not to make it one since the changes that look breaking are actually fixing things by changing STOP_SCHEDULING_AND_FINISH_TASKS to STOP_SCHEDULING_AND_COMPLETE_TASKS which as-is does not work at all.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…ready stopped/ing

Signed-off-by: lucaseck <117225985+lucaseck@users.noreply.github.com>
@lucaseck lucaseck requested a review from a team as a code owner June 16, 2025 15:58
@sonarqubecloud
Copy link

@lucaseck lucaseck merged commit 76540f4 into aws-deadline:mainline Jun 16, 2025
16 checks passed
@lucaseck lucaseck deleted the fix_qfa_stopping branch June 16, 2025 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants