emacs-async icon indicating copy to clipboard operation
emacs-async copied to clipboard

Process has died

Open cjohansson opened this issue 6 years ago • 8 comments

Hi! Thanks for a great repo. I have made a integration with it in my project emacs-ssh-deploy and this enabled asynchronous download, upload, diff processes. But if I for instance have multiple asynchronous procesess running via async.el many times I get the message Process has died, do you know why? It almost seems like it only works with one asynchronous process at a time but I am not sure.

cjohansson avatar May 24 '18 05:05 cjohansson

Interesting, I think adding some logging might help you to track this down.

jwiegley avatar May 28 '18 19:05 jwiegley

You may already be aware of this, but I thought I would mention in case it helps. I ran into a similar issue when integrating a private library of mine with async. For me the fix was to aggressively remove all output from the asynchronous process. Even (setq inhibit-message t) in the other process was not enough, just one stray message would lead to crashes.

On May 28, 2018, at 2:47 PM, John Wiegley [email protected] wrote:

Interesting, I think adding some logging might help you to track this down.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

articuluxe avatar Jun 01 '18 20:06 articuluxe

I see, thanks for the tip, I’ll try that

cjohansson avatar Jun 01 '18 21:06 cjohansson

I think I just run into this problem.

First thing I noticed is (setq async--procvar …) that lead me to a bunch of defvar (global variables). ~~The use of global variables (or even buffer local variables) is likely to be the root of this issue~~ see https://github.com/jwiegley/emacs-async/issues/98#issuecomment-643379502.

I can translate these variables into unmutable let clauses (which will end up into closure-capturing of values) ~~and the problem is most likely to go away~~. Will pull up a PR if @jwiegley is willing to accept.

FelipeLema avatar Jun 02 '20 20:06 FelipeLema

@cjohansson I think the problem lies somewhere around tramp setting the ControlMaster option, probably a race condition between separate ssh processes that test/create the control master socket

try the following

(async-start
     `(lambda ()
        (let ((tramp-use-ssh-controlmaster-options nil))
          ;; …
          ))
     ;; …
     )

FelipeLema avatar Jun 11 '20 15:06 FelipeLema

worth mentioning: using defvar doesn't look like the root of the issue.

I thought that there was a race condition between a master Emacs process and a worker Emacs process dying. The fact is that the "Process has died" is an error in tramp that happens in the worker process that is correctly forwarded back to the master process.

FelipeLema avatar Jun 12 '20 16:06 FelipeLema

Just want to add that this doesn’t happen when running tramp in multiple threads, it only happens with multiple processes.. maybe it’s an Emacs issue

cjohansson avatar Jun 28 '20 19:06 cjohansson

@cjohansson did setting tramp-use-ssh-controlmaster-options to nil work for you? I haven't bumped into this error since I started setting it.

FelipeLema avatar Jul 03 '20 17:07 FelipeLema