[sheepdog] [PATCH v2] sockfd_cache: close socket always when node is crashed

MORITA Kazutaka morita.kazutaka at gmail.com
Fri May 3 08:47:15 CEST 2013


At Fri, 03 May 2013 10:48:25 +0800,
Liu Yuan wrote:
> 
> On 05/03/2013 02:38 AM, MORITA Kazutaka wrote:
> > void sheep_del_sockfd(const struct node_id *nid, struct sockfd *sfd)
> >  {
> > @@ -498,8 +520,7 @@ void sheep_del_sockfd(const struct node_id *nid, struct sockfd *sfd)
> >  		return;
> >  	}
> >  
> > -	sockfd_cache_put(nid, sfd->idx);
> > -	sockfd_cache_del(nid);
> > +	sockfd_cache_close(nid, sfd->idx);
> >  	free(sfd);
> 
> No, we can't only close the fd. If !slots_all_free(), we don't remove
> nid from the cache. We should inline close operation in
> sockfd_cache_destroy().

How about keeping sockfd_cache_del() after sockfd_cache_close()?  To
close the timeout fd in sockfd_cache_destroy(), we have to add another
argument to sockfd_cache_del() that is meaningless in the case of node
change events.

Thanks,

Kazutaka



More information about the sheepdog mailing list