[sheepdog] [PATCH 1/2] sheep: fix hang when IO NIC is down only

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Jan 15 15:29:42 CET 2013


At Tue, 15 Jan 2013 19:41:09 +0800,
Liu Yuan wrote:
> 
> From: Liu Yuan <tailai.ly at taobao.com>
> 
> If IO NIC is down but sheep alive, epoch isn't incremented, so we can't retry
> poll for ever.
> 
> This problem can be demonstrated by 050.
> 
> Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
> ---
>  sheep/gateway.c |   10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/sheep/gateway.c b/sheep/gateway.c
> index 2bd6e78..0870bc2 100644
> --- a/sheep/gateway.c
> +++ b/sheep/gateway.c
> @@ -149,7 +149,7 @@ static inline void pfd_info_init(struct write_info *wi, struct pfd_info *pi)
>   */
>  static int wait_forward_request(struct write_info *wi, struct request *req)
>  {
> -	int nr_sent, err_ret = SD_RES_SUCCESS, ret, pollret, i;
> +	int nr_sent, err_ret = SD_RES_SUCCESS, ret, pollret, i, repeat = 6;

A magic number should be avoided.  You should define something like
MAX_RETRY_COUNT and describe why 6 is appropriate.

Thanks,

Kazutaka



More information about the sheepdog mailing list