[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: (ITS#4395) slapd in endless loop when opening to many connections
rhafer@suse.de wrote:
> Full_Name: Ralf Haferkamp
> Version: 2.3.19, HEAD
> OS: Linux (Kernel 2.6)
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (212.95.111.71)
>
>
> slapd is built to use epoll(). ulimit -n is 32 (Just for testing. The bug is
> also there with larger values). I used a small test programm that just opens new
> connection to the server. After it the server ran into the ulimit and I stopped
> the test programm the slapd process is spinning in a endless loop an 99% cpu
> utilization.
> While trying to track the problem down I found that is spinning in the main
> daemon loop and epoll_wait() is signaling activity on a single descriptor. The
> revents for this descriptor are set to "EPOLLERR | EPOLLHUP" and this case in
> not handled in the loop. (It only handles EPOLLIN and EPOLLOUT)
> Now I could use some help how to fix this condition and correctly close and
> delete the connection that is causing this.
>
Simplest would be to funnel the error case into the Read handler, since
that code will detect EOF and do the proper connection shutdown. I've
patched this in HEAD, please test.
--
-- Howard Chu
Chief Architect, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc
OpenLDAP Core Team http://www.openldap.org/project/