unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Thomas Koch <thomas@koch.ro>
Cc: 61350@debbugs.gnu.org
Subject: bug#61350: Eglot over Tramp freezes with large project
Date: Fri, 17 Feb 2023 10:54:15 +0100	[thread overview]
Message-ID: <87r0uo7h2w.fsf@gmx.de> (raw)
In-Reply-To: <1163788660.69273.1675787581764@office.mailbox.org> (Thomas Koch's message of "Tue, 7 Feb 2023 18:33:01 +0200 (EET)")

Thomas Koch <thomas@koch.ro> writes:

Hi Thomas,

> I've reproduced the problem with Emacs 27.1 from Debian and a minimal
> Emacs 28.2. installed via nixpkg. The follwing describes a hopefully
> reliable reproduction.
>
> 1. Have a client system with Emacs + eglot and an SSH server.
>
> 2. On the server:
>
>   git clone --depth 1 --no-tags --single-branch \
>       -b eglot-tramp-freeze-repro \
>       https://github.com/thkoch2001/yacy_search_server
>
> 3. On the server download and untar
>    https://download.eclipse.org/jdtls/milestones/1.19.0/jdt-language-server-1.19.0-202301171536.tar.gz
>
> 4. Still on server make a symlink from ~/bin/jdtls to bin/jdtls from the
> tarball.
>
> 5. Install eglot and use this emacs config on client:
>
> (custom-set-variables
>  '(tramp-remote-path
>    '("/run/current-system/sw/bin" "/bin" "/usr/bin" "/sbin" "/usr/sbin" "/usr/local/bin" "/usr/local/sbin" "/local/bin" tramp-own-remote-path))
>  '(tramp-use-ssh-controlmaster-options nil)
> ;; problem exists also without previous line
> )
>
> 6. Open source/net/yacy/yacy.java over Tramp with ssh:
>
> 7. M-x eglot

Thanks for the concise recipe. Since I have used a virgin Ubuntu VM as
test target, one additional step is needed: Install Java.

> Freeze should happen after a few seconds.

Yep, I could reproduce it with both Emacs 29.0.60 and 30.0.50. And the
backtrace is

--8<---------------cut here---------------start------------->8---
  backtrace()
  tramp-error((tramp-file-name "ssh" nil nil "ubuntu-2204" nil "/home/albinus/src/yacy_search_server/examples/Simp..." nil) quit "")
  tramp-signal-hook-function(quit nil)
  accept-process-output(#<process *tramp/ssh ubuntu-2204*> nil nil t)
  tramp-accept-process-output(#<process *tramp/ssh ubuntu-2204*>)
  tramp-wait-for-regexp(#<process *tramp/ssh ubuntu-2204*> nil "\\(?:^\\|\0\\)\\(?:[^\n#$]*///3f62f1d55bd34cba7fe730c633...")
  tramp-wait-for-output(#<process *tramp/ssh ubuntu-2204*>)
  tramp-send-command((tramp-file-name "ssh" nil nil "ubuntu-2204" nil "/home/albinus/src/yacy_search_server/examples/Simp..." nil) "\\readlink --canonicalize-missing /home/albinus/src...")
  tramp-send-command-and-check((tramp-file-name "ssh" nil nil "ubuntu-2204" nil "/home/albinus/src/yacy_search_server/examples/Simp..." nil) "\\readlink --canonicalize-missing /home/albinus/src...")
  tramp-sh-handle-file-truename("/ssh:ubuntu-2204:/home/albinus/src/yacy_search_ser...")
  apply(tramp-sh-handle-file-truename "/ssh:ubuntu-2204:/home/albinus/src/yacy_search_ser...")
  tramp-sh-file-name-handler(file-truename "/ssh:ubuntu-2204:/home/albinus/src/yacy_search_ser...")
  apply(tramp-sh-file-name-handler file-truename "/ssh:ubuntu-2204:/home/albinus/src/yacy_search_ser...")
  tramp-file-name-handler(file-truename "/ssh:ubuntu-2204:/home/albinus/src/yacy_search_ser...")
  file-truename("/ssh:ubuntu-2204:/home/albinus/src/yacy_search_ser...")
  find-buffer-visiting("/ssh:ubuntu-2204:/home/albinus/src/yacy_search_ser...")
  #f(compiled-function (arg1 arg2 &rest rest) "Handle notification publishDiagnostics." #<bytecode 0x5bbf29480580234>)(#<eglot-lsp-server eglot-lsp-server-bfebda> textDocument/publishDiagnostics :uri "file:///home/albinus/src/yacy_search_server/exampl..." :diagnostics [])
  apply(#f(compiled-function (arg1 arg2 &rest rest) "Handle notification publishDiagnostics." #<bytecode 0x5bbf29480580234>) #<eglot-lsp-server eglot-lsp-server-bfebda> textDocument/publishDiagnostics (:uri "file:///home/albinus/src/yacy_search_server/exampl..." :diagnostics []))
  eglot-handle-notification(#<eglot-lsp-server eglot-lsp-server-bfebda> textDocument/publishDiagnostics :uri "file:///home/albinus/src/yacy_search_server/exampl..." :diagnostics [])
  apply(eglot-handle-notification #<eglot-lsp-server eglot-lsp-server-bfebda> textDocument/publishDiagnostics (:uri "file:///home/albinus/src/yacy_search_server/exampl..." :diagnostics []))
  #f(compiled-function (server method params) #<bytecode -0xa39f6ed8241f361>)(#<eglot-lsp-server eglot-lsp-server-bfebda> textDocument/publishDiagnostics (:uri "file:///home/albinus/src/yacy_search_server/exampl..." :diagnostics []))
  jsonrpc-connection-receive(#<eglot-lsp-server eglot-lsp-server-bfebda> (:jsonrpc "2.0" :method "textDocument/publishDiagnostics" :params (:uri "file:///home/albinus/src/yacy_search_server/exampl..." :diagnostics [])))
  jsonrpc--process-filter(#<process EGLOT (yacy_search_server/(java-mode java-ts-mode))> "pc\":\"2.0\",\"method\":\"$/progress\",\"params\":{\"token\":...")
--8<---------------cut here---------------end--------------->8---

The problem is clear. We are in jsonrpc--process-filter (accepting process
output). This runs eglot-handle-notification, and that runs
file-truename. The latter needs to check remote, so Tramp sends a remote
command, and waits for that output (calling accept-process-output again).

Since jsonrpc always accepts output from *all* running processes, there
could be (and is!) the constellation, that process output has been read
already, and Tramp didn't get it, waiting for the output forever. I
could mitigate the problem partly by changing the arguments of
accept-process-output in jsonrpc-request, and eglot could work
successfully, sometimes. And sometimes not. And even then, I ran into
the famous "Forbidden reentrant call" error, see bug#60534.

I will continue to investigate, but after playing with this for some
days, I feel we must add threads to Tramp, when there are several
concurrent processes. I've tried this already some years agao, and I
failed. Maybe it is time now for a new attempt.

Best regards, Michael.





  reply	other threads:[~2023-02-17  9:54 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07 16:33 bug#61350: Eglot over Tramp freezes with large project Thomas Koch
2023-02-17  9:54 ` Michael Albinus [this message]
2023-02-17 10:33   ` Thomas Koch
2023-02-18 11:10     ` Thomas Koch
2023-02-18 12:07       ` Michael Albinus
2023-02-23 11:55         ` Thomas Koch
2023-02-25 14:36           ` Michael Albinus
2023-02-23 12:17 ` João Távora
2023-02-23 14:18   ` João Távora
2023-02-23 14:47     ` Thomas Koch
2023-02-23 15:22       ` João Távora
2023-02-24 17:19         ` Michael Albinus
2023-02-24 17:45           ` João Távora
2023-02-25 14:27             ` Michael Albinus
2023-02-25 23:09               ` João Távora
2023-02-26 10:24                 ` Thomas Koch
2023-02-26 15:58                   ` Michael Albinus
2023-02-26 17:23                 ` Michael Albinus
2023-02-26 21:13                   ` João Távora
2023-02-26 21:45                     ` João Távora
2023-02-27  7:53                       ` Michael Albinus
2023-02-27  9:42                         ` João Távora
2023-02-27 20:11                           ` Michael Albinus
2023-02-27  7:47                     ` Michael Albinus
2023-02-27  9:35                       ` João Távora
2023-02-27 20:10                         ` Michael Albinus
2023-02-28  0:10                           ` João Távora
2023-02-28 10:38                             ` Michael Albinus
2023-02-28 11:33                               ` João Távora
2023-02-28 12:59                                 ` Michael Albinus
2023-02-28 14:41                                   ` João Távora
2023-02-28 14:18                             ` Michael Albinus
2023-02-28 14:51                               ` João Távora
2023-02-28 15:01                                 ` Michael Albinus
2023-02-28 17:55                                   ` Thomas Koch
2023-03-01 14:10                                     ` João Távora
2023-03-01 16:19                                       ` João Távora
2023-03-02 11:01                                       ` Michael Albinus
2023-03-02 11:22                                         ` João Távora
2023-03-02 11:50                                           ` Michael Albinus
2023-03-05 11:21                                           ` Michael Albinus
2023-03-05 11:45                                             ` Thomas Koch
2023-03-05 12:23                                               ` Michael Albinus
2023-03-07 12:49                                                 ` Michael Albinus
2023-03-07 13:04                                                   ` Thomas Koch
2023-03-07 13:33                                                     ` João Távora
2023-03-07 13:52                                                       ` Michael Albinus
2023-03-07 14:03                                                         ` João Távora
2023-03-07 14:31                                                           ` Michael Albinus
2023-03-11  9:00                                                             ` Michael Albinus
2023-03-11 10:14                                                               ` Thomas Koch
2023-03-11 11:47                                                                 ` João Távora
2023-03-11 12:27                                                                 ` Michael Albinus
2023-03-11 11:42                                                               ` João Távora
2023-03-11 12:44                                                                 ` Michael Albinus
2023-03-11 14:01                                                                   ` João Távora
2023-03-11 14:25                                                                     ` Michael Albinus
2023-03-12  0:48                                                                       ` João Távora
2023-03-12 10:22                                                                         ` Michael Albinus
2023-03-14 11:01                                                                           ` Michael Albinus
2023-03-14 15:00                                                                             ` Michael Albinus
2023-03-14 15:19                                                                               ` João Távora
2023-03-14 15:42                                                                                 ` Michael Albinus
2023-03-15 17:47                                                                                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-15 18:05                                                                                     ` João Távora
2023-03-15 18:30                                                                                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-15 19:44                                                                                         ` João Távora
2023-03-15 20:14                                                                                           ` João Távora
2023-03-15 21:34                                                                                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-15 21:55                                                                                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-16 13:28                                                                                               ` João Távora
2023-03-18 12:34                                                                                               ` Michael Albinus
2023-03-15 21:43                                                                                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-15 21:49                                                                                             ` João Távora
2023-03-16  6:24                                                                                               ` Jim Porter
2023-03-16 13:25                                                                                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-16 13:28                                                                                                 ` João Távora
2023-03-16 15:58                                                                                                   ` João Távora
2023-03-16 20:36                                                                                                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-16 22:04                                                                                                       ` João Távora
2023-03-07 13:47                                                     ` Michael Albinus
2023-03-06 12:42                                             ` Michael Albinus
2023-03-06 13:45                                               ` João Távora
2023-03-06 13:42                                             ` João Távora
2023-03-02 10:40                                     ` Michael Albinus
2023-02-28 19:37                                   ` João Távora
2023-03-01  8:44                                     ` Michael Albinus
2023-03-01 11:15                                       ` João Távora
2023-03-01 10:46                                 ` Gregory Heytings
2023-03-01 11:08                                   ` João Távora
2023-03-01 11:23                                     ` Gregory Heytings
2023-03-01 11:37                                       ` João Távora
2023-03-01 14:51                                         ` Michael Albinus
2023-03-01 15:02                                           ` Gregory Heytings
2023-04-24  1:44 ` Aaron Madlon-Kay
2023-05-05 11:32   ` Michael Albinus
2023-05-05 13:14     ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-05 14:53       ` 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=87r0uo7h2w.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=61350@debbugs.gnu.org \
    --cc=thomas@koch.ro \
    /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).