<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic sas-airflow-provider TCP keep alive in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/sas-airflow-provider-TCP-keep-alive/m-p/961394#M29720</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I am experimenting with the sas-airflow-provider (&lt;A href="https://github.com/sassoftware/sas-airflow-provider" target="_new" rel="noopener"&gt;https://github.com/sassoftware/sas-airflow-provider&lt;/A&gt;). 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!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;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):&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')).&lt;BR /&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;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?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If I understand correctly, the SAS Hook under the hood uses Python's &lt;CODE&gt;requests.Session&lt;/CODE&gt;, which implicitly supports keep-alive for HTTP connections, or is that not the case?&lt;BR /&gt;&lt;BR /&gt;Mindaugas&lt;/P&gt;</description>
    <pubDate>Mon, 10 Mar 2025 09:04:22 GMT</pubDate>
    <dc:creator>misul</dc:creator>
    <dc:date>2025-03-10T09:04:22Z</dc:date>
    <item>
      <title>sas-airflow-provider TCP keep alive</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/sas-airflow-provider-TCP-keep-alive/m-p/961394#M29720</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I am experimenting with the sas-airflow-provider (&lt;A href="https://github.com/sassoftware/sas-airflow-provider" target="_new" rel="noopener"&gt;https://github.com/sassoftware/sas-airflow-provider&lt;/A&gt;). 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!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;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):&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')).&lt;BR /&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;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?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If I understand correctly, the SAS Hook under the hood uses Python's &lt;CODE&gt;requests.Session&lt;/CODE&gt;, which implicitly supports keep-alive for HTTP connections, or is that not the case?&lt;BR /&gt;&lt;BR /&gt;Mindaugas&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 09:04:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/sas-airflow-provider-TCP-keep-alive/m-p/961394#M29720</guid>
      <dc:creator>misul</dc:creator>
      <dc:date>2025-03-10T09:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: sas-airflow-provider TCP keep alive</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/sas-airflow-provider-TCP-keep-alive/m-p/961426#M29722</link>
      <description>It looks like requests.Session supports HTTP keep-alive (meaning reuse of HTTP connections). You're looking to send keepalive packets over the TCP session to prevent the 10 minute idle timeout.&lt;BR /&gt;Other than modifying the hook to make use of the socket keepalive options in python you could try setting the sysctl ipv4.net.tcp_keepalive_time on the host running the python from the default of 7200 to something below 10 minutes (e.g. 540 -- 9 minutes)</description>
      <pubDate>Mon, 10 Mar 2025 14:25:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/sas-airflow-provider-TCP-keep-alive/m-p/961426#M29722</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2025-03-10T14:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: sas-airflow-provider TCP keep alive</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/sas-airflow-provider-TCP-keep-alive/m-p/961535#M29728</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you. I will try adding some TCP keep-alive logic.&lt;BR /&gt;Something similar was discussed here:&lt;BR /&gt;&lt;A href="https://blog.panagiks.com/2019/05/python-tcp-keepalive-on-http-request.html" target="_new" rel="noopener"&gt;https://blog.panagiks.com/2019/05/python-tcp-keepalive-on-http-request.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 12:26:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/sas-airflow-provider-TCP-keep-alive/m-p/961535#M29728</guid>
      <dc:creator>misul</dc:creator>
      <dc:date>2025-03-11T12:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: sas-airflow-provider TCP keep alive</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/sas-airflow-provider-TCP-keep-alive/m-p/961541#M29729</link>
      <description>Consider creating an issue in Github (and a pull request if you successfully incorporate this new feature) as well.</description>
      <pubDate>Tue, 11 Mar 2025 13:05:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/sas-airflow-provider-TCP-keep-alive/m-p/961541#M29729</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2025-03-11T13:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: sas-airflow-provider TCP keep alive</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/sas-airflow-provider-TCP-keep-alive/m-p/961850#M29742</link>
      <description>&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 07:23:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/sas-airflow-provider-TCP-keep-alive/m-p/961850#M29742</guid>
      <dc:creator>misul</dc:creator>
      <dc:date>2025-03-14T07:23:48Z</dc:date>
    </item>
  </channel>
</rss>

