sekimura / evpsgi

PSGI server with libevent httpd
Other
20 stars 3 forks source link

keepalive causes SIGPIPE #5

Open sekimura opened 14 years ago

sekimura commented 14 years ago

ouch...

epoll_ctl(3, EPOLL_CTL_ADD, 12, {EPOLLOUT, {u32=12, u64=12}}) = 0 epoll_wait(3, {{EPOLLERR|EPOLLHUP, {u32=7, u64=7}}, {EPOLLERR|EPOLLHUP, {u32=8, u64=8}}, {EPOLLERR|EPOLLHUP, {u32=9, u64=9}}, {EPOLLERR|EPOLLHUP, {u32=13, u64=13}}, {EPOLLERR|EPOLLHUP, {u32=14, u64=14}}, {EPOLLERR|EPOLLHUP, {u32=15, u64=15}}, {EPOLLERR|EPOLLHUP, {u32=16, u64=16}}, {EPOLLERR|EPOLLHUP, {u32=10, u64=10}}, {EPOLLERR|EPOLLHUP, {u32=11, u64=11}}, {EPOLLERR|EPOLLHUP, {u32=12, u64=12}}}, 1023, 50000) = 10 clock_gettime(CLOCK_MONOTONIC, {60883, 94923857}) = 0 epoll_ctl(3, EPOLL_CTL_DEL, 7, {EPOLLOUT, {u32=7, u64=7}}) = 0 write(7, "HTTP/1.1 400 Bad Request\r\nConten"..., 264) = -1 EPIPE (Broken pipe) --- SIGPIPE (Broken pipe) @ 0 (0) --- +++ killed by SIGPIPE +++

sekimura commented 14 years ago

Even though a keepalive connection closed by a client, server tries to send a http response via "closed" socket. And then, SIGPIPE error happens.

Actually, this is a bug in the libevent library. I'll contact with the team and will fix it.

sekimura commented 14 years ago

Note: This bug has been fixed in libevent version2

sekimura commented 14 years ago

It has been fixed in 1.4 too but the latest one, 1.4.13-stable doesn't have the fix yet.

https://sourceforge.net/tracker/?func=detail&aid=2909909&group_id=50884&atid=461324