https://bz.apache.org/bugzilla/show_bug.cgi?id=61616

--- Comment #44 from Carsten Wolff <cars...@wolffcarsten.de> ---
Created attachment 35737
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35737&action=edit
fixes a busy loop trying to shutdown a disconnected socket

(In reply to Carsten Wolff from comment #43)
> So it definitely seems to be necessary that the frontend connection uses SSL
> for the stalls to be triggered.

I need to retract that statement. With "v10 and v2 applied + configuration from
comment#24", another problem arises, when many concurrent connections are made
through proxy_connect: Now and then a process (prefork mpm) will stay in a busy
loop, doing this over and over again:

shutdown(30, 1 /* send */)              = -1 ENOTCONN (Transport endpoint is
not connected)
epoll_ctl(31, EPOLL_CTL_DEL, 30, {0, {u32=0, u64=0}}) = 0
epoll_wait(31, {{EPOLLOUT|EPOLLERR|EPOLLHUP, {u32=359204392,
u64=140724962657832}}}, 2, 60000) = 1
epoll_ctl(31, EPOLL_CTL_DEL, 30, {0, {u32=0, u64=0}}) = -1 ENOENT (No such file
or directory)
epoll_ctl(31, EPOLL_CTL_ADD, 30, {EPOLLOUT, {u32=359204480,
u64=140724962657920}}) = 0
shutdown(29, 1 /* send */)              = -1 ENOTCONN (Transport endpoint is
not connected)
epoll_ctl(31, EPOLL_CTL_DEL, 29, {0, {u32=0, u64=0}}) = 0
epoll_wait(31, {{EPOLLOUT|EPOLLHUP, {u32=359204480, u64=140724962657920}}}, 2,
60000) = 1
epoll_ctl(31, EPOLL_CTL_DEL, 29, {0, {u32=0, u64=0}}) = -1 ENOENT (No such file
or directory)
epoll_ctl(31, EPOLL_CTL_ADD, 29, {EPOLLOUT, {u32=359204392,
u64=140724962657832}}) = 0
shutdown(30, 1 /* send */)

The attached patch avoids the busy loop by setting "done", when
apr_socket_shutdown returns with an error.

Further more, when testing this patch by doing many concurrent rsync transfers,
I noticed that some rsync clients still stall at some point (w/ and w/o SSL!).
When these clients die, that's when the busy loop occurs.

The test is very simple:
# cat reproduce-endlesss-poll-loop.sh 
#!/bin/bash
mkdir /testdst
cd /testdst
for i in {1..100}; do
        dd if=/dev/urandom of=$i bs=10M count=1 >/dev/null &
done
wait

for i in {1..100}; do
        # w/ stunnel
        #RSYNC_PROXY=localhost:874 rsync -rcP rsync://localhost:873/testsrc/$i
/testdst/$i &
        # no-ssl
        RSYNC_PROXY=192.168.122.11:80 rsync -rcP
rsync://localhost:873/testsrc/$i /testdst/$i &
done
wait

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscr...@httpd.apache.org
For additional commands, e-mail: bugs-h...@httpd.apache.org

Reply via email to