I am using ECSAgent and sometimes I get an error that says "An error occurred (ClientException) when calling the RegisterTaskDefinition operation: Too many concurrent attempts to create a new revision of the specified family."

I am running around 80 flows that all run every minute.
I am planning to run more flows, maybe in 100s and all of them running per minute. Am I using Prefect incorrectly and can it handle this scale?

I checked out this link from the docs - ECS Agent | Prefect Docs. I am already running the ECS agent with the specified options for retry mode but these errors still happen. Is there any way to fix this? I don’t really need Prefect to create new task definitions on every flow run, can I disable that behaviour? I am also using a custom task definition, could it be because of that?

Great that you found this documentation page!

  1. Based on this issue, another user set it to 100 and it helped in their case
  2. If you don’t need to create a new task definition on each run, you can provide an explicit task definition ARN to your ECSRun - this way, the agent won’t register a new one at each run. Here’s agent code that confirms that: prefect/agent.py at master · PrefectHQ/prefect · GitHub