- Newest
- Most votes
- Most comments
The issue you're experiencing with SSL connections being closed unexpectedly after upgrading to MWAA version 2.7.2+ is likely related to connection timeouts or network stability issues. This problem can occur when long-running tasks exceed the default connection timeout settings.
To address this, you're on the right track by investigating custom settings. The SQL Alchemy connect args you've mentioned are a good start:
AIRFLOW__CORE__SQL_ALCHEMY_CONNECT_ARGS='{"keepalives":1, "keepalives_idle":60, "keepalives_interval":10, "keepalives_count":10}'
These settings help maintain the connection by sending keepalive packets. However, you might need to adjust these values further based on your specific environment and task durations.
In addition to the SQL Alchemy connect args, consider the following approaches:
-
Increase the connection pool recycle time: AIRFLOW__CORE__SQL_ALCHEMY_POOL_RECYCLE=1800
This setting (in seconds) determines how long a connection can be idle before being recycled.
-
Adjust the Celery broker connection timeout: AIRFLOW__CELERY__BROKER_CONNECTION_TIMEOUT=60
This can help with timeouts related to the Celery broker.
-
If memory issues are suspected, you can try adjusting the worker concurrency: AIRFLOW__CELERY__WORKER_CONCURRENCY=16
Reduce this value if you're experiencing out-of-memory errors.
-
For the Celery worker autoscale settings, ensure they are configured appropriately for your workload: AIRFLOW__CELERY__WORKER_AUTOSCALE='16,8'
This sets the maximum and minimum number of worker processes.
-
Consider implementing retry logic in your DAGs for tasks that are prone to these connection issues.
-
If the problem persists, you may need to investigate network-level issues, such as VPC configurations or security group settings that might be affecting the stability of your connections.
Remember to test these changes incrementally and monitor their impact on your workflow performance. If the issue continues, you may need to reach out to AWS support for further assistance, as there could be underlying infrastructure or service-specific factors at play.
Sources
Troubleshooting: DAGs, Operators, Connections, and other issues in Apache Airflow v1 - Amazon Managed Workflows for Apache Airflow
Apache Airflow versions on Amazon Managed Workflows for Apache Airflow - Amazon Managed Workflows for Apache Airflow
Amazon Managed Workflows for Apache Airflow (MWAA) Features – Amazon Web Services
answered 2 years ago
Relevant content
asked 4 years ago
asked 9 months ago
