From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Davis Herring Newsgroups: gmane.emacs.devel Subject: Re: Emacs Hangs on Filesystem Operations on Stale NFS Date: Tue, 12 Jun 2018 11:26:55 -0600 Organization: XCP-1 Message-ID: References: <1727545582523435cab149c2bc857b40@alexander.shukaev.name> <7466e2d177e79983436af2425ceb5b54@alexander.shukaev.name> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1528824373 24654 195.159.176.226 (12 Jun 2018 17:26:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 12 Jun 2018 17:26:13 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 Cc: Noam Postavsky , Emacs developers To: Alexander Shukaev Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 12 19:26:09 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fSn3Y-0006ID-OQ for ged-emacs-devel@m.gmane.org; Tue, 12 Jun 2018 19:26:08 +0200 Original-Received: from localhost ([::1]:57638 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSn5f-00083g-SR for ged-emacs-devel@m.gmane.org; Tue, 12 Jun 2018 13:28:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSn5Z-00083L-7C for emacs-devel@gnu.org; Tue, 12 Jun 2018 13:28:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSn5U-0005v1-7W for emacs-devel@gnu.org; Tue, 12 Jun 2018 13:28:13 -0400 Original-Received: from proofpoint8.lanl.gov ([204.121.3.47]:39806) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSn5T-0005sX-Va for emacs-devel@gnu.org; Tue, 12 Jun 2018 13:28:08 -0400 Original-Received: from pps.filterd (proofpoint8.lanl.gov [127.0.0.1]) by proofpoint8.lanl.gov (8.16.0.21/8.16.0.21) with SMTP id w5CHMxYx024914; Tue, 12 Jun 2018 11:26:56 -0600 Original-Received: from mailrelay2.lanl.gov (mailrelay2.lanl.gov [128.165.4.103]) by proofpoint8.lanl.gov with ESMTP id 2jgbp1c5fp-1; Tue, 12 Jun 2018 11:26:56 -0600 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 312DAF1693D; Tue, 12 Jun 2018 11:26:56 -0600 (MDT) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay2.lanl.gov Original-Received: from bismuth.lanl.gov (bismuth.lanl.gov [128.165.246.103]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 13E25F16937; Tue, 12 Jun 2018 11:26:56 -0600 (MDT) In-Reply-To: <7466e2d177e79983436af2425ceb5b54@alexander.shukaev.name> Content-Language: en-US X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-12_01:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=956 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806120194 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 204.121.3.47 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:226269 Archived-At: > signal.alarm(3) > try: > proc = subprocess.call('stat ' + path, > shell=True, > stderr=subprocess.PIPE, > stdout=subprocess.PIPE) You're sending SIGALRM to the _parent_, not the (possibly-frozen) stat(1) child. Of course that works; you're just interrupting normal pipe I/O with (or wait(2) on) the child. Emacs can't possibly do all of its file operations in subprocesses. A complete redesign might allow the "process per tab" model used in some modern browsers, but that would break much of existing Lisp. It might just be possible to have a "file server process" that could be killed and reincarnated as needed, but I wouldn't want to promise much about performance (and support for concurrent I/O). Incidentally, don't mix call() and communicate(), and avoid "shell=True", especially when the replacement is easier: proc = subprocess.Popen(['stat', path], stderr=subprocess.PIPE, stdout=subprocess.PIPE) [From a later message:] > There are plenty of other ways why those file operations might hang. > For example, [1]. > > [1] http://unix.stackexchange.com/questions/63071/local-regular-file-causes-stat-or-ls-l-to-hang The (single, accepted) answer there says that it was an LDAP issue looking up user/group names. That's not a file operation at all. Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.