unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: John Shahid <jvshahid@gmail.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 35506@debbugs.gnu.org
Subject: bug#35506: 27.0.50; Emacs hangs while interrupting tramp processes
Date: Sat, 04 May 2019 13:44:53 -0400	[thread overview]
Message-ID: <87a7g2jeqy.fsf@gmail.com> (raw)
In-Reply-To: <87bm0ii3cw.fsf@gmx.de>


Michael Albinus <michael.albinus@gmx.de> writes:

> John Shahid <jvshahid@gmail.com> 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





  reply	other threads:[~2019-05-04 17:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30 17:06 bug#35506: 27.0.50; Emacs hangs while interrupting tramp processes John Shahid
     [not found] ` <handler.35506.B.155664402325068.ack@debbugs.gnu.org>
2019-04-30 17:28   ` bug#35506: Acknowledgement (27.0.50; Emacs hangs while interrupting tramp processes) John Shahid
2019-05-03  8:30 ` bug#35506: 27.0.50; Emacs hangs while interrupting tramp processes Michael Albinus
2019-05-04 14:33   ` John Shahid
2019-05-04 16:36     ` Michael Albinus
2019-05-04 17:44       ` John Shahid [this message]
2019-05-04 18:07         ` John Shahid
2019-05-14 18:19           ` Michael Albinus
2019-05-14 18:59             ` John Shahid
2019-05-15 14:32               ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a7g2jeqy.fsf@gmail.com \
    --to=jvshahid@gmail.com \
    --cc=35506@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).