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: Sat, 04 May 2019 13:44:53 -0400 Message-ID: <87a7g2jeqy.fsf@gmail.com> References: <87y33rzalc.fsf@gmail.com> <875zqs7xe6.fsf@gmx.de> <87zho2e1cg.fsf@gmail.com> <87bm0ii3cw.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="26167"; 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 Sat May 04 19:46:12 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 1hMyjj-0006iV-GJ for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 May 2019 19:46:11 +0200 Original-Received: from localhost ([127.0.0.1]:59473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMyji-0008E3-I7 for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 May 2019 13:46:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMyjb-0008Du-O4 for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 13:46:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMyja-0000N6-J4 for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 13:46:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38652) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMyja-0000Mw-CV for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 13:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hMyja-0004pr-5R for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 13:46: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: Sat, 04 May 2019 17:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35506 X-GNU-PR-Package: emacs Original-Received: via spool by 35506-submit@debbugs.gnu.org id=B35506.155699190615067 (code B ref 35506); Sat, 04 May 2019 17:46:02 +0000 Original-Received: (at 35506) by debbugs.gnu.org; 4 May 2019 17:45:06 +0000 Original-Received: from localhost ([127.0.0.1]:52196 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMyif-0003uU-Ko for submit@debbugs.gnu.org; Sat, 04 May 2019 13:45:06 -0400 Original-Received: from mail-qk1-f180.google.com ([209.85.222.180]:33447) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMyid-0003qH-VT for 35506@debbugs.gnu.org; Sat, 04 May 2019 13:45:04 -0400 Original-Received: by mail-qk1-f180.google.com with SMTP id k189so288991qkc.0 for <35506@debbugs.gnu.org>; Sat, 04 May 2019 10:45:03 -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=nthGvw0nzDedUGLbKemOUr/CyiwFCu0Q1/QdmUdnW5o=; b=Wbn0TMMjzcyZQSr5wQgySuWbuiCl2my6qHeAbXNHm7KHjpelRxPdJQHFc36srBkAbL hg6NxOt4qwZs1HWqmsFpZg29u1L3SEwsaCL4/XL66BwWhhObzC4o6N8UPC5DhM97afoJ ycxqaSQxvc2C3O6LUwOGKjaAKidt/7zjXf19uVdc8PIGKLbUzuw1XdL4gJyMm/oAJGKv xZHW3IjIySjwfGTNGmpMrdgNeG232YZT9WsjwDsleRw8uHdlKNwsceGxVU+ytNK8hw10 tY0hnoALxuUsSLhzSJ5ywh4MY/0Ay7IsXIWw9/uKHAQFJvJovfy7e7Xlhz3qSlWz+ewJ QDdA== 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=nthGvw0nzDedUGLbKemOUr/CyiwFCu0Q1/QdmUdnW5o=; b=iWReb/5HrDOpoCiljvOq1/w8B7qcHgvyQL3RJalaOKQ2S9gPijAVgR/L3a1ZmG/kxW wzmUbu4i0taoHE0D2vq9R7I1OSoQJmWWaJfMO8c8u7PkqPxIXfhiHZaU3Benghig4NQ3 gILIvcMTxl+LJxoATcVEb5CrvmoloOCIe4eM7EP6S2mWh5z+2gEN2hCljXvhX+5jdB94 pHmON/2rsLHN6NhK/mFEuoUqmHLZAIttt1zZ4hhIBozOFqgtBzQVkZMg4wQGwAdBIk0b uA9SvDo6GM9/MUDvDwNvblO+obSgbRA4ozNJ8FfOWo/x35QHpqM2GWTaGwZ6ZSI8AxLC awYA== X-Gm-Message-State: APjAAAUjMSYM9dI9+nEilnnXWof80rcjeXLVPcQda1lb4pbpoJIyRJPz m699DN8H4UzSIkk8zbKy4f0t9T+k X-Google-Smtp-Source: APXvYqyt5qLwVOfApELalfJ8V+Tb2AnxkOXuvFHi7MB6xmtFk9d6qap09lvvdrRzRSSBldMokA8AaA== X-Received: by 2002:ae9:f30f:: with SMTP id p15mr13551739qkg.182.1556991898070; Sat, 04 May 2019 10:44:58 -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 l39sm4639588qtl.44.2019.05.04.10.44.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 May 2019 10:44:54 -0700 (PDT) In-reply-to: <87bm0ii3cw.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:158752 Archived-At: Michael Albinus writes: > John Shahid writes: > > Hi John, > >>> So your patch is correct, pls push. >> >> Thanks for reviewing the patch. Unfortunately, I don't have push access >> to the repository. Do you mind pushing the patch for me? > > Done, pushed to master. Thank you. >> 1. Asynchronously kill the process (the first patch) >> 2. Always return success, e.g. return proc. >> >> It doesn't make sense to use the default interrupt function for remote >> processes anyway, so always succeeding seems like the right thing to do >> here. This begs the question, why do we have to wait for the process >> output at all? > > Well, the caller wants to know whether `interrupt-process' succeeded. I think we are interpreting success differently in this case. My interpretation of success that the following two conditions are met: 1. The process is a remote process 2. The kill command runs successfully. In other words the signal is delivered It is up to the process to decide whether it should exit or not. For example a process could interpret SIGINT to mean dump some debugging information to the terminal. That should not affect the return value of `tramp-interrupt-process' since it achieved the goal of delivering the signal. Another data point is `internal-default-interrupt-process'. This function calls `kill' and return a success value, regardless of whether the process exits or not. The previous paragraph outlines my thought process which lead me to the change I proposed in the initial patch. >>> So we must investigate, why `interrupt-process' does not return in >>> your case. >> >> That is a good point. I didn't look deeply into why the `with-timeout' >> isn't timing out in my case. I will try to understand what is going on >> in the next few days. > > IIRC, `tramp-accept-process-output' suppresses timers. So we might > change the code to (untested) I think that explains the issue I was running into. > ;; Wait, until the process has disappeared. If it doesn't, > ;; fall back to the default implementation. > (and (tramp-accept-process-output proc 1) > ;; Report success. > proc))))) > > Does this work for you? 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. Cheers, JS