From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: John Shahid Newsgroups: gmane.emacs.bugs Subject: bug#35506: 27.0.50; Emacs hangs while interrupting tramp processes Date: Tue, 14 May 2019 14:59:08 -0400 Message-ID: <87sgtgrhfn.fsf@gmail.com> References: <87y33rzalc.fsf@gmail.com> <875zqs7xe6.fsf@gmx.de> <87zho2e1cg.fsf@gmail.com> <87bm0ii3cw.fsf@gmx.de> <87a7g2jeqy.fsf@gmail.com> <878svmjdp6.fsf@gmail.com> <87lfz8j3ug.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="28916"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: 35506@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 14 21:00:14 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQcep-0007Ll-Mr for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 May 2019 21:00:11 +0200 Original-Received: from localhost ([127.0.0.1]:52699 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQcen-00064K-UZ for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 May 2019 15:00:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQceh-00064C-TK for bug-gnu-emacs@gnu.org; Tue, 14 May 2019 15:00:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQceg-0003fD-Ur for bug-gnu-emacs@gnu.org; Tue, 14 May 2019 15:00:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36336) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hQceg-0003eh-QY for bug-gnu-emacs@gnu.org; Tue, 14 May 2019 15:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hQceg-0002OE-Jh for bug-gnu-emacs@gnu.org; Tue, 14 May 2019 15:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: John Shahid Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 May 2019 19:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35506 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 35506-submit@debbugs.gnu.org id=B35506.15578603599112 (code B ref 35506); Tue, 14 May 2019 19:00:02 +0000 Original-Received: (at 35506) by debbugs.gnu.org; 14 May 2019 18:59:19 +0000 Original-Received: from localhost ([127.0.0.1]:49880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQcdz-0002Mt-4z for submit@debbugs.gnu.org; Tue, 14 May 2019 14:59:19 -0400 Original-Received: from mail-qt1-f171.google.com ([209.85.160.171]:43256) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQcdx-0002Mg-GI for 35506@debbugs.gnu.org; Tue, 14 May 2019 14:59:17 -0400 Original-Received: by mail-qt1-f171.google.com with SMTP id i26so262890qtr.10 for <35506@debbugs.gnu.org>; Tue, 14 May 2019 11:59:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=O+dg3HKR6gK9tBpYNlU12YHO+FIeAuWPFTlrO+p23G0=; b=tB+Wt+nZjAFHoSibq0vnFlS7OBLZ00yD3c+7N/WdB/debAQmpHICSE1Pj61+8SZVXX RsJrq/JMY0/akKvL2Zfy8pbiR+G2Hh+mz2F1PMhOgrDacgAitQRC/CPoir+upJtbmaPT Fo+pXutq/Jbgz9RdSkV2gKVvLN5FAKlvdDa59L+BRlTI9YNzRXIHxuRxS9WKlSOEwri5 7L4lwN0CogT1ODTNIHxU6eDlCW0yfdKPhetmNylYGtuZVtspfWiXFwwmCHDEcVAGYDw0 QQ3CKemjZgujLQAcpTkGf6Ir6MB20lctJ4Apuo2FbxupLJ+PcOO+uU8iNzXFAvYP3q9R EyqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=O+dg3HKR6gK9tBpYNlU12YHO+FIeAuWPFTlrO+p23G0=; b=FeQMKYpGqOB1B57LO9TmFMC/P9F33pxUbZRRA47yM+DeQ9o2HWGQqlvNcdDnfe0IwM 37ma373o009Y1k7KjMH2jqRBM9DZ1WBdHp0TxjRdN4YQd54GKRWC8cGqLKxtKtP0x/tO ze4pXdHV+ErO/LNi33Y0Bw5kjDl0famURLDFNUvJOEHYjsVbX9jwWXZuEbsdcNETDjc0 QnSZXqju/a0CsrweW6lk1FnP5X5NY5pKYjqnfX68oGZ43S3aL2FSlnlZJ+MELtE2vONj 1Voh96NsMlbuzvI5XkGZUlqhaKLLATXey186FfGbLIaP3mEUp1V9ay7CjPE8GcnriqtI T2hA== X-Gm-Message-State: APjAAAW+qPxAfAaPQ54ALbV9oJXyHoTPATC/CM0Zt4piQbavltuAumKl IIJPWdiu0fwZ2a4FgjaXbzzGfNO6 X-Google-Smtp-Source: APXvYqy3GkYcTlpuEyT5nDllzdBFrrwSN+bLwY4nLtJ0ZH8LroPft11EHSovQBfmzTMdR0ZClqSaaA== X-Received: by 2002:ac8:e81:: with SMTP id v1mr31787654qti.16.1557860351323; Tue, 14 May 2019 11:59:11 -0700 (PDT) Original-Received: from amun (cpe-104-162-85-46.nyc.res.rr.com. [104.162.85.46]) by smtp.gmail.com with ESMTPSA id e25sm5541547qta.18.2019.05.14.11.59.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 11:59:09 -0700 (PDT) In-reply-to: <87lfz8j3ug.fsf@gmx.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:159287 Archived-At: --=-=-= Content-Type: text/plain Michael Albinus writes: > John Shahid writes: > > Hi John, > >>> I will test it out tomorrow morning. I still prefer not waiting at all. >>> I am not sure if the 1 second wait will be noticeable or not, but we >>> wouldn't know until I try it out. >> >> I just tried that patch and it fixed the issue. The 1 second timeout >> isn't noticeable at all. I'm happy to create a patch and attach it to >> the bug report. > > Could it be that we're waiting on each other? Do you plan to contribute > a patch, or shall I do? Indeed. I went ahead and created the patch. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Avoid-infinitly-looping-in-tramp-interrupt-process.patch >From 418048bb52188a747acab6349a71c42c4ceebe2b Mon Sep 17 00:00:00 2001 From: John Shahid Date: Mon, 29 Apr 2019 16:10:47 -0400 Subject: [PATCH] Avoid infinitly looping in tramp-interrupt-process * lisp/net/tramp.el (tramp-interrupt-process): Remove with-timeout. Instead pass a timeout to tramp-accept-process-output. tramp-accept-process-output stops timers from running which makes the with-timeout ineffective. --- lisp/net/tramp.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 0a3129fd45..2aa62eba80 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4861,10 +4861,9 @@ tramp-interrupt-process (format "kill -2 -%d" pid)) ;; Wait, until the process has disappeared. If it doesn't, ;; fall back to the default implementation. - (with-timeout (1 (ignore)) - (while (tramp-accept-process-output proc)) - ;; Report success. - proc))))) + (and (tramp-accept-process-output proc 1) + ;; Report success. + proc))))) ;; `interrupt-process-functions' exists since Emacs 26.1. (when (boundp 'interrupt-process-functions) -- 2.21.0 --=-=-=--