Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #859: Force Eglot over Tramp to use a seperate channel #1020

Closed
wants to merge 1 commit into from

Conversation

jeslie0
Copy link

@jeslie0 jeslie0 commented Aug 26, 2022

This fixes #859. Emacs hanging and giving reentrant issues was caused by Eglot sending information over the same SSH connection that Emacs uses. When lots of data is being sent to or from the remote language server, the connection gets sluggish. The solution is to disable ControlMaster for Eglot, which causes it to make a new connection.

The downside is that the user might be prompted for the remote password, since a new SSH connection is being spawned.

An improvement could be to make a custom variable so the user can select if they want Eglot to run on a separate connection. For some language servers, it might not be worth having a separate connection?

Comment on lines +1150 to +1151
(tramp-use-ssh-controlmaster-options t)
(tramp-ssh-controlmaster-options "-o ControlMaster=no"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these variables meant to be let-bound? AFAIK, Tramp creates a pool of ssh connections and reuses them as needed. So this particular call to make-process may reuse an existing connection, in which case these extra arguments to ssh will not be in effect. It may also be that once Eglot disconnects from the server, this ssh connection tailored to Eglot will be reused for other purposes, which is not ideal either.

I might well be wrong here — I'm not a Tramp expert.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am also not a tramp export, however I do believe this change is sufficient to get Eglot to use a different socket. If one uses (tramp-ssh-controlmaster--options "-o ControlMaster=auto -o ControlPath=SOMESTRING -o ControlPersist=no") instead, then one can find the socket /tmp/SOMESTRING upon launching eglot through tramp. To the best of my understanding, this means that setting this variable in this way does cause eglot to change how it uses SSH.

I should also say that while this does fix issue #859 for me, it doesn't appear to fix the issue for other people. The best solution might be to have a custom variable that the user can change to toggle these settings on or off (defaulting to off).

@jeslie0 jeslie0 marked this pull request as draft September 23, 2022 07:36
@joaotavora
Copy link
Owner

After much discussion in emacs bug#61350 we reached the conclusion that this is an effective workaround. Newer Tramp will have this fixed at the original, hopefulls. Anyway, the code is now in Eglot's upstream.

@joaotavora joaotavora closed this Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Forbidden reentrant call of Tramp
3 participants