`<div dir="ltr">Hi Marcel,<div><br></div><div>I really appreciate your input. We will try to find out what is wrong in connmgr_get() which caused port leaking.</div><div><br></div><div>In the meantime, we want to change clnt_cots_do_bindresvport from 1 to 0 through mdb so that new connection will start using non-reserved port,</div><div><br></div><div><a href="http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/rpc/clnt_cots.c#508">http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/rpc/clnt_cots.c#508</a></div><div><br></div><div>Will dynamically changing this variable have any side effect?</div><div><br></div><div>Thanks,</div><div>-Youzhong</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 3, 2014 at 4:50 PM, Marcel Telka <span dir="ltr"><<a href="mailto:marcel@telka.sk" target="_blank">marcel@telka.sk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Youzhong,<br>
<div><div class="h5"><br>
On Mon, Nov 03, 2014 at 04:14:55PM -0500, Youzhong Yang via illumos-developer wrote:<br>
> Hello,<br>
><br>
> We are having a very strange issue on one of servers. The issue is that<br>
> fcntl locking over NFS returns 'no locks available' immediately.<br>
><br>
> dtrace shows that bindresvport() returns error code 125 (EADDRINUSE):<br>
><br>
> # dtrace -n 'fbt:rpcmod:bindresvport:return /arg1 != 0/ {stack();<br>
> printf("ret = %d", arg1);}'<br>
> 9 52692 bindresvport:return<br>
> rpcmod`connmgr_get+0x560<br>
> rpcmod`connmgr_wrapget+0x63<br>
> rpcmod`clnt_cots_kcallit+0x198<br>
> rpcmod`rpcbind_getaddr+0x245<br>
> klmmod`update_host_rpcbinding+0x4f<br>
> klmmod`nlm_host_get_rpc+0x6d<br>
> klmmod`nlm_do_lock+0x10d<br>
> klmmod`nlm4_lock_4_svc+0x2a<br>
> klmmod`nlm_dispatch+0xe6<br>
> klmmod`nlm_prog_4+0x34<br>
> rpcmod`svc_getreq+0x1c1<br>
> rpcmod`svc_run+0x146<br>
> rpcmod`svc_do_run+0x8e<br>
> nfs`nfssys+0xf1<br>
> unix`_sys_sysenter_post_swapgs+0x149<br>
> ret = 125<br>
><br>
> netstat shows that 501 reserved ports are in BOUND state:<br>
><br>
> # netstat -an | grep BOUND<br>
> *.935 *.* 0 0 1049740 0 BOUND<br>
> *.801 *.* 0 0 1049740 0 BOUND<br>
> *.798 *.* 0 0 1049740 0 BOUND<br>
> *.561 *.* 0 0 1049740 0 BOUND<br>
> *.613 *.* 0 0 1049740 0 BOUND<br>
> ....<br>
> # netstat -an | grep BOUND | wc -l<br>
> 501<br>
><br>
> Has anyone seen this similar issue? is it possible to unbind those reserved<br>
> ports? Rebooting the server is our last resort.<br>
><br>
> Any advice would be very much appreciated.<br>
<br>
</div></div>I faced similar issue in connmgr_get(). It is filed as #1616 and the problem<br>
is that the dead connection is not properly closed (there seems to be missing<br>
connmgr_cancelconn() call somewhere), so the client could properly reconnect.<br>
Unfortunately, I had no time to finish the analysis of this bug.<br>
<br>
<br>
HTH<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
+-------------------------------------------+<br>
| Marcel Telka e-mail: <a href="mailto:marcel@telka.sk">marcel@telka.sk</a> |<br>
| homepage: <a href="http://telka.sk/" target="_blank">http://telka.sk/</a> |<br>
| jabber: <a href="mailto:marcel@jabber.sk">marcel@jabber.sk</a> |<br>
+-------------------------------------------+<br>
</font></span></blockquote></div><br></div>
`