notmuch vs. SIGPIPE

Thomas Schwinge thomas at codesourcery.com
Mon Jan 20 03:55:28 PST 2020


Hi!

While looking a bit into the item raised in
id:87muamgspy.fsf at euler.schwinge.homeip.net I noticed the following
(mis?)behavior by notmuch.

To set the stage:

    $ yes | head -n 1
    y
    $ echo "${PIPESTATUS[@]}"
    141 0

As expected, the 'yes' process exits with SIGPIPE right after the 'head'
process terminated.  However:

    $ notmuch search \* | head -n 1 & sleep 22; jobs; ps -f
    [1] 622009
    thread:0000000000032bb2   the future [1/1] Jenna Moss; Steve Burbon, Washington (hurd list spam)
    [1]+  Running                 notmuch search \* | head -n 1 &
    UID          PID    PPID  C STIME TTY          TIME CMD
    thomas    621851    4297  0 12:38 pts/38   00:00:00 /bin/bash
    thomas    622008  621851 99 12:48 pts/38   00:00:22 /home/thomas/command/notmuch.real search \*
    thomas    622013  621851  0 12:48 pts/38   00:00:00 ps -f

Even after its "pipe-consumer" 'head' process has terminated, the
'notmuch' process still keeps running, and running, and running...  It
has to be killed manually (unless it before exits because of concurrent
database modification).  This doesn't seem expected behavior to me?

Now, I do have a patch or two (actually dozensa; reverts, WIP etc.) on
top of months-old notmuch sources, so I'll later try to reproduce that
with clean sources.


Grüße
 Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 658 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20200120/2ecb864c/attachment.sig>


More information about the notmuch mailing list