<p></p>
<p>It is strange that the file descriptor value in the error messages is so high (e.g., 30406), given the open connections is not close to the limit:</p>
<pre><code>Jun 29 08:08:14 fep-1 /usr/local/fep-kamailio/sbin/kamailio[14111]: ERROR: <core> [core/tcp_main.c:4451]: handle_tcpconn_ev(): io_watch_del(3) failed: for 0x7f524f7862d0, fd 30406
</code></pre>
<p>The POSIX requires to use always the lowest available file descriptor value - <code>File Descriptor Allocation</code>:</p>
<ul>
<li><a href="https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_14" rel="nofollow">https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_14</a></li>
</ul>
<p>Maybe the implementation in your OS has bugs or doesn't follow the POSIX. You can try to investigate the list of file descriptors listed in the proc for Kamailio processes, should be in paths like:</p>
<pre><code>/proc/_PID_/fd/
</code></pre>
<p>And you have to replace <code>_PID_</code> with the values corresponding to Kamailio processes, interesting would be for <code>tcp main process</code> (usually the last process in <code>kamctl ps</code>) and for the <code>tcp receiver ...</code>.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2796#issuecomment-874608571">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZN6ALWA4KQGTRKICOLTWLEGNANCNFSM47Z7U6EQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZPFAQIONLNDJ6WKW2TTWLEGNA5CNFSM47Z7U6E2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGQQXPOY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2796#issuecomment-874608571",
"url": "https://github.com/kamailio/kamailio/issues/2796#issuecomment-874608571",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>