GNU bug report logs -
#79653
31.0.50; Regression in eglot-shutdown affecting rust-analyzer and other language servers
Previous Next
Reported by: Achyudh Ram <mail <at> achyudh.me>
Date: Sun, 19 Oct 2025 01:56:01 UTC
Severity: normal
Found in version 31.0.50
Done: João Távora <joaotavora <at> gmail.com>
To reply to this bug, email your comments to 79653 AT debbugs.gnu.org.
There is no need to reopen the bug first.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#79653; Package
emacs.
(Sun, 19 Oct 2025 01:56:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Achyudh Ram <mail <at> achyudh.me>:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org.
(Sun, 19 Oct 2025 01:56:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hello,
I would like to report a regression introduced by the fix for
bug#66144. I believe changing `eglot-shutdown` to send `eglot--{}`
instead of `nil` has broken shutdown behavior for rust-analyzer, and
other language servers that use the lsp-server crate like ty.
Steps to reproduce:
1. emacs -Q
2. M-x rust-ts-mode
3. M-x eglot
4. M-x eglot-shutdown
Then rust-analyzer crashes instead of shutting down gracefully.
Similar error with ty for Python. Error message:
[jsonrpc] Server exited with status 9
jsonrpc-request: jsonrpc-error: "request id=11 failed:",
(jsonrpc-error-code . -32602), (jsonrpc-error-message . "Failed to
deserialize shutdown: invalid type: map, expected unit; {}"),
(jsonrpc-error-data)
I've opened issues upstream with rust-analyzer
(https://github.com/rust-lang/rust-analyzer/issues/20846) and ty
(https://github.com/astral-sh/ty/issues/1330), but these may not be
resolved soon and this change will break current Emacs users who use
these language servers.
Thanks,
Achyudh
In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.49, cairo version 1.18.4)
Repository revision: ce7f2b93bb4dc17ae083ca33327c618a2038f420
Repository branch: master
System Description: Ubuntu 24.04.3 LTS
Configured using:
'configure
--prefix=/nix/store/5n89wm143sgnvgmjbaibdbfs2zbs95dq-emacs-git-pgtk-20251017.0
--disable-build-details --with-modules --with-pgtk
--disable-gc-mark-trace --with-compress-install
--with-toolkit-scroll-bars --with-native-compilation
--without-imagemagick --with-mailutils --without-small-ja-dic
--with-tree-sitter --without-xinput2 --without-xwidgets --with-dbus
--with-selinux'
Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER
PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP XIM GTK3 ZLIB
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#79653; Package
emacs.
(Sun, 19 Oct 2025 04:56:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 79653 <at> debbugs.gnu.org (full text, mbox):
> From: Achyudh Ram <mail <at> achyudh.me>
> Date: Sat, 18 Oct 2025 20:54:59 -0500
>
> I would like to report a regression introduced by the fix for
> bug#66144. I believe changing `eglot-shutdown` to send `eglot--{}`
> instead of `nil` has broken shutdown behavior for rust-analyzer, and
> other language servers that use the lsp-server crate like ty.
>
> Steps to reproduce:
>
> 1. emacs -Q
> 2. M-x rust-ts-mode
> 3. M-x eglot
> 4. M-x eglot-shutdown
>
> Then rust-analyzer crashes instead of shutting down gracefully.
> Similar error with ty for Python. Error message:
>
> [jsonrpc] Server exited with status 9
> jsonrpc-request: jsonrpc-error: "request id=11 failed:",
> (jsonrpc-error-code . -32602), (jsonrpc-error-message . "Failed to
> deserialize shutdown: invalid type: map, expected unit; {}"),
> (jsonrpc-error-data)
>
> I've opened issues upstream with rust-analyzer
> (https://github.com/rust-lang/rust-analyzer/issues/20846) and ty
> (https://github.com/astral-sh/ty/issues/1330), but these may not be
> resolved soon and this change will break current Emacs users who use
> these language servers.
Thanks.
João, any comments or suggestions?
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#79653; Package
emacs.
(Sun, 19 Oct 2025 12:08:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 79653 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
>
> Thanks.
>
> João, any comments or suggestions?
>
Thanks. The usual headache. I think we should try the "don't send args key
at all" approach as someone was arguing elsewhere here some time ago (bonus
points if you can fetch the bug# ). I think that's the standard's
recommendation or something. Whether doing that to Eglot won't break a
bunch of other servers in practice is a different story, but we can try...
João
>
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#79653; Package
emacs.
(Sun, 19 Oct 2025 13:25:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 79653 <at> debbugs.gnu.org (full text, mbox):
> From: João Távora <joaotavora <at> gmail.com>
> Date: Sun, 19 Oct 2025 13:07:33 +0100
> Cc: Achyudh Ram <mail <at> achyudh.me>, 79653 <at> debbugs.gnu.org
>
> Thanks. The usual headache. I think we should try the "don't send args key at all" approach as someone
> was arguing elsewhere here some time ago (bonus points if you can fetch the bug# ). I think that's the
> standard's recommendation or something. Whether doing that to Eglot won't break a bunch of other servers
> in practice is a different story, but we can try...
Maybe implement this with a knob to enable/disable it, so that users
could try this and that in case of trouble?
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#79653; Package
emacs.
(Sun, 19 Oct 2025 18:56:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 79653 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: João Távora <joaotavora <at> gmail.com>
>> Date: Sun, 19 Oct 2025 13:07:33 +0100
>> Cc: Achyudh Ram <mail <at> achyudh.me>, 79653 <at> debbugs.gnu.org
>>
>> Thanks. The usual headache. I think we should try the "don't send args key at all" approach as someone
>> was arguing elsewhere here some time ago (bonus points if you can fetch the bug# ). I think that's the
>> standard's recommendation or something. Whether doing that to Eglot won't break a bunch of other servers
>> in practice is a different story, but we can try...
>
> Maybe implement this with a knob to enable/disable it, so that users
> could try this and that in case of trouble?
Let's only do that as a very last resort. First, let's try the patch
after my sig.
It'd also be nice to recall the other issue(s) where this came up. My
memory isn't what it used to be but I'm pretty usre there is something
around here. My debbugs-searching skills aren't great either.
Anyway, first things first, let's include Daniel Pettersson, jsonrpc.el
maintainer, here, because this needs a change to that package. Daniel,
you'll want to make sure this works with your dape.el usage of
jsonrpc.el. I think it should be safe, but just in case.
João
diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el
index 1ad0a78b1d1..c0a17cefc4f 100644
--- a/lisp/jsonrpc.el
+++ b/lisp/jsonrpc.el
@@ -360,12 +360,14 @@ jsonrpc-async-request
_timeout-fn
_timeout _deferred)
"Make a request to CONNECTION, expecting a reply, return immediately.
-The JSONRPC request is formed by METHOD, a symbol, and PARAMS a
-JSON object.
+The JSONRPC request is formed by METHOD, a symbol; and PARAMS, a JSON
+object value as described y `json-serialize' (which see). PARAMS can
+also be the keyword `:jsonrpc-omit' oin which case the JSONRPC request
+object is formed witout a `params' entry.
The caller can expect SUCCESS-FN or ERROR-FN to be called with a
JSONRPC `:result' or `:error' object, respectively. If this
-doesn't happen after TIMEOUT seconds (defaults to
+odoesn't happen after TIMEOUT seconds (defaults to
`jrpc-default-request-timeout'), the caller can expect TIMEOUT-FN
to be called with no arguments. The default values of SUCCESS-FN,
ERROR-FN and TIMEOUT-FN simply log the events into
@@ -563,7 +565,7 @@ jsonrpc-connection-send
&key
id
method
- _params
+ (_params nil params-supplied-p)
(_result nil result-supplied-p)
error
_partial)
@@ -933,10 +935,10 @@ jsonrpc--async-request-1
(cl-return-from jsonrpc--async-request-1 (list id timer))))
;; Really send it thru the wire
;;
- (jsonrpc-connection-send connection
- :id id
- :method method
- :params params)
+ (apply #'jsonrpc-connection-send connection
+ :id id
+ :method method
+ (unless (eq params :jsonrpc-omit) `(:params ,params)))
;; Setup some control structures
;;
(when sync-request
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 5277df8b7c4..8212a51e0f0 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -1270,7 +1270,7 @@ eglot-shutdown
(unwind-protect
(progn
(setf (eglot--shutdown-requested server) t)
- (eglot--request server :shutdown eglot--{} :timeout (or timeout 1.5))
+ (eglot--request server :shutdown :jsonrpc-omit :timeout (or timeout 1.5))
(jsonrpc-notify server :exit eglot--{}))
;; Now ask jsonrpc.el to shut down the server.
(jsonrpc-shutdown server (not preserve-buffers))
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#79653; Package
emacs.
(Mon, 20 Oct 2025 00:14:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 79653 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Regarding bugs related to this, I think I found them:
bug#66144
https://github.com/joaotavora/eglot/discussions/1540
João
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#79653; Package
emacs.
(Wed, 22 Oct 2025 15:55:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 79653 <at> debbugs.gnu.org (full text, mbox):
João Távora <joaotavora <at> gmail.com> writes:
> Anyway, first things first, let's include Daniel Pettersson, jsonrpc.el
> maintainer, here, because this needs a change to that package. Daniel,
> you'll want to make sure this works with your dape.el usage of
> jsonrpc.el. I think it should be safe, but just in case.
Thanks for keeping me in the loop. Patch works fine with dape, all good
on my end!
/Daniel
Reply sent
to
João Távora <joaotavora <at> gmail.com>:
You have taken responsibility.
(Thu, 23 Oct 2025 21:15:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Achyudh Ram <mail <at> achyudh.me>:
bug acknowledged by developer.
(Thu, 23 Oct 2025 21:15:02 GMT)
Full text and
rfc822 format available.
Message #28 received at 79653-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
I've pushed the patch to jsonrpc, bumped its version to 1.0.26, made the
change
in Eglot, bumped its required of jsonrpc to match.
Ran all the Eglot tests with the new param-less shutdown, seemed good.
I also released Eglot 1.19, let's see how it goes.
Tentatively/optimistically closing this bug.
João
On Wed, Oct 22, 2025 at 4:54 PM Daniel Pettersson <daniel <at> dpettersson.net>
wrote:
> João Távora <joaotavora <at> gmail.com> writes:
>
> > Anyway, first things first, let's include Daniel Pettersson, jsonrpc.el
> > maintainer, here, because this needs a change to that package. Daniel,
> > you'll want to make sure this works with your dape.el usage of
> > jsonrpc.el. I think it should be safe, but just in case.
>
> Thanks for keeping me in the loop. Patch works fine with dape, all good
> on my end!
>
> /Daniel
>
--
João Távora
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org:
bug#79653; Package
emacs.
(Mon, 27 Oct 2025 17:41:02 GMT)
Full text and
rfc822 format available.
Message #31 received at 79653-done <at> debbugs.gnu.org (full text, mbox):
Hi João,
I tested rust-analyzer and ty against the latest emacs master and can
confirm that this has been fixed. Thank you!
Achyudh
João Távora <joaotavora <at> gmail.com> writes:
> I've pushed the patch to jsonrpc, bumped its version to 1.0.26, made the
> change
> in Eglot, bumped its required of jsonrpc to match.
>
> Ran all the Eglot tests with the new param-less shutdown, seemed good.
>
> I also released Eglot 1.19, let's see how it goes.
> Tentatively/optimistically closing this bug.
>
> João
>
> On Wed, Oct 22, 2025 at 4:54 PM Daniel Pettersson <daniel <at> dpettersson.net>
> wrote:
>
>> João Távora <joaotavora <at> gmail.com> writes:
>>
>> > Anyway, first things first, let's include Daniel Pettersson, jsonrpc.el
>> > maintainer, here, because this needs a change to that package. Daniel,
>> > you'll want to make sure this works with your dape.el usage of
>> > jsonrpc.el. I think it should be safe, but just in case.
>>
>> Thanks for keeping me in the loop. Patch works fine with dape, all good
>> on my end!
>>
>> /Daniel
>>
>
>
> --
> João Távora
This bug report was last modified 9 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.