From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#66669: 30.0.50; [EGLOT] Emacs freezes when server sends a ton of progress notifications Date: Sun, 22 Oct 2023 17:39:42 -0700 Message-ID: <21123E04-37EA-40ED-8316-44EA45B6ECF2@gmail.com> References: <837cnfqmz8.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34192"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 66669-done@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 23 02:41:21 2023 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 1quj0T-0008lh-KJ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Oct 2023 02:41:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quizm-0007pw-4P; Sun, 22 Oct 2023 20:40:38 -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 1quizj-0007pB-8d for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 20:40:35 -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 1quizj-0002VM-03 for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 20:40:35 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quj0B-0001LV-Ka for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 20:41:03 -0400 Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Oct 2023 00:41:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 66669 X-GNU-PR-Package: emacs Mail-Followup-To: 66669@debbugs.gnu.org, casouri@gmail.com, casouri@gmail.com Original-Received: via spool by 66669-done@debbugs.gnu.org id=D66669.16980216335080 (code D ref 66669); Mon, 23 Oct 2023 00:41:03 +0000 Original-Received: (at 66669-done) by debbugs.gnu.org; 23 Oct 2023 00:40:33 +0000 Original-Received: from localhost ([127.0.0.1]:48555 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quizh-0001Jr-6O for submit@debbugs.gnu.org; Sun, 22 Oct 2023 20:40:33 -0400 Original-Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:56453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quizc-0001JY-Ux for 66669-done@debbugs.gnu.org; Sun, 22 Oct 2023 20:40:31 -0400 Original-Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1cab2c24ecdso14619295ad.0 for <66669-done@debbugs.gnu.org>; Sun, 22 Oct 2023 17:40:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698021594; x=1698626394; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KEfojNpwJySXNQ2QQPbBumJBdUJo0+B9eeXLRSlDGcU=; b=S0NwlKhEwcGTRglzIJQq/KqoYa5fECDRSoUpLSVaBa47ZwOAk5B6HaHh2Jdy5WyQ3g 1cPHNsibnPg+TtHCAX9m8em74pE7udSuLjRqPWEpxJ459V7sQyWs5G8WVhb4JkVgAo5Y oPNOk2jVPkfaT2E84YqHIg/DU3rj3L3o+/rGATIgF5sX/hmF6WeNr6EXF025U5I5R8TT zG41TP3VNlKyEAj0RxntP2pqaTNmTlfPovuyMVPIH8CT9M6PIWAm2D4ioAlwjqtgETPc wKjS+EtQnVCifqW64LH5gXeG82mps5j0GxyGvDiu+NYGxhaSEymiBGwaDJnwRaMxXO7J sOZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698021594; x=1698626394; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KEfojNpwJySXNQ2QQPbBumJBdUJo0+B9eeXLRSlDGcU=; b=LAqYBaGrdHn7iheIupNKEwjq0D5rijEBN7kj2Y07m60BWtJdpVjlo+8C5Ptpx1tohd FVnz/Ocdzy8ah1T+sBMicMW1h9q6bDuGmLkV/AMGGmNC/Pl1ejTqMDO0S9Y/178WdI2K JVr6Adf4idx6JPPuUnOVmJRCnZ6UIQjj0aqiImjPf2O+mdgbw01WfdirEibr/J9F0y1d Yi0tAmPPuITbD7fOi3uqqH+bc2td6HfWwkTinOWUw5V/f5ihLxW38NEWy+fbt3VzeuJO kLGUtop1qRW85O9qp9W9sk4q2SzcT0Q95TVBX+se2f8LI4gQcsdg8fZWvCQL+iukfvbz R1lQ== X-Gm-Message-State: AOJu0Yyga/zqZ5+LrbatIudZOAy/XRm1m/sEr+lj1KH1oHUYOz9mdHkd XcoDsIIRpk/FZzSSuN+Ho34= X-Google-Smtp-Source: AGHT+IE8VVLpJQ1cUNxiSnrPeWFtGFt5l2VLN5iOCnt8jinMxKGWKA+2c/i3nn/Z636TXa9g+4qpfg== X-Received: by 2002:a17:902:f686:b0:1c8:7489:56e2 with SMTP id l6-20020a170902f68600b001c8748956e2mr5254844plg.35.1698021594307; Sun, 22 Oct 2023 17:39:54 -0700 (PDT) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id jb14-20020a170903258e00b001bc21222e34sm4907609plb.285.2023.10.22.17.39.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Oct 2023 17:39:54 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3731.700.6) 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:273001 Archived-At: > On Oct 22, 2023, at 7:52 AM, Jo=C3=A3o T=C3=A1vora = wrote: >=20 > On Sun, Oct 22, 2023 at 5:50=E2=80=AFAM Eli Zaretskii = wrote: >>=20 >>> Cc: joaotavora@gmail.com >>> From: Yuan Fu >>> Date: Sat, 21 Oct 2023 12:10:49 -0700 >>>=20 >>> I use rust=E2=80=99s language server (rust-analyzer) with eglot. And = whenever I turn eglot on for a project, Emacs freezes for a good 30 = seconds, busy updating the eglot progress indicator, before I can do = anything. I think the reason is that the rust language server sends a = ton of progress notifications, which completely blocks Emacs before = it=E2=80=99s done. >>>=20 >>> Setting eglot-report-progress to nil doesn=E2=80=99t help me, = presumably because eglot still needs to process the notifications. >>=20 >> Can't this information be processed in chunks, not in one go? >=20 > Maybe, depending on what that means. I think it's important to > get to the bottom of Yuan's "presumably" first, preferably by > reproducing his problem. Apologize for doubting eglot's ability to process messages :-) When = trying to reproduce the problem, I eventually found out that it was = project-files that was blocking. And project-files was blocking because = I used a custom project method, which doesn=E2=80=99t properly ignore = the build directory, which contains a ton of small files. > * Have you profiled? Have you tried setting eglot-events-buffer-size > to 0 (and restart Eglot) as suggested in the Eglot manual? Many > performance problems are due to JSON objects being pretty printed in > the Eglot events buffer (BTW some users ask me to turn it to 0 by > default, but the pros don't outweigh the cons, which in this case is > we would lose a valuable tool for newbie users with exotic servers to > send me their debug data easily) I do have eglot-events-buffer-size set to 0. I observed the freeze, = reset it to some large value, and saw a bunch of notifications, so I = assumed that was the problem. That turns out to be very wrong :-) Personally I also think the default value should be 0. (I wonder if = disabling pp would improve it enough?) Eglot is really borderline = non-usable when the value is non-0 and the language server is chatty = (eg, rust, typescript). I certainly don=E2=80=99t want people to try out = eglot, see the lag, and conclude that =E2=80=9CEmacs is slow=E2=80=9D. Maybe providing a simple command like M-x eglot-enable-logging, and tell = new users to turn this on and restart eglot, is good enough. But I=E2=80=99= m not the one that dealt with eglot bug reports, maybe restarting eglot = can=E2=80=99t reproduce the error in many cases? Yuan=