nmh-workers
[Top] [All Lists]

Re: current work on nmh

1998-06-17 15:21:50
I'm beginning a restructuring of many of the commands.  This is a
longer term project, so don't expect immediate results.  But I've got
a good start on it.

I've been using mh for a decade or so and it seems like the nmh project has
saved it from decaying into nothingness.  I've become a fan of nmh, and am
please to see the restructuring, especially to better integrate MIME.

However, I am still looking more towards reliability than features at this
time.  I have large mail boxes (10000 or more messages) and frequently
allow my unseen sequence to grow very large as I (ab)use it as a simple
"look at this again" list.

Ever since I switched from plain 'inc' to a complex procmail and rcvstore
mail delivery mechanism, I have been plagued with disappearing sequences.
I have traced this to optimistic handling of context and .mh_sequences
files in nmh.  In particular, each .mh_sequences file is truncated before
the new sequences are written to it, and if another nmh command starts in
that small gap it will read an empty set of sequences.  When this second
nmh command completes, it will write its version of .mh_sequences, losing
data.

MH is very haphazard about the way it manipulates folders.  Every
command open and closes the files itself.  There are lots of race
conditions in MH, if commands are used in parallel.  This is not too
surprising, since MH was originally designed to be used in a serial
fashion.  Commands such as rcvstore and slocal came much later.

Part of the reason for the current restructuring of nmh, is to change
the internals so that folder manipulation always uses a standard
library interface.  I've been slowly working on this in nmh.  Several
nmh commands (rcvstore, refile, and soon mhn -store) use the library
interface folder_addmsg() to add messages to a folder.  Once this is
completed, it will make it possible to add a robust locking scheme.

Another primary reason I haven't added locking to nmh yet, is because
of potential deadlocks.  Many MH/nmh commands call other MH/nmh
commands.  A naive locking scheme would result in deadlocks for some
people.  Once the restructuring is done (such as the merge of show
and mhn -show), then it will be much easier to add locking without
causing deadlocks.

Also, you mention you are using a procmail/rcvstore combination.
Make sure you use procmail locking on the folders.  I've been doing
this for years, and have never noticed a problem.

--
Richard Coleman
coleman(_at_)math(_dot_)gatech(_dot_)edu


<Prev in Thread] Current Thread [Next in Thread>