[Tarantool-patches] [PATCH v7 2/5] box/applier: add missing diag_set on region_alloc failure
Cyrill Gorcunov
gorcunov at gmail.com
Wed Feb 5 10:46:55 MSK 2020
On Wed, Feb 05, 2020 at 01:15:56AM +0300, Konstantin Osipov wrote:
> * Sergey Ostanevich <sergos at tarantool.org> [20/02/03 17:42]:
> > Hi!
> >
> > Thanks for the patch!
> >
> > LGTM.
>
> This code is dead actually. There is no region quota and OOM is
> impossible here. We haven't had a policy to check these errors
> before.
>
> No harm in pushing it, but no value either.
Wait, region_alloc (as other slab related functions) are using
malloc call on low level (see slab_get_large) thus there is
no guarantee that NULL won't be ever returned, moreover malloc
interface never claimed that NULL will be returned iif there
no free memory in the system (actually this is not how malloc
works now but api points explicitly that we should be ready
for NULL and handle it properly).
IOW I think we should handle NULLs to be stable in long terms.
More information about the Tarantool-patches
mailing list