David Martin Calalang
07/16/2025, 5:23 PMMarvin
07/16/2025, 5:23 PMMarvin
07/16/2025, 5:24 PMpython
from prefect import flow, task
from prefect_aws.ecs import ECSTask
import time
@task
def simple_task(x):
# Add logging to track execution
print(f"Starting to process {x}")
time.sleep(1) # Add small delay to ensure it's not instant
print(f"Finished processing {x}")
return x * x
@flow
def test_flow():
results = []
for i in range(5):
results.append(simple_task.submit(i))
return [r.result() for r in results]
if __name__ == "__main__":
test_flow()
If this simple flow also stalls, it would indicate an infrastructure issue rather than a problem with your specific task code.
Would you be able to:
1. Try running this simple test flow?
2. Share any error messages you see in the CloudWatch logs?
3. Confirm if you can see the print statements in your logs?
This would help us narrow down whether it's a configuration issue or a problem with the task execution itself.
Also, it might be worth considering if Fargate is the best choice for your use case. While Fargate offers simplified container management, it does come with longer setup times and potentially more complex networking configurations. If you're experiencing consistent issues, you might want to consider using EC2 instead, which typically provides more predictable performance and faster startup times.