all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Adam Porter <adam@alphapapa.net>
To: emacs-devel@gnu.org
Subject: Re: ECM for possible process-status/sentinel bug
Date: Sun, 22 Aug 2021 14:13:40 -0500	[thread overview]
Message-ID: <87pmu547iz.fsf@alphapapa.net> (raw)
In-Reply-To: 87im02ew4n.fsf@alphapapa.net

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




  reply	other threads:[~2021-08-22 19:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 13:10 ECM for possible process-status/sentinel bug Adam Porter
2021-08-22 19:13 ` Adam Porter [this message]
2021-08-22 19:24   ` Eli Zaretskii
2021-08-23  1:25     ` Adam Porter
2021-08-23  0:17   ` chad
2021-08-23  1:18     ` Adam Porter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pmu547iz.fsf@alphapapa.net \
    --to=adam@alphapapa.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.