<p>We are using Kubernetes <code>v1.9.5</code> on bare metal, deployed with <code>kubespray</code>, network driver - <code>flannel</code>. </p>

<p>When doing HTTP request from pod to another service, if that service has no endpoint, request hangs for <strong>exactly 130 seconds</strong> (I checked in via <code>NodeJS</code> net library and via <code>curl</code>). </p>

<p>Where this value comes from? </p>

<p>We noticed in while writing retries that try to establish connection to service.</p>

<p>Any help appreciated.</p>

<p>It looks like the iptables will DROP packet if its destined to a non-existent end-point and DROP will never send a message back to the requester (<a href="http://www.chiark.greenend.org.uk/~peterb/network/drop-vs-reject" rel="nofollow noreferrer">DROP/REJECT</a>) . This will result in retires from requester.
Retries depends on the parameter <code>net.ipv4.tcp_syn_retries</code> and by default its 6 in CentOS-7 </p>

<p>When I set <code>net.ipv4.tcp_syn_retries=1</code> in the minion where the requester pod runs , the timeout happens in 3 seconds instead of the 2m 7.23s</p>

<p>I hope this clarifies why curl or any port connect request hangs for long time if the request is for a non-existent endpoint.</p>
