as the title says,I get stuck in epoll_wait when I use the libevent. This does not happen frequently.When this happened,I am always confused. When I use the strace to track the process(strace -p ),I get the message as follows:
futex(0x6d57c0, FUTEX_WAKE, 1) = 1
epoll_ctl(10, EPOLL_CTL_MOD, 368, {EPOLLIN|EPOLLOUT, {u32=368, u64=368}}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}, {EPOLLOUT, {u32=368, u64=368}}}, 32, 989) = 2
clock_gettime(CLOCK_MONOTONIC, {9670484, 296463066}) = 0
writev(368, [{"\0\0\0\0\5\\\360\26route\0\0\0\0\0\0\0\0\0\0\0\224\223"..., 173}], 1) = 173
epoll_ctl(10, EPOLL_CTL_MOD, 368, {EPOLLIN, {u32=368, u64=368}}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}}, 32, 986) = 1
clock_gettime(CLOCK_MONOTONIC, {9670484, 297741800}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}}, 32, 985) = 1
clock_gettime(CLOCK_MONOTONIC, {9670484, 298371750}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}}, 32, 984) = 1
clock_gettime(CLOCK_MONOTONIC, {9670484, 298965814}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}}, 32, 983) = 1
clock_gettime(CLOCK_MONOTONIC, {9670484, 299660077}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}}, 32, 983) = 1
clock_gettime(CLOCK_MONOTONIC, {9670484, 300400392}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}}, 32, 982) = 1
clock_gettime(CLOCK_MONOTONIC, {9670484, 301029189}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}}, 32, 981) = 1
clock_gettime(CLOCK_MONOTONIC, {9670484, 301556771}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}}, 32, 981) = 1
clock_gettime(CLOCK_MONOTONIC, {9670484, 302130445}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}}, 32, 980) = 1
clock_gettime(CLOCK_MONOTONIC, {9670484, 302659287}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}}, 32, 980) = 1
clock_gettime(CLOCK_MONOTONIC, {9670484, 303326556}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}}, 32, 979) = 1
clock_gettime(CLOCK_MONOTONIC, {9670484, 303965529}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}}, 32, 978) = 1
clock_gettime(CLOCK_MONOTONIC, {9670484, 304634925}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}}, 32, 978) = 1
clock_gettime(CLOCK_MONOTONIC, {9670484, 305284220}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}}, 32, 977) = 1
clock_gettime(CLOCK_MONOTONIC, {9670484, 305812017}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}}, 32, 977) = 1
clock_gettime(CLOCK_MONOTONIC, {9670484, 306455827}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}}, 32, 976) = 1
clock_gettime(CLOCK_MONOTONIC, {9670484, 306960246}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}}, 32, 975) = 1
clock_gettime(CLOCK_MONOTONIC, {9670484, 307515717}) = 0
epoll_wait(10, {{EPOLLIN|EPOLLOUT, {u32=814, u64=814}}}, 32
From the output,we can say the epoll_wait return a EPOLLIN|EPOLLOUT event,but no read or write be called, and the socket event just always there. So this make the CPU usage 100%. So what happend? why libevent did not handle it? Please help...
Aucun commentaire:
Enregistrer un commentaire