[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ECM for possible process-status/sentinel bug
From: |
Adam Porter |
Subject: |
Re: ECM for possible process-status/sentinel bug |
Date: |
Sun, 22 Aug 2021 14:13:40 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
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