iceoryx icon indicating copy to clipboard operation
iceoryx copied to clipboard

MemoryManager should not call errorHandler when the requested chunk size is too large

Open elfenpiff opened this issue 2 years ago • 1 comments

Required information

When acquiring a too large chunk via the publisher so that no mempool is available the memory manager calls the error handler despite having a fitting enum value to return - AllocationError::RUNNING_OUT_OF_CHUNKS.

Maybe we could also add a new enum value called AllocationError::CHUNK_SIZE_TOO_LARGE and return this to the user. There is no need to call the error handler.

We already return an error enum instead of a call to the errorHandler when running out of chunks so we should be consistent.

elfenpiff avatar Feb 16 '22 17:02 elfenpiff

@elfenpiff this comes from a code base which was created before we had the expected and it seems afterwards we decided that if we are never able to return a chunk it would be best to just terminate. Maybe it's not the best option nowadays.

elBoberido avatar Feb 16 '22 18:02 elBoberido

@elfenpiff according to the code we already have an error code for a request for a chunk which is larger than any available mempool can hold.

I would argue that it is a programming error when such a chunk is requested since it will never succeed. I would keep the behavior as is and close the issue. What do you think?

elBoberido avatar Oct 26 '23 20:10 elBoberido

We keep the current behavior

elBoberido avatar Nov 16 '23 16:11 elBoberido