> it would be easier to review if you send a diff -u there is a 
> reason why we like diffs compared to random blocks of code.

You can find the diff at the end of this email.


> > JDBCSpoolRepository has a 60 seconds wait

> Which should get terminated when notify is called().

I know how notify() works but james does not call it.
Look at the JDBCMailRepository: most of notifyAll are commented out, the
only notify is at the end of store() but there is no notify at the unlock()
(unlock is the method called by the JamesSpoolManager after processing the
email into 1 single processor).


> > Looking at process() in the JamesSpoolManager I removed the "return"
> > before
> > the catch and moved the last logging line inside the catch block.

> With that changem you can have multiple threads contending for that
message.

Why? The message is still locked before "looping". I don't understand how
another thread could contend the message before I call spool.unlock().

> If there is a fix that needs to happen, I would sooner investigate why a
> spool thread isn't being woken to handle the store() call.

It seems that when you don't need to move the message to another repository
then james doesn't use store(). IMHO This is correct because I think that
changing the message state (using the ToProcessor mailet) should be a
lightweight operation and should simply update the mail record.

--------------------------------------

Index: james-svn/src/java/org/apache/james/transport/JamesSpoolManager.java
===================================================================
--- james-svn/src/java/org/apache/james/transport/JamesSpoolManager.java
(revision 159582)
+++ james-svn/src/java/org/apache/james/transport/JamesSpoolManager.java
(working copy)
@@ -49,7 +49,7 @@
  * processor, and removing them from the spool when processing is
  * complete.
  *
- * @version CVS $Revision: 1.20.4.15 $ $Date: 2004/04/14 04:36:15 $
+ * @version CVS $Revision$ $Date$
  */
 public class JamesSpoolManager
     extends AbstractLogEnabled
@@ -459,11 +459,13 @@
                     getLogger().debug(logMessageBuffer.toString());
                     getLogger().debug("Result was " + mail.getState());
                 }
-                return;
+                // removing this return could create loops in processing.
+                // btw this speed up processing.
+                // return;
             } catch (Throwable e) {
                 // This is a strange error situation that shouldn't
ordinarily
                 // happen
-                StringBuffer exceptionBuffer = 
+                StringBuffer exceptionBuffer =
                     new StringBuffer(64)
                             .append("Exception in processor <")
                             .append(processorName)
@@ -482,17 +484,17 @@
                     }
                     mail.setErrorMessage(e.getMessage());
                 }
+                if (getLogger().isErrorEnabled()) {
+                  StringBuffer logMessageBuffer =
+                      new StringBuffer(128)
+                              .append("An error occurred processing ")
+                              .append(mail.getName())
+                              .append(" through ")
+                              .append(processorName);
+                  getLogger().error(logMessageBuffer.toString());
+                  getLogger().error("Result was " + mail.getState());
+                }
             }
-            if (getLogger().isErrorEnabled()) {
-                StringBuffer logMessageBuffer =
-                    new StringBuffer(128)
-                            .append("An error occurred processing ")
-                            .append(mail.getName())
-                            .append(" through ")
-                            .append(processorName);
-                getLogger().error(logMessageBuffer.toString());
-                getLogger().error("Result was " + mail.getState());
-            }
         }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to