syslog-ng:在前连接关闭之前接受使用相同的fd(然后打开fd达到限制)

时间:2015-02-28 04:11:07

标签: c multithreading server libevent

我的程序使用主线程接受传递连接(因此没有接受赛车!),然后将其交给4个从属线程,当r / w返回0时它们将关闭。

但有时像这样的日志打印.....

Feb 27 00:13:31 mx59  lp_server.c[62] __lp_listening_handler: "<-1195489312> [INFO] accept fd(105), ready for register, inode(-1031324988)"
Feb 27 00:13:31 mx59  lp_server.c[69] __lp_listening_handler: "<-1195489312> [INFO] ldapproxy accept new connection succ!"
Feb 27 00:13:33 mx59  lp_server.c[62] __lp_listening_handler: "<-1195489312> [INFO] accept fd(105), ready for register, inode(-1031324792)"
Feb 27 00:13:33 mx59  lp_server.c[69] __lp_listening_handler: "<-1195489312> [INFO] ldapproxy accept new connection succ!"
Feb 27 00:13:33 mx59  lp_ldap.c[603] lp_ldap_io_event_handler: "<-1217919232> [INFO] task type: ..., ..."
Feb 27 00:13:36 mx59  lp_server.c[62] __lp_listening_handler: "<-1195489312> [INFO] accept fd(105), ready for register, inode(-1031324295)"
Feb 27 00:13:36 mx59  lp_server.c[69] __lp_listening_handler: "<-1195489312> [INFO] ldapproxy accept new connection succ!"
Feb 27 00:13:38 mx59  lp_server.c[62] __lp_listening_handler: "<-1195489312> [INFO] accept fd(105), ready for register, inode(-1031324102)"
Feb 27 00:13:38 mx59  lp_server.c[69] __lp_listening_handler: "<-1195489312> [INFO] ldapproxy accept new connection succ!"
Feb 27 00:13:38 mx59  lp_ldap.c[603] lp_ldap_io_event_handler: "<-1196939520> [INFO] task type: ..., ..."
Feb 27 00:13:41 mx59  lp_server.c[62] __lp_listening_handler: "<-1195489312> [INFO] accept fd(105), ready for register, inode(-1031323906)"
Feb 27 00:13:41 mx59  lp_server.c[69] __lp_listening_handler: "<-1195489312> [INFO] ldapproxy accept new connection succ!"
Feb 27 00:13:43 mx59  lp_server.c[62] __lp_listening_handler: "<-1195489312> [INFO] accept fd(105), ready for register, inode(-1031323852)"
Feb 27 00:13:43 mx59  lp_server.c[69] __lp_listening_handler: "<-1195489312> [INFO] ldapproxy accept new connection succ!"
Feb 27 00:13:43 mx59  lp_ldap.c[603] lp_ldap_io_event_handler: "<-1217919232> [INFO] task type: ..., ..."
Feb 27 00:13:46 mx59  lp_server.c[62] __lp_listening_handler: "<-1195489312> [INFO] accept fd(105), ready for register, inode(-1031323694)"

有一些要点需要指出: 1)fd 105使用了多次(inode不同),但我看不到连接关闭信息!

2)在上面的日志之后的一段时间,程序打印“始终接受失败”。

我查看并查看“cat / proc / $ pid / fd / * | wc -l == ulimit -n”,即:在此日志后不久,打开fds达到当前限制。

上面粘贴的日志和“接受失败”之间是否有任何关系?

3)或只是syslog-ng错误,所以它没有打印连接关闭信息?

0 个答案:

没有答案