From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Juanma Barranquero" Newsgroups: gmane.emacs.devel Subject: Re: error in server-running-p on M$ Date: Sat, 22 Nov 2008 17:04:57 +0100 Message-ID: References: <18728.4982.765983.511070@a1ihome1.kph.uni-mainz.de> <18728.5963.672940.47287@a1ihome1.kph.uni-mainz.de> <18728.9899.815004.638335@a1ihome1.kph.uni-mainz.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1227369920 7073 80.91.229.12 (22 Nov 2008 16:05:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Nov 2008 16:05:20 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: "Ulrich Mueller" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 22 17:06:21 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L3uzy-0003hu-1a for ged-emacs-devel@m.gmane.org; Sat, 22 Nov 2008 17:06:18 +0100 Original-Received: from localhost ([127.0.0.1]:50000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3uyp-0007Li-23 for ged-emacs-devel@m.gmane.org; Sat, 22 Nov 2008 11:05:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L3uyi-0007La-Sf for emacs-devel@gnu.org; Sat, 22 Nov 2008 11:05:00 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L3uyh-0007Kq-9u for emacs-devel@gnu.org; Sat, 22 Nov 2008 11:05:00 -0500 Original-Received: from [199.232.76.173] (port=40901 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3uyh-0007Kk-7I for emacs-devel@gnu.org; Sat, 22 Nov 2008 11:04:59 -0500 Original-Received: from an-out-0708.google.com ([209.85.132.243]:4391) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L3uyg-0003f2-NZ for emacs-devel@gnu.org; Sat, 22 Nov 2008 11:04:58 -0500 Original-Received: by an-out-0708.google.com with SMTP id c38so626724ana.21 for ; Sat, 22 Nov 2008 08:04:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=aIJGd5G6tSIA6tCkgAvL+f2eCm29/mNt+NdyuLA6Kxg=; b=NylNHz6XpPMDr+FTY+w8igdPtRdnMp/Di9QsHUVNjO8LpLi1tkFVk9C2jtmXYC/l6c wTQpcgSkd3a+moq3aaEqlT9uIghwAheuyYVFscXuHdYWVAJF+IpsqHj/HV8erHIr9T3t f7UkasB402aSKn3NWv/4ifpvgM0Jaz6ybSKtM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=oiYkjiUAc4FqWlRCgxELxmSHEcqonwyL8IuJBie6a+FUl1Al8CDivQqRfUJ3CnQO6D jKkGeJLYk7tTwrNhSCWt6TjHqBUYJSWvvUzQ1M7uZW2KzW02kSFmqVgcYjh+6R9TyLtd RgrlYk1MIfU0u9xwfDk11HoPdHOPY2cNk8rKY= Original-Received: by 10.100.46.10 with SMTP id t10mr756024ant.136.1227369897666; Sat, 22 Nov 2008 08:04:57 -0800 (PST) Original-Received: by 10.100.13.13 with HTTP; Sat, 22 Nov 2008 08:04:57 -0800 (PST) In-Reply-To: <18728.9899.815004.638335@a1ihome1.kph.uni-mainz.de> Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:105960 Archived-At: On Sat, Nov 22, 2008 at 16:35, Ulrich Mueller wrote: > As an example: The auth file is on an NFS mounted filesystem, and the > Emacs server is running on the machine of the NFS server. You're approaching my original question: what is the intended use of `server-running-p', and how do we want it to work when different instances of Emacs use different server setups. Of course there is no problem in having several servers, even on the same machine. The problem is one hiding the other. For your case to be a problem, you must be starting a server in the local machine set up such its authentication file clobbers the one on the NFS server. That is one instance of the problem I discussed, but you don't need such a complicate setup. Just start a local TCP server, and then another with the same server name. Lo, you just rendered the first one inaccessible. > How would assigning a random port number help here? > With the proposed test, server-running-p will return nil in this case, > since it will find an auth file but no associated Emacs process. It only will do that if the current, local server is trying to write an authentication file in the NFS server. Else, it won't even *find* the authentication file, so it will write its own, and start a new, local server with a random port that won't collide with the NFS server's Emacs server. Still, the point is, either we try to do a complicate, potentially-network-delaying check, or we opt for a simple, not-totally-reliable check. I don't mind one way or the other (though I won't be writing the complex one), but we should bear in mind that even if the check fails, consequences are hardly catastrophic. Currently we don't even check, just clobber the auth file. So any partial fix is a net benefit, as long as we rename the function and/or write a clear docstring stating that it cannot be assumed to be a reliable indicator of the presence of another Emacs instance. Juanma