Simo Tumelius
04/17/2023, 10:55 AMjordan
04/17/2023, 1:56 PMWhen running Dagit locally the op returns normally and doesn’t hang.Is this true for the long-running ones as well?
Simo Tumelius
04/17/2023, 3:01 PMAndrea Giardini
04/18/2023, 12:33 PMjordan
04/18/2023, 6:37 PMMany network appliances define idle connection timeout to terminate connections after an inactivity period. For example, appliances like NAT Gateway, Amazon Virtual Private Cloud (Amazon VPC) Endpoints, and Network Load Balancer (NLB) currently have a fixed idle timeout of 350 seconds. Packets sent after the idle timeout expired aren’t delivered to the destination.is there a way to trigger these functions async and then poll for completion instead of leaving the connection open?
Simo Tumelius
04/20/2023, 9:02 AMSimo Tumelius
04/20/2023, 9:28 AMSimo Tumelius
04/26/2023, 6:16 AMHTTPConnection.default_socket_options
to apply the fix:
import socket
from urllib3.connection import HTTPConnection
# Enable TCP Keep Alive to prevent Dagster Cloud NAT Gateway from closing long-running idle connections
# <https://urllib3.readthedocs.io/en/stable/reference/urllib3.connection.html>
HTTPConnection.default_socket_options += [
(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1), # Enable TCP keepalive
(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 300), # First probe after 300 seconds
(
socket.IPPROTO_TCP,
socket.TCP_KEEPINTVL,
120,
), # Probe every 120 seconds after initial probe
(socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 10), # Max 10 probes
]