apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chad Fox" <c...@gigapogo.com>
Subject Re: APR failing in low memory situations
Date Fri, 23 Feb 2007 18:56:27 GMT
On Thu, February 22, 2007 5:11 pm, M Joonas Pihlaja wrote:
> On Thu, 22 Feb 2007, Bill Stoddard wrote:
>> M Joonas Pihlaja wrote:
>>> However, I fear the ripple effect
>> No kidding :-)  If your app has exhausted memory, your reduced to
>> playing a never ending game of 'whack-a-mole' by attempting to tolerate
>> all of the ensuing 'bad stuff' that happens.
> Well... it's only 'bad stuff' if you didn't see it coming. ;)

I'm in Joonas' camp here.

If you had an application that allows users/requests to utilize seperate
sets of resources and user X got carried away and ate up a huge chunk of
memory, it's possible users A-Y are still chewing away at the resources
already allocated to them and won't be in trouble yet.

I'd rather play 'whack-a-mole' tearing down user X's resources and tell
him tough luck, rather than bringing down the entire system.  The abort
functions could work for that, but what if you just want to tell user X he
can't have more resources and let him continue?

I haven't looked at all the places where palloc is called in apr, but it
seems like in the cases of hashes, tables, arrays, etc. it would be easy
enough to add a return status as most of them have a void return.  But,
what is worse, an app that gets a segfault or one that doesn't check the
status and incorrectly assumes the apr_hash_set worked?  (i.e. "Don't
launch the missles" = true)


View raw message