From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#70522: 29.2.50; eglot-shutdown sends SIGKILL before LSP server can exit gracefully Date: Tue, 23 Apr 2024 08:51:46 +0300 Message-ID: <86wmoo4oel.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10327"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70522@debbugs.gnu.org, app-emacs-dev@janestreet.com, =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= To: Aaron Zeng , Daniel Pettersson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 23 07:53:14 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rz95e-0002Vt-4y for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Apr 2024 07:53:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rz95S-00045J-1u; Tue, 23 Apr 2024 01:53:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rz95Q-00044i-8N for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2024 01:53:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rz95P-0004Za-VI for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2024 01:52:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rz95f-0001uE-JA for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2024 01:53:15 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Apr 2024 05:53:14 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70522 X-GNU-PR-Package: emacs Original-Received: via spool by 70522-submit@debbugs.gnu.org id=B70522.17138515556930 (code B ref 70522); Tue, 23 Apr 2024 05:53:14 +0000 Original-Received: (at 70522) by debbugs.gnu.org; 23 Apr 2024 05:52:35 +0000 Original-Received: from localhost ([127.0.0.1]:50054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rz94s-0001mx-Uk for submit@debbugs.gnu.org; Tue, 23 Apr 2024 01:52:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38204) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rz94c-0001jq-MV for 70522@debbugs.gnu.org; Tue, 23 Apr 2024 01:52:22 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rz94F-0004Np-Sm; Tue, 23 Apr 2024 01:51:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=k6NaRY3oSimBZmssYhjJl6jpr0awuE/D36vlgOp1EMA=; b=FORgrmXw0g+RtvcSGrHG o8xG62DXGVH4KkW6gU7m/p6g51KcqIwrOOSP1yS3dUiS+tjXslCP6va/1NVrE0cygCewFuJsjXpwV laJ/tWtekZh1Y6m3LbaxCleZxPnv15D1GK4Z6XK+zBxyKRQxB8MsflVbswzOZ7jGtDirhjxCpur1j tYAzqxsV6ZazbdMZcH8AycimF9nWkE0ZHKYwrfnHaeaBsZg59Eqc9Ystv/NM/SfxV7zojw7LCgjH3 VtuOD9WUJxkYOMTuDnWYZlAgpovb5CEh6Vc7T2vwHbEsDxiwN00x7NbQuKOCNDDDAJQLRlTqckrsW DhhWBAg0F//68w==; In-Reply-To: (message from Aaron Zeng on Mon, 22 Apr 2024 17:39:32 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:283867 Archived-At: > Cc: app-emacs-dev > From: Aaron Zeng > Date: Mon, 22 Apr 2024 17:39:32 -0400 > > 1. emacs -Q > 2. M-x eglot in some file (I tested with OCaml-LSP and another language > server, the latter is internal to my site) > 3. M-x eglot-shutdown > > This messages: > > [jsonrpc] Server exited with status 9 > > Which is a little confusing. One would expect the language server to > exit with status 0, and not end up with "killed" in the events buffer, > if the server exited successfully upon user request. > > I installed the following patch locally at my site, and it seems to fix > the issue (now the server exits with status 0). I think it also better > matches the docstring of `jsonrpc-shutdown'. > > diff --git a/jsonrpc.el b/jsonrpc.el > --- a/jsonrpc.el > +++ b/jsonrpc.el > @@ -598,8 +598,8 @@ With optional CLEANUP, kill any associat > while (not (process-get proc 'jsonrpc-sentinel-cleanup-started)) > unless (zerop i) do > (jsonrpc--warn "Sentinel for %s still hasn't run, deleting it!" proc) > + (delete-process proc) > do > - (delete-process proc) > (accept-process-output nil 0.1)) > (when cleanup > (kill-buffer (process-buffer (jsonrpc--process conn))) Thanks. Daniel, could you please look into this issue?