[sheepdog] [PATCH] collie: cleanup callbacks of collie command when they send header only requests

Yunkai Zhang yunkai.me at gmail.com
Fri Jul 27 06:37:21 CEST 2012


On Fri, Jul 27, 2012 at 11:35 AM, Liu Yuan <namei.unix at gmail.com> wrote:
> On 07/27/2012 11:22 AM, Yunkai Zhang wrote:
>> The top code, such as cluster_shutdown/cluster_recover/..., need to
>> use -1 and 1 to distinguish two error types:
>> 1) failed to connect or failed to call exe_req()
>> 2) success to call exe_re(), but the response's result isn't SD_RES_SUCCESS.
>
> These two cases handling can be done in send_light_req(). why bother
> propagate it to upper code? Eorror handling (eprintf) inside the

I just want to keep the new code consistent with the original version.

The upper code, such as cluster_shutdown, will return different EXIT
code(EXIT_SYSFAIL or EXIT_FAILURE) to user according different error
type.

Does user care about this EXIT code? If not, I'm not against to change
send_light_req().

> send_light_req() will make the code more simpler. -1 to indicate for
> error case is enough for upper code.
>
> Thanks,
> Yuan
>
>
>
>



-- 
Yunkai Zhang
Work at Taobao



More information about the sheepdog mailing list