git-daemon poll() spinning out of control
With the '0' timeout given to poll, it returns instantly without any events on my system, causing git-daemon to consume all the CPU time. Use -1 as the timeout so poll() only returns in case of EINTR or actually events being available. Signed-off-by: Jens Axboe <axboe@suse.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
bfadbeddd1
commit
7872e05567
2
daemon.c
2
daemon.c
@ -533,7 +533,7 @@ static int service_loop(int socknum, int *socklist)
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (poll(pfd, socknum, 0) < 0) {
|
if (poll(pfd, socknum, -1) < 0) {
|
||||||
if (errno != EINTR) {
|
if (errno != EINTR) {
|
||||||
error("poll failed, resuming: %s",
|
error("poll failed, resuming: %s",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
Loading…
Reference in New Issue
Block a user