From: Jameson Graef Rollins <jrollins@finestructure.net>
To: Notmuch Mail <notmuch@notmuchmail.org>
Subject: questions about post-new/insert hooks
Date: Tue, 23 Dec 2014 13:48:02 -0800 [thread overview]
Message-ID: <87k31im419.fsf@servo.finestructure.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 1575 bytes --]
Hi, folks. I was wondering about possible race conditions in the
post-new hook. Given that the database does not remain locked during
execution of the post-new hook, isn't there a possibility that more new
messages will be added to the database before the post-new hook has
finished processing? If so, I can imagine multiple ways that might
break typical logic in post-new hooks. I wonder if this race condition
could be avoided by e.g. sending the post-new hook the message ids of
all newly-added messages on stdin. The hook could then use the message
ids to process just the new messages, without worrying that other
messages could have been added in the middle of processing. Has anyone
thought about this?
I was also wondering about per-message insertion hooks. The new(ish)
insert command has a post-insert hook which is run on a per-message
insertion basis. What about adding a hook that would run on each
message being added with new? This would also be a way to get rid of
the above mentioned race condition, and might allow for simpler message
content filtering for those of us using notmuch-new instead of
notmuch-insert. Maybe in this the per-message hook could get the full
text of the message on stdin, and the message id as argument.
I haven't fully thought the implications of this stuff through, so I
would love to hear what others think.
The reason I bring all this up is that I'm trying to figure out the best
way to integrate spam classification into my notmuch setup, which for
some reason is currently proving exceedingly difficult.
jamie.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
reply other threads:[~2014-12-23 21:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k31im419.fsf@servo.finestructure.net \
--to=jrollins@finestructure.net \
--cc=notmuch@notmuchmail.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 public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).