`_cleanup_stale_resources()` deregisters unrelated ECS task definitions
See original GitHub issueWe observe that Dask Cloud Provider deregisters ECS task definitions that it did not create. This screenshot shows task definitions that:
- Dask Cloud Provider did not create
- Do not get marked as INACTIVE (i.e. unregistered) when Dask Cloud Provider hasn’t been run
We haven’t fully characterized this, but it appears that the current version of _cleanup_stale_resources()
is too aggressive in its de-registering of task definitions.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Deregistering a task definition revision - AWS Documentation
When you deregister a task definition revision, it's immediately marked as INACTIVE . Existing tasks and services that reference an INACTIVE task definition...
Read more >How do you delete an AWS ECS Task Definition?
Once all versions are deregistered (inactive), the Task Definition itself will also be deregistered but it and all inactive versions remain.
Read more >Cleanup the ECS cluster - AWS App Mesh Workshop
Cleanup the ECS cluster. Delete the services running in your cluster. # Define variables # CLUSTER_NAME=$(jq < cfn-output.json -r '.
Read more >Uninstall the ECS integration | New Relic Documentation
Manual uninstall · Delete the services: aws ecs delete-service --service "newrelic-infra" --cluster " YOUR_CLUSTER_NAME ". Copy · List the task definition for the ......
Read more >class ECS. Client - Boto3 Docs 1.26.34 documentation
When you add, update, or remove the service registries configuration, Amazon ECS starts a new deployment. New tasks are registered and deregistered to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jacobtomlinson
This bit a user of dask-cloudprovider at my company. I don’t think the tags on task definitions are being checked in the same way that they are on clusters.
from: https://github.com/dask/dask-cloudprovider/blob/64aad0b702a9aa309d0de22b568a58e0199e711c/dask_cloudprovider/providers/aws/ecs.py#L1258-L1274
It looks like any task without a tag for “cluster” (line 1265) matches line 1269 and gets deregistered. If all that’s supposed to happen is checking for tasks tagged with a cluster not in the active list, then it’s a pretty easy local fix right in that code block to flip the None check and or. I assume it’s supposed to be checking for the
DEAFULT_TAGS
as well?@jacobtomlinson @martindurant I have an open PR for this when you have a chance to review.