From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Adam Porter Newsgroups: gmane.emacs.devel Subject: Re: ECM for possible process-status/sentinel bug Date: Sun, 22 Aug 2021 14:13:40 -0500 Message-ID: <87pmu547iz.fsf@alphapapa.net> References: <87im02ew4n.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30444"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Aug 22 21:14:28 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mHsvL-0007or-Kw for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Aug 2021 21:14:27 +0200 Original-Received: from localhost ([::1]:57120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mHsvK-0007mx-Ik for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Aug 2021 15:14:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHsuo-00076g-Dx for emacs-devel@gnu.org; Sun, 22 Aug 2021 15:13:54 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:58684) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHsul-0006oU-I2 for emacs-devel@gnu.org; Sun, 22 Aug 2021 15:13:53 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mHsug-00072K-Nv for emacs-devel@gnu.org; Sun, 22 Aug 2021 21:13:46 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:272852 Archived-At: Hi, I've spent some more time trying to debug my process-related code today, but I've ended up in the same place: when the curl process exits, and the process's buffer has finished receiving the process's output, sometimes the sentinel is not called a final time. It seems to happen often when processes are called in quick succession, like when running a series of tests with ERT, but rarely when processes are called slowly, like when running one test at a time with ERT. It almost seems consistent in that, out of 23 tests, it tends to begin failing at the same test on each run of the series, yet those same tests can pass when run individually, which makes me wonder if it's something to do with Emacs's internal bookkeeping around processes. In one of the ERT tests, I was able to work around the problem by: 1. In the sentinel, putting a flag property on the process after the sentinel has been called and processed the response accordingly. 2. In the test definition, test for that flag property, and loop calling (accept-process-output PROCESS) until the flag is set. Of course, this is not suitable for real-world usage, because it effectively turns an asynchronous process into a synchronous one, defeating the purpose of the library. So I'm left again with the test case I posted in the first message in this thread. In order to avoid filing useless reports, I was hoping to get some advice along the lines of, "Yes, that might be a bug, please report it as one," or "No, you just misunderstand how sentinels are intended to work." If someone could so advise me, I'd be grateful. Otherwise I guess I'll report a bug in a day or so. Thanks, Adam