httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Darroch <>
Subject Re: shutdown and linux poll()
Date Tue, 14 Feb 2006 02:50:22 GMT

>>    This may be an old topic of conversation, in which case I apologize.
>> I Googled and searched and Apache Bugzilla but
>> didn't see anything, so here I am with a question.
>>    In brief, on Linux, when doing an ungraceful stop of httpd, any
>>  worker threads that are poll()ing on Keep-Alive connections don't get
>> awoken by close_worker_sockets() and that can lead to the process
>> getting the SIGKILL signal without ever getting the chance to run
>> apr_pool_destroy(pchild) in clean_child_exit().  This seems to
>> relate to this particular choice by the Linux and/or glibc folks:

> To clarify, are you sure its not using EPoll instead of Poll?

   Well, I'll probe more deeply tomorrow, and while I'm no expert
on this stuff, I don't think so.  Here are the last two lines from
an strace on one of the worker threads:

21:39:30.955670 poll([{fd=13, events=POLLIN, revents=POLLNVAL}], 1,
                15000) = 1
21:39:42.257615 +++ killed by SIGKILL +++

   That's the poll() on descriptor 13, for 15 keep-alive seconds,
during which the main process decides to do the SIGKILL.  Here,
I think, is the accept() that opens fd 13:

21:38:51.017764 accept(3, {sa_family=AF_INET, sin_port=htons(63612),
  sin_addr=inet_addr("")}, [16]) = 13

and while I do see some epoll stuff, it's on another descriptor:

21:38:43.012242 epoll_create(1) = 12

   Now, the caveat here is that I'm learning as I go; sockets
are not really my strong point.  But it's fairly easy to reproduce
this behaviour with a stock Apache 2.0 or 2.2 on a RedHat system;
I've tried both.  I can certainly provide more details if requested;
let me know!  Thanks,


GPG Key ID: 366A375B
GPG Key Fingerprint: 485E 5041 17E1 E2BB C263  E4DE C8E3 FA36 366A 375B

View raw message