[sheepdog] [PATCH v3] make recovery not to retry when recover_object_from_replica() fail

Liu Yuan namei.unix at gmail.com
Wed May 30 05:32:02 CEST 2012


On 05/30/2012 10:36 AM, levin li wrote:

> +alloc:
>  	buf = malloc(buf_size);
>  	if (!buf) {
>  		eprintf("out of memory\n");
> -		rw->retry = 1;
> +		if (retry++ < MAX_RETRY) {
> +			sleep(1);
> +			goto alloc;
> +		}
>  		return -1;


is this practical? Better use xmalloc(), when it is out of memory, we'll
call try_to_free_routine() to free memory, though currently,
try_to_free_routine() calls do_nothing().

Thanks,
Yuan



More information about the sheepdog mailing list