On Fri, Jul 6, 2012 at 7:14 PM, Liu Yuan <[email protected]> wrote: > On 07/06/2012 06:56 PM, Yunkai Zhang wrote: >>> Better assign fd = -1 in unregister_event() and then we can check it >> No, this fd need to be closed by destroy_client() when ci->refcnt become >> zero. >> > > If fd is dead connection, why not we close it as soon as possible?
I have ever wanted to close it directly, but I found that this fd is inflight, then worker thread may use it at the same time. If we close it directly, the value of this fd maybe reused by system, then worker thread may use wrong fd to do something (at least we now have no rule to prevent worker thread using it). > > Thanks, > Yuan > -- Yunkai Zhang Work at Taobao -- sheepdog mailing list [email protected] http://lists.wpkg.org/mailman/listinfo/sheepdog
