You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2018/01/09 16:59:17 UTC

[Bug 61979] New: some listener thread failures do no wake workers

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

            Bug ID: 61979
           Summary: some listener thread failures do no wake workers
           Product: Apache httpd-2
           Version: 2.5-HEAD
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mpm_event
          Assignee: bugs@httpd.apache.org
          Reporter: covener@gmail.com
  Target Milestone: ---

it appears some listener thread failures do no wake workers, for example ptrans
allocation failures.  

signal_threads(ST_GRACEFUL) expects close_listeners to wake everyone up, but
sometimes this is not called within listener_thread() and instead NULL is
returned.

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


[Bug 61979] some listener thread failures do no wake workers

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61979

--- Comment #2 from Eric Covener <co...@gmail.com> ---
(In reply to Eric Covener from comment #1)
> maybe just s/return NULL/break for the ptrans failure

Trickier, we're iterating over the pollset results and doing a graceful
shutdown. Currently "return NULL" ignores the other sockets with activity, but
break would continue tryign the other sockets w/ likely OOM scenario.

break/goto to the outer for(;;) listener loop would at least wake up the
workers, but would still ignore any addl socket activity (later in the result
loop or subsequent during the graceful shutdown)

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


[Bug 61979] some listener thread failures do no wake workers

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61979

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #35665|0                           |1
        is obsolete|                            |

--- Comment #4 from Yann Ylavic <yl...@gmail.com> ---
Created attachment 35671
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35671&action=edit
Listener resource shortage (v2)

Same with a better handling of {en,dis}able_listensocks() concurrency
(atomics), since disable_listensocks() can now be called by both the listener
and workers via signal_threads().

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


[Bug 61979] some listener thread failures do no wake workers

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61979

--- Comment #3 from Yann Ylavic <yl...@gmail.com> ---
Created attachment 35665
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35665&action=edit
Listener resource shortage

Maybe something like this could work.

The patch moves the disabling (poll) of the listen sockets from close_listeners
to wakeup_listener, where listener_may_exit is set already along with anything
to start the listener graceful stop, but mainly a callee of signal_threads.
Thus after signal_threads is called, the listener can continue its loop(s)
without creating new connections or pools (i.e. maintenance job only, though
the workers may still encounter OOM...).

In case of allocation failure, the resource_shortage flag is also set to avoid
creating a new child too quickly, that'll possibly help recovery.

Finally the patch also changes the init_pollset failure to be ungraceful, there
is nothing to wait for at this point IMO, with resource_shortage=1 still.

Note: I had to make ap_child_slot global to avoid forwarding the local
process_slot var/arg too much...

Wouldn't this "work"?

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


[Bug 61979] some listener thread failures do no wake workers

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61979

--- Comment #5 from Eric Covener <co...@gmail.com> ---
(In reply to Yann Ylavic from comment #4)
> Created attachment 35671 [details]
> Listener resource shortage (v2)
> 
> Same with a better handling of {en,dis}able_listensocks() concurrency
> (atomics), since disable_listensocks() can now be called by both the
> listener and workers via signal_threads().

Thanks Yann -- I was only able to test the guts w/ simulate ptrans error,
but it looked good.

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


[Bug 61979] some listener thread failures do no wake workers

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61979

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |FixedInTrunk

--- Comment #6 from Yann Ylavic <yl...@gmail.com> ---
Committed in r1821558, and proposed for backport (incremental).

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


[Bug 61979] some listener thread failures do no wake workers

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61979

--- Comment #1 from Eric Covener <co...@gmail.com> ---
maybe just s/return NULL/break for the ptrans failure

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


[Bug 61979] some listener thread failures do no wake workers

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61979

Christophe JAILLET <ch...@wanadoo.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #7 from Christophe JAILLET <ch...@wanadoo.fr> ---
Backported in 2.4.x in r1823644

This is part of 2.4.30

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