So this is the code you're hitting:
packet->data= static_cast<char>(realloc(NULL, packet->data_size));
if (not packet->data)
{
// Server up the memory error first, in case _connection_close()
// creates any.
gearmand_merror("realloc", char, packet->data_size);
_connection_close(connection);
return GEARMAND_MEMORY_ALLOCATION_FAILURE;
}
</char>
Earlier in the code, there's a guard for 0-length data, so according to the man page of realloc, a NULL return means memory allocation failed. My guess is that you have very large job payloads, and sometimes your server cannot allocate memory. If I had to guess why I'd say it's due to ulimits. Perhaps raise your ulimit to allow more memory to be allocated at once. Whenever this is happening, gearmand is closing the connection with the client.
So, to be clear, yes this is a real error. There's not really anything I think we can do in gearmand to avoid this, but please do feel free to reopen this if you feel that there's more to consider.