---

** [tickets:#1269] IMM: Library side behavior at failure to allocatge memory 
needs to be consistent**

**Status:** unassigned
**Milestone:** future
**Created:** Tue Mar 17, 2015 10:24 AM UTC by Anders Bjornerstedt
**Last Updated:** Tue Mar 17, 2015 10:24 AM UTC
**Owner:** nobody

The IMM library/agent side (IMMA) should behave consistently and follow
a consistent coding pattern for dealing with the case of failure to allocate
memory.

The IMMA library is linked with an application process that is using the IMM
service. Failure to allocate memory is rare and means that the the processor
where the application is executing is overloaded. Because the IMMA library is
hosted by a an application, there is some merrit in returning control to the
application letting it decide how to escalate. This is "nice" towards the 
application, making troubleshooting simpler for those responsible for the
application. 

In terms coding, the simplest solution possible should be used. The allowed
solutions in coding on the IMM library/agent side should be:

a) Return SA_AIS_ERR_NO_MEMORY
b) osafassert the pointer after malloc/calloc/strdup....
c) Nothing, i.e. segv at the next dereference.

where (a) is recommended when the allocation error occurs close to the API;
(b) is recommended in deeper levels of function invocation; 
(c) is allowed in legacy library code, but should be avoided in new/updated 
code.

We need to allow (c) in the agent/library, otherwise this ticket would be a 
defect
ticket.

Writing explict if statements checking for null and writing explicit customized
syslog error messages, or trace messages is not allowed in the library for the
memory allocation failure case. Osafassert does write to the syslog but that
is allowed exception here. 



---

Sent from sourceforge.net because [email protected] is 
subscribed to https://sourceforge.net/p/opensaf/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/opensaf/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Opensaf-tickets mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets

Reply via email to