On Fri, Mar 01, 2002 at 01:42:00PM -0500, Michael Brown wrote:
| I've come across a problem in the spamc/spamass-milt combo when sending large
| mail messages (>2MB in my case).
| 
| From what I can see, the way spamc works is that a message is passed to it on
| stdin, then stdin is closed. After stdin is closed, spamc sends it
| to spamd for processing.
| 
| It looks like spamc starts to send back the (unprocessed, yes I know. I got
| the size limitation part) message before stdin is closed, and data is still
| coming in on stdin. This leads to a deadlock when the pipes are full - both
| spamc and its parent are blocking on their write() calls.
| 
| - Now, is this a problem with spamc or with spamc's parent?

If it is a deadlock then it is both their fault.  The reason is that
they are both waiting for each other.  If one gives up the "fight"
(and releases whatever resource is being watied for) then the other
will stop waiting and make progress.

| - Should spamc only start sending back the message after stdin is
| closed, or is
|   it allowed to send it back anytime?

Suppose a message of size X is received where X > Avail_Ram/2.  You
can't read all of the data for an arbitrarily large message.
(needless to say, even if you have the RAM the performance will be
atrocious)

| - Should spamc be patched to use select() during the problematic read()s and
|   write()s?

I've never used select() before, but a cursory glance at the docs
sounds like it is the right solution.

-D

-- 

Come to me, all you who are weary and burdened, and I will give you
rest.  Take my yoke upon you and learn from me, for I am gentle and
humble in heart, and you will find rest for your souls.  For my yoke
is easy and my burden is light.
        Matthew 11:28-30


_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to