[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: ZMailer "hangs up" on message queues...
I have a custom perl program for 'inbound' message processing and to help
keep message file names unique (while processing and for historical logging)
I use a combination of PID and time()? function (seconds since Unix's
concept of beginning time)... Works pretty well to keep things unique since
its unlikely a PID would be re-used within the same second. This of course
assumes the script in question was only receiving/sending one message at a
time and another process was sending/receiving the next message.
Just throwing in my 2 cents worth on file naming.
From: Carlos G Mendioroz
Sent: 7/25/01 6:42 PM
Subject: Re: ZMailer "hangs up" on message queues...
Michael Loftis wrote:
> We have ferreted out the quirkiness as it were, the filenames do have
> be numeric, the problem is we don't want to slow down to retrieve the
> inode number for every file we inject into the queue, as this would
> require a (Totally unecessary) stat (or fstat) call. Complicating
> matters slightly further is the fact we're using Perl as the engine.
I would not agree on the "totally unecessary" thing here:
-You do need file name uniqueness. Zmailer counts on that (at least, it
to count on that)
-You are using different processes to generate mail, so somehow you have
coordinate between them.
PID is not a secure scheme. Upon reboot, for example, you will get same
and you will clash with previous messages if still there.
-Stat()'ing the file seems a clean and easy way to coordinate...
> And actually you have to get the inode number, then convert it to
> (OK so itoa isn't that expensive, but still...)
What about open(MSG, "|rmail $dest) ? ;-)
I guess you are after speed, but you are doing it in perl, so why don't
let the mailer care about the queue ?
(This used to be called modularity, structured programming, object
and last word for it I read is protected variation. Divide and conquer
Carlos G Mendioroz <firstname.lastname@example.org> +54 11 4790-5093
D.F.Sarmiento 4165 - Olivos BA 1636 // LW7 EQI Argentina
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to email@example.com