Hello,
I am experimenting with the sas-airflow-provider (https://github.com/sassoftware/sas-airflow-provider). I am trying to use the SASJobExecutionOperator to launch SAS Job Definition objects from Airflow. Note: I am using SAS Viya 3.5, not 4.0!
It seems that any SAS job which lasts more than 10 minutes gets this message on the Airflow side (the SAS job runs as long as needed without any issues):
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')).
Most likely, it is related to a WAF timeout: the connection is terminated after 10 minutes of inactivity. Does the SASJobExecutionOperator or SAS Hook have a TCP keep-alive option, or can I pass this option somehow?
If I understand correctly, the SAS Hook under the hood uses Python's requests.Session, which implicitly supports keep-alive for HTTP connections, or is that not the case?
Mindaugas
Thank you. I will try adding some TCP keep-alive logic.
Something similar was discussed here:
https://blog.panagiks.com/2019/05/python-tcp-keepalive-on-http-request.html
It seems that TCP keep-alive logic in production environments may not be sufficient. Most likely, there will be a WAF and load balancers between the client and the server. TCP keep-alive will only cover the client-WAF connection, but load balancers may still impose restrictions. A better approach would be to initiate the command in the background without waiting for a response, then separately check the status and retrieve the results, ideally in the same Airflow task.
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
Learn how to explore data assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.