On Mon, Apr 16, 2018 at 6:04 AM, Yann Ylavic <ylavic....@gmail.com> wrote:
> On Mon, Apr 16, 2018 at 8:45 AM, Ruediger Pluem <rpl...@apache.org> wrote:
>>
>> On 04/14/2018 02:32 AM, Yann Ylavic wrote:
>>>
>>> IOW, this simple patch would work equally for me (and could go in any 
>>> version):
>>>
>>> Index: util-misc/apr_reslist.c
>>> ===================================================================
>>> --- util-misc/apr_reslist.c    (revision 1829106)
>>> +++ util-misc/apr_reslist.c    (working copy)
>>> @@ -61,13 +61,13 @@ struct apr_reslist_t {
>>>  };
>>>
>>>  /**
>>> - * Grab a resource from the front of the resource list.
>>> + * Grab a resource from the back of the resource list.
>>>   * Assumes: that the reslist is locked.
>>>   */
>>>  static apr_res_t *pop_resource(apr_reslist_t *reslist)
>>>  {
>>>      apr_res_t *res;
>>> -    res = APR_RING_FIRST(&reslist->avail_list);
>>> +    res = APR_RING_LAST(&reslist->avail_list);
>>>      APR_RING_REMOVE(res, link);
>>>      reslist->nidle--;
>>>      return res;
>>> --
>>
>> Hm, but this would change this to become a fifo list instead of the current 
>> lifo list or do I miss something?
>
> Yes clearly, I suggested that reslists be changed to FIFO
> unconditionnaly, because I find that LIFO and expiry don't mix well
> w.r.t. starvation..
>
> That would be the simpler patch too (not that
> apr_reslist_acquire_fifo() is hard to implement, but I wonder who
> needs LIFO in the firtst place with such a structure...).
>

Looks like it could cause some subtle/sneaky system behavior changes.

IIUC consider  mod_dbd which may even have functional issues.
How many times should a caller call ap_dbd_open()? 1, 3, or until it
hopefully stops returning NULL?

OTOH I do agree that FIFO looks a lot more sensible as a default, but
I think that ship has sailed.

-- 
Eric Covener
cove...@gmail.com

Reply via email to