From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.devel Subject: comments about jsonrpc.el Date: Fri, 01 Jun 2018 23:00:39 +0300 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1527883192 27060 195.159.176.226 (1 Jun 2018 19:59:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 1 Jun 2018 19:59:52 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 01 21:59:48 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOqDB-0006tr-Ll for ged-emacs-devel@m.gmane.org; Fri, 01 Jun 2018 21:59:46 +0200 Original-Received: from localhost ([::1]:57328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOqFI-0008DJ-OX for ged-emacs-devel@m.gmane.org; Fri, 01 Jun 2018 16:01:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOqEE-0008DE-10 for emacs-devel@gnu.org; Fri, 01 Jun 2018 16:00:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fOqEA-0001Es-4I for emacs-devel@gnu.org; Fri, 01 Jun 2018 16:00:50 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:38485) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fOqE9-00010B-Ri for emacs-devel@gnu.org; Fri, 01 Jun 2018 16:00:46 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1C3D521D0D; Fri, 1 Jun 2018 16:00:42 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 01 Jun 2018 16:00:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:content-type:date:from:message-id:mime-version:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=S7jNa6w/ArZq8eKO9 FJuGnCzOqHV4r8CFHl7K2u3g9o=; b=TQqTo2nNjsOAOgRTHM7Wceyy/gjlXIMoX DdAvM06eghJl2Xsnc/uPCeBJf7qbOcNBssT5gRo5GqgOns+Q3rhNHaeC4sbnrzJa O0UJpv/LiJNr6uQ2oN4KM9scVuzBa7xTcr4HW2uc2+rirHBk7CfIRTRDajbtcVtC pE/cT1JrKeVfR0y4VMynB40oEa324JmPF5rNgW41Z1RctjyDvASyLQyUNBV4M/yZ GNhvpBVzhDYbqXY3p6PalftF9ibHYMrDqZOlDD8oPPeFMVYKlp59dk1h7SO8brsA 94EKPHbUp4cfuC6DdF9Eh12XyjH1FCqVCVa+fGJnzq7vhqn0FoBew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=S7jNa6w/ArZq8eKO9FJuGnCzOqHV4r8CFHl7K2u3g9o=; b=Zw1YcrMa hV7RxBzF+7bZpAB6eTF6/XgqCLHFU4/ZUJWhRHM0trN87cVQLnmb+WIbLLK63qoT XfWqUi245TESt1gbhQ8ndXRFuOsDwQdRuPj/e1NMQiTR3YBV5kR/3SPfB+Yi/Pk8 V9n5trqSq0JlLP1W/qljzEzsFY1SxZ0F6h4r+zyaPPCYt/Go1mFZUSf8vNsfSP97 U/8/mUGURKXitI9Mr3fgfE1tRiwkcTQ/5YuLzpfd9iEyGfShinnetsFitXVSpd8W 2+3oMmujLPX0ubBKtMJzyfEf/IPso+TLG8xVtyfrPPfITvHHGPnJfuheE5E/kCcu 6oQ9FWSpf/6YBg== X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Original-Received: from fgunbin.playteam.ru (unknown [94.25.218.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 2DB5810255; Fri, 1 Jun 2018 16:00:41 -0400 (EDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.25 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225899 Archived-At: I was reading the last jsonrpc.el from jsonrpc-refactor branch in eglot repo and got few comments. Sorry if I'm misreading something. 1) When deferred action times out, the timer clears continuations and calls timeout-fn. I think it should also clear deferred actions, so they are not called from next jsonrpc--connection-receive afterwards. 2) When deferred action runs, it invokes jsonrpc-async-request which invokes jsonrpc-connection-send. I think we should also clear deferred actions here (why leave them?). Also, there seem to be two ways to handle timer: a) take timer from deferred action and save it in continuation - then its timeout spans both 'wait until server ready' interval and actual response wait interval; b) cancel deferred action timer and create new timer - it's done in the current code. 3) When deferred action runs, jsonrpc--async-request-1 should be called with 'deferred' non-nil - so it actually sends request. But it's unclear to me how this deferred=t is passed there ('apply' call on line 621) 4) jsonrpc--async-request-1 - non-local exit is missing (I saw it in the version you posted here) 5) jsonrpc-request: there's unwind-protect with some cleanup. Seems that we also need to clean deferred actions and cancel timer (that is in continuation). Another option - maybe we can just bind inhibit-quit to t instead of this unwind-protect with cleanup? Filipp