From: "Talpey, Thomas" Subject: Re: [NFS] [PATCH 3/7] SUNRPC: Allow the client to detect if the TCP connection is closed Date: Fri, 09 Nov 2007 12:52:30 -0500 Message-ID: References: <20071107003834.13713.73536.stgit@heimdal.trondhjem.org> <20071107003950.13713.24126.stgit@heimdal.trondhjem.org> <1194618806.7459.44.camel@heimdal.trondhjem.org> <1194619730.7459.48.camel@heimdal.trondhjem.org> <1194622369.7459.52.camel@heimdal.trondhjem.org> <1194629839.7459.61.camel@heimdal.trondhjem.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: nfsv4@linux-nfs.org, Chuck Lever , nfs@lists.sourceforge.net To: Trond Myklebust Return-path: In-Reply-To: <1194629839.7459.61.camel@heimdal.trondhjem.org> References: <20071107003834.13713.73536.stgit@heimdal.trondhjem.org> <20071107003950.13713.24126.stgit@heimdal.trondhjem.org> <1194618806.7459.44.camel@heimdal.trondhjem.org> <1194619730.7459.48.camel@heimdal.trondhjem.org> <1194622369.7459.52.camel@heimdal.trondhjem.org> <1194629839.7459.61.camel@heimdal.trondhjem.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: nfsv4-bounces@linux-nfs.org Errors-To: nfsv4-bounces@linux-nfs.org List-ID: At 12:37 PM 11/9/2007, Trond Myklebust wrote: >> Correct. And even if were sent, the FINWAIT1 state does not mean the >> peer has transitioned. You need to see the ACK (which often comes in >> the same packet as the peer's FIN). > >That is really of no direct concern to the RPC client. The important >thing for us is to clear the XPRT_CONNECTED flag in order to indicate >that the socket will no longer accept further requests, and we want to >set XPRT_CLOSING in order to tell anybody who tries to reconnect that >they need to wait. Well, my concern is that the XPRT_CLOSING bit set may be delayed due to network issues. What happens if a second task discovers the client while it's pending? That's all. >> All this is a gawd-awful layering violation, you know. :-) > >I disagree. This is exactly the same thing as using poll() to monitor >the state of the socket in userland. But but but... poll() can't detect FIN_WAIT_1. It can only detect EOF, i.e. CLOSE. I don't think this code could be implemented in userspace. Here's my bottom line - if the RPC client is provably more correct with this detail of the TCP state, then it's fine. I do think however that it's unnecessary, i.e. the code can work without this, and simply set the bits when the shutdown() is initiated. Tom.