close fd 死循环_TcpConnection::handleRead里面readFd死循环循环返回-1,导致日志写满磁盘...

部分strace(10秒总共两万多行):

10:36:15.070879 read(7, "\1\0\0\0\0\0\0\0", 8) = 8

10:36:15.070913 write(107, "\1\0\0\0\0\0\0\0", 8) = 8

10:36:15.070944 epoll_wait(5, {{EPOLLIN, {u32=11036336, u64=11036336}}}, 16, 10000) = 1

10:36:15.071265 accept4(14, {sa_family=AF_INET, sin_port=htons(21080), sin_addr=inet_addr("10.184.33.4")}, [16], SOCK_CLOEXEC|SOCK_NONBLOCK) = 227027

10:36:15.071308 getsockname(227027, {sa_family=AF_INET, sin_port=htons(5003), sin_addr=inet_addr("10.187.211.142")}, [16]) = 0

10:36:15.071350 write(104, "\1\0\0\0\0\0\0\0", 8) = 8

10:36:15.071416 epoll_wait(5, {{EPOLLIN, {u32=11029184, u64=11029184}}}, 16, 10000) = 1

10:36:15.071705 read(7, "\1\0\0\0\0\0\0\0", 8) = 8

10:36:15.071736 write(32, "\1\0\0\0\0\0\0\0", 8) = 8

10:36:15.071856 close(244753) = 0

10:36:15.071893 epoll_wait(5, {{EPOLLIN, {u32=11030496, u64=11030496}}}, 16, 10000) = 1

10:36:15.072406 accept4(10, {sa_family=AF_INET, sin_port=htons(19415), sin_addr=inet_addr("10.184.32.156")}, [16], SOCK_CLOEXEC|SOCK_NONBLOCK) = 235250

10:36:15.072459 getsockname(235250, {sa_family=AF_INET, sin_port=htons(5001), sin_addr=inet_addr("10.187.211.142")}, [16]) = 0

10:36:15.072503 write(68, "\1\0\0\0\0\0\0\0", 8) = 8

10:36:15.072536 epoll_wait(5, {{EPOLLIN, {u32=11029744, u64=11029744}}}, 16, 10000) = 1

10:36:15.073097 accept4(8, {sa_family=AF_INET, sin_port=htons(17485), sin_addr=inet_addr("10.184.32.87")}, [16], SOCK_CLOEXEC|SOCK_NONBLOCK) = 235302

10:36:15.073137 getsockname(235302, {sa_family=AF_INET, sin_port=htons(5000), sin_addr=inet_addr("10.187.211.142")}, [16]) = 0

10:36:15.073177 write(32, "\1\0\0\0\0\0\0\0", 8) = 8

10:36:15.073210 epoll_wait(5, {{EPOLLIN, {u32=11029184, u64=11029184}}}, 16, 10000) = 1

10:36:15.075891 read(7, "\1\0\0\0\0\0\0\0", 8) = 8

10:36:15.075929 write(47, "\1\0\0\0\0\0\0\0", 8) = 8

10:36:15.075960 epoll_wait(5, {{EPOLLIN, {u32=11036336, u64=11036336}}}, 16, 10000) = 1

10:36:15.076759 accept4(14, {sa_family=AF_INET, sin_port=htons(34802), sin_addr=inet_addr("10.184.33.106")}, [16], SOCK_CLOEXEC|SOCK_NONBLOCK) = 199737

10:36:15.076802 getsockname(199737, {sa_family=AF_INET, sin_port=htons(5003), sin_addr=inet_addr("10.187.211.142")}, [16]) = 0

10:36:15.076845 write(107, "\1\0\0\0\0\0\0\0", 8) = 8

10:36:15.076877 epoll_wait(5, {{EPOLLIN, {u32=11029184, u64=11029184}}}, 16, 10000) = 1

10:36:15.078235 read(7, "\1\0\0\0\0\0\0\0", 8) = 8

10:36:15.078273 write(71, "\1\0\0\0\0\0\0\0", 8) = 8

10:36:15.078315 close(11218) = 0

相应的日志:

20170816 10:36:15.070879 300316 ERROR TcpConnection::handleError [:10.187.211.142:5001#4388409] - SO_ERROR = 0 Success - TcpConnection.cc:419

20170816 10:36:15.070882 300316 ERROR Resource temporarily unavailable (errno=11) TcpConnection::handleRead - TcpConnection.cc:341

20170816 10:36:15.070883 300316 ERROR TcpConnection::handleError [:10.187.211.142:5001#4388409] - SO_ERROR = 0 Success - TcpConnection.cc:419

20170816 10:36:15.070886 300316 ERROR Resource temporarily unavailable (errno=11) TcpConnection::handleRead - TcpConnection.cc:341

20170816 10:36:15.070887 300316 ERROR TcpConnection::handleError [:10.187.211.142:5001#4388409] - SO_ERROR = 0 Success - TcpConnection.cc:419

20170816 10:36:15.070890 300316 ERROR Resource temporarily unavailable (errno=11) TcpConnection::handleRead - TcpConnection.cc:341

20170816 10:36:15.070892 300316 ERROR TcpConnection::handleError [:10.187.211.142:5001#4388409] - SO_ERROR = 0 Success - TcpConnection.cc:419

20170816 10:36:15.070895 300316 ERROR Resource temporarily unavailable (errno=11) TcpConnection::handleRead - TcpConnection.cc:341

20170816 10:36:15.070896 300316 ERROR TcpConnection::handleError [:10.187.211.142:5001#4388409] - SO_ERROR = 0 Success - TcpConnection.cc:419

20170816 10:36:15.070899 300316 ERROR Resource temporarily unavailable (errno=11) TcpConnection::handleRead - TcpConnection.cc:341

20170816 10:36:15.070901 300316 ERROR TcpConnection::handleError [:10.187.211.142:5001#4388409] - SO_ERROR = 0 Success - TcpConnection.cc:419

20170816 10:36:15.070904 300316 ERROR Resource temporarily unavailable (errno=11) TcpConnection::handleRead - TcpConnection.cc:341

20170816 10:36:15.070905 300316 ERROR TcpConnection::handleError [:10.187.211.142:5001#4388409] - SO_ERROR = 0 Success - TcpConnection.cc:419

20170816 10:36:15.070908 300316 ERROR Resource temporarily unavailable (errno=11) TcpConnection::handleRead - TcpConnection.cc:341

20170816 10:36:15.070910 300316 ERROR TcpConnection::handleError [:10.187.211.142:5001#4388409] - SO_ERROR = 0 Success - TcpConnection.cc:419

20170816 10:36:15.070913 300316 ERROR Resource temporarily unavailable (errno=11) TcpConnection::handleRead - TcpConnection.cc:341

20170816 10:36:15.070915 300316 ERROR TcpConnection::handleError [:10.187.211.142:5001#4388409] - SO_ERROR = 0 Success - TcpConnection.cc:419

20170816 10:36:15.070918 300316 ERROR Resource temporarily unavailable (errno=11) TcpConnection::handleRead - TcpConnection.cc:341

20170816 10:36:15.070919 300316 ERROR TcpConnection::handleError [:10.187.211.142:5001#4388409] - SO_ERROR = 0 Success - TcpConnection.cc:419

20170816 10:36:15.070922 300316 ERROR Resource temporarily unavailable (errno=11) TcpConnection::handleRead - TcpConnection.cc:341

strace和日志好像对不上,strace里面的read没有eagain,而且strace的系统调用次数偏少。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值