<@ULVA73B9P> why are my flows stuck in pending the...
# ask-marvin
a
@Marvin why are my flows stuck in pending then eventually crash. i have a global concurrency of 6 and there are only 2 other flows running
m
thought for 50.4 seconds
Based on your description and the research, there are several potential causes for your flows getting stuck in pending and eventually crashing. Let me outline the most likely issues and their solutions: 1. Task Submission Without Waiting - This is a common issue in Prefect 3.x where tasks are submitted but not properly waited for - If you're using
.submit()
or
.map()
, make sure to call
.wait()
or
.result()
on the returned futures - Example of correct usage:
Copy code
python
   @flow
   def my_flow():
       future = my_task.submit()
       # Make sure to wait for the result
       result = future.wait()  # or future.result()
2. Infrastructure Issues - Check if your worker/agent is running and properly connected - Verify that your infrastructure (Docker, Kubernetes, etc.) has enough resources - Look for any authentication or connectivity issues in your logs 3. Concurrency Configuration - While you have a global concurrency limit of 6 and only 2 flows running, check: - Work queue concurrency limits (these can override global limits) - Task runner concurrency settings - Infrastructure-specific limits (e.g., Docker container limits) To diagnose the issue: 1. Check your flow logs for any error messages, particularly: - "A future was garbage collected before it resolved" - Authentication or connection errors - Import or dependency errors 2. Verify your deployment configuration: - Ensure all required dependencies are included - Check that your infrastructure block is properly configured - Confirm your work queue settings Would you be able to share: 1. A simplified version of your flow code? 2. The deployment method you're using? 3. Any error messages from the logs? This would help me provide more specific guidance for your situation. Relevant documentation: - States in Prefect - Global Concurrency Limits