<div dir="ltr"><div>Hello,<br></div><br><div class="gmail_quote"><div dir="ltr">On Fri, 28 Dec 2018 at 16:22, Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I noticed many commits replacing the log messages in case of allocation<br>
failure with some macros. That is good, bringing consistency, but I<br>
think that we should offer couple of them. The current one is rather dry<br>
(meaning that it offers very few context details), which matches most of<br>
the existing log messages used in such cases.<br>
<br>
But there are also other log messages for such cases which give more<br>
details, like for what the allocation fails, some also giving the<br>
requested size of allocation.<br>
<br>
So besides the current two macros (one for shm and one for pkg), we<br>
should add few more. Like:<br>
<br>
#define PKG_MEM_ERROR_MSG(m) LM_ERR("could not allocate private memory<br>
from pkg pool - %s\n", m);<br>
<br>
So one can do:<br>
<br>
PKG_MEM_ERROR_MSG("needed for htable struct");<br>
<br>
And one to include also the size:<br>
<br>
#define PKG_MEM_ERROR_SZ(s, m) LM_ERR("could not allocate private memory<br>
from pkg pool - size: %u - %s\n", (unsigned int)s, m);<br>
<br>
No need to revert what was done, but I think for the future we would<br>
preserve better information for troubleshooting in some cases, instead<br>
of replacing those messages that now have more details with the bare<br>
error log message.<br></blockquote><div><br></div><div>I'm not sure about the benefits of adding a custom message but I see that having the requested size in the log maybe can be useful in case of a mistake in the (re)allocation.</div><div>Do you think that if the pool is exhausted, makes sense to know, with a custom log, where the reservation failed?</div><div><br></div><div>Cheers,</div><div>Victor Seva<br></div></div></div>