title: syslog-ng : accept using same fd before former connection close (then open fd reaches the limit)
body: <p>My program use a main thread accept comming connections(so there is no accept racing!),then give it to 4 slave threads ,they will close when r/w return 0.</p>
  
  <p>but some times the log print like this.....</p>
  
  <pre><code>Feb 27 00:13:31 mx59  lp_server.c[62] __lp_listening_handler: "&lt;-1195489312&gt; [INFO] accept fd(105), ready for register, inode(-1031324988)"
  Feb 27 00:13:31 mx59  lp_server.c[69] __lp_listening_handler: "&lt;-1195489312&gt; [INFO] ldapproxy accept new connection succ!"
  Feb 27 00:13:33 mx59  lp_server.c[62] __lp_listening_handler: "&lt;-1195489312&gt; [INFO] accept fd(105), ready for register, inode(-1031324792)"
  Feb 27 00:13:33 mx59  lp_server.c[69] __lp_listening_handler: "&lt;-1195489312&gt; [INFO] ldapproxy accept new connection succ!"
  Feb 27 00:13:33 mx59  lp_ldap.c[603] lp_ldap_io_event_handler: "&lt;-1217919232&gt; [INFO] task type: ..., ..."
  Feb 27 00:13:36 mx59  lp_server.c[62] __lp_listening_handler: "&lt;-1195489312&gt; [INFO] accept fd(105), ready for register, inode(-1031324295)"
  Feb 27 00:13:36 mx59  lp_server.c[69] __lp_listening_handler: "&lt;-1195489312&gt; [INFO] ldapproxy accept new connection succ!"
  Feb 27 00:13:38 mx59  lp_server.c[62] __lp_listening_handler: "&lt;-1195489312&gt; [INFO] accept fd(105), ready for register, inode(-1031324102)"
  Feb 27 00:13:38 mx59  lp_server.c[69] __lp_listening_handler: "&lt;-1195489312&gt; [INFO] ldapproxy accept new connection succ!"
  Feb 27 00:13:38 mx59  lp_ldap.c[603] lp_ldap_io_event_handler: "&lt;-1196939520&gt; [INFO] task type: ..., ..."
  Feb 27 00:13:41 mx59  lp_server.c[62] __lp_listening_handler: "&lt;-1195489312&gt; [INFO] accept fd(105), ready for register, inode(-1031323906)"
  Feb 27 00:13:41 mx59  lp_server.c[69] __lp_listening_handler: "&lt;-1195489312&gt; [INFO] ldapproxy accept new connection succ!"
  Feb 27 00:13:43 mx59  lp_server.c[62] __lp_listening_handler: "&lt;-1195489312&gt; [INFO] accept fd(105), ready for register, inode(-1031323852)"
  Feb 27 00:13:43 mx59  lp_server.c[69] __lp_listening_handler: "&lt;-1195489312&gt; [INFO] ldapproxy accept new connection succ!"
  Feb 27 00:13:43 mx59  lp_ldap.c[603] lp_ldap_io_event_handler: "&lt;-1217919232&gt; [INFO] task type: ..., ..."
  Feb 27 00:13:46 mx59  lp_server.c[62] __lp_listening_handler: "&lt;-1195489312&gt; [INFO] accept fd(105), ready for register, inode(-1031323694)"
  </code></pre>
  
  <p>there are some points to be pointed out:
  1)fd 105 used more then one time(inode different),but i see no connetion closing info!</p>
  
  <p>2)Some time after the log above,program printing "accept fail" all the time.</p>
  
  <p>I check and see "cat /proc/$pid/fd/*|wc -l == ulimit -n",that is: not long after this log,open fds reaches the current limitation.</p>
  
  <p>Is there any relation between the log pasted above and the "accept fail"?</p>
  
  <p>3)or just the syslog-ng bugs so it did’nt print connection closing info?</p>