You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Norman Maurer (JIRA)" <se...@james.apache.org> on 2006/07/09 13:50:29 UTC

[jira] Created: (JAMES-559) Message body get lost after call saveChanges() and move to other processor

Message body get lost after call saveChanges() and move to other processor
--------------------------------------------------------------------------

         Key: JAMES-559
         URL: http://issues.apache.org/jira/browse/JAMES-559
     Project: James
        Type: Bug

    Versions: 3.0, 2.3.0b2    
    Reporter: Norman Maurer
    Priority: Blocker
     Fix For: 3.0, 2.3.0b2


After call saveChanges() in a mailet and move the mail to a other processor with ToProcessor the whole messageBody getting lost.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-559) Message body get lost after call saveChanges() and move to other processor

Posted by "Norman Maurer (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-559?page=comments#action_12419903 ] 

Norman Maurer commented on JAMES-559:
-------------------------------------

After more testing it seems that the problem appears only with file repos. I tested it also with db and dbfile. No problem ..


> Message body get lost after call saveChanges() and move to other processor
> --------------------------------------------------------------------------
>
>          Key: JAMES-559
>          URL: http://issues.apache.org/jira/browse/JAMES-559
>      Project: James
>         Type: Bug

>     Versions: 3.0, 2.3.0b2
>     Reporter: Norman Maurer
>     Priority: Blocker
>      Fix For: 3.0, 2.3.0b2

>
> After call saveChanges() in a mailet and move the mail to a other processor with ToProcessor the whole messageBody getting lost.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-559) Message body get lost after call saveChanges() and move to other processor

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-559?page=comments#action_12420040 ] 

Stefano Bagnara commented on JAMES-559:
---------------------------------------

Status update: I wrote a unittest for this and the unittest fail. A good first step.

The problem only happens in file repositories because with db repositories we don't stream from and to db, while with files we use streaming more aggressively.

The problem probably arise from optimizations I added in january about loading only headers if only headers are changed and  then write headers from memory and stream body from source if no body changes were done. When updating the same file there was a check that avoided to update the file when the whole message was not changed, but there is no "solution" for only headers changed.

I'm currently investigating these 2 solutions:
1) remove the "load only the headers" optimization and always load/parse the full message in memory
2) change the file repository to write to a temporary file and rename it when the stream is closed.

I already have found problems with both solutions, and that's why I don't have committed a patch yet....


> Message body get lost after call saveChanges() and move to other processor
> --------------------------------------------------------------------------
>
>          Key: JAMES-559
>          URL: http://issues.apache.org/jira/browse/JAMES-559
>      Project: James
>         Type: Bug

>     Versions: 2.3.0b2, 3.0
>     Reporter: Norman Maurer
>     Assignee: Stefano Bagnara
>     Priority: Blocker
>      Fix For: 3.0, 2.3.0b2

>
> After call saveChanges() in a mailet and move the mail to a other processor with ToProcessor the whole messageBody getting lost.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Updated: (JAMES-559) Message body get lost after call saveChanges() and move to other processor

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
     [ http://issues.apache.org/jira/browse/JAMES-559?page=all ]

Stefano Bagnara updated JAMES-559:
----------------------------------

    Fix Version/s:     (was: 3.0)

> Message body get lost after call saveChanges() and move to other processor
> --------------------------------------------------------------------------
>
>                 Key: JAMES-559
>                 URL: http://issues.apache.org/jira/browse/JAMES-559
>             Project: James
>          Issue Type: Bug
>    Affects Versions: 3.0, 2.3.0b2
>            Reporter: Norman Maurer
>         Assigned To: Stefano Bagnara
>            Priority: Blocker
>             Fix For: 2.3.0b3
>
>
> After call saveChanges() in a mailet and move the mail to a other processor with ToProcessor the whole messageBody getting lost.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-559) Message body get lost after call saveChanges() and move to other processor

Posted by "Noel J. Bergman (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-559?page=comments#action_12419912 ] 

Noel J. Bergman commented on JAMES-559:
---------------------------------------

This appears to be a side-effect of optimizing message handling.  Since the message is not in memory, we lose it when we call sr.put(key).  See below.

For v2.3, it might be best to revert behavior.  For later versions, perhaps the file support from Jakarta Commons Transactions (http://jakarta.apache.org/commons/transaction/file/index.html) will resolve it.

    --- Noel

Index: src/java/org/apache/james/mailrepository/AvalonMailRepository.java
===================================================================
--- src/java/org/apache/james/mailrepository/AvalonMailRepository.java  (revision 420194)
+++ src/java/org/apache/james/mailrepository/AvalonMailRepository.java  (working copy)
@@ -236,6 +236,15 @@
         }
     }

+    private void logMessage(Mail mc, String label) throws java.io.IOException, MessagingException {
+        // NjB
+        System.out.println("---- AMR: store(" + destination + ") -----------");
+        System.out.println("---- " + label + ") ----");
+        mc.getMessage().writeTo(System.out);
+        System.out.println("-----------------------------");
+        // NjB
+    }
+
     /**
      * Stores a message in this repository. Shouldn't this return the key
      * under which it is stored?
@@ -296,8 +305,11 @@
                 if (saveStream) {
                     OutputStream out = null;
                     try {
+                        logMessage(mc, "mark 4");
                         out = sr.put(key);
+                        logMessage(mc, "mark 5");
                         mc.getMessage().writeTo(out);
+                        logMessage(mc, "mark 6");
                     } finally {
                         if (out != null) out.close();
                     }


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


---- AMR: store(file://var/mail/spool/) -----------
---- mark 4) ----
Return-Path: null
Received: from localhost.localdomain ([127.0.0.1])
          by localhost.localdomain (JAMES SMTP Server 2.3.0b2) with SMTP ID 254
          for <me...@localhost>;
          Sun, 9 Jul 2006 00:51:17 -0400 (EDT)
Date: Now
Subject: Binary search?
To: Me
From: Me
X-MailetHeader: TheHeaderValue
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii
MIME-Version: 1.0
Message-ID: <60...@localhost.localdomain>

Help me!

Please.  :-)

-----------------------------
---- AMR: store(file://var/mail/spool/) -----------
---- mark 5) ----
Return-Path: null
Received: from localhost.localdomain ([127.0.0.1])
          by localhost.localdomain (JAMES SMTP Server 2.3.0b2) with SMTP ID 254
          for <me...@localhost>;
          Sun, 9 Jul 2006 00:51:17 -0400 (EDT)
Date: Now
Subject: Binary search?
To: Me
From: Me
X-MailetHeader: TheHeaderValue
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii
MIME-Version: 1.0
Message-ID: <60...@localhost.localdomain>

-----------------------------
---- AMR: store(file://var/mail/spool/) -----------
---- mark 6) ----
Return-Path: null
Received: from localhost.localdomain ([127.0.0.1])
          by localhost.localdomain (JAMES SMTP Server 2.3.0b2) with SMTP ID 254
          for <me...@localhost>;
          Sun, 9 Jul 2006 00:51:17 -0400 (EDT)
Date: Now
Subject: Binary search?
To: Me
From: Me
X-MailetHeader: TheHeaderValue
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii
MIME-Version: 1.0
Message-ID: <60...@localhost.localdomain>

o: Me
From: Me
X-MailetHea-----------------------------


> Message body get lost after call saveChanges() and move to other processor
> --------------------------------------------------------------------------
>
>          Key: JAMES-559
>          URL: http://issues.apache.org/jira/browse/JAMES-559
>      Project: James
>         Type: Bug

>     Versions: 3.0, 2.3.0b2
>     Reporter: Norman Maurer
>     Priority: Blocker
>      Fix For: 3.0, 2.3.0b2

>
> After call saveChanges() in a mailet and move the mail to a other processor with ToProcessor the whole messageBody getting lost.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-559) Message body get lost after call saveChanges() and move to other processor

Posted by "Vincenzo Gianferrari Pini (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-559?page=comments#action_12420116 ] 

Vincenzo Gianferrari Pini commented on JAMES-559:
-------------------------------------------------

It works now for me. Thanks to all of the team for the work.
I'll test 2.3.0b2 again in production on the weekend of July 22-23.

> Message body get lost after call saveChanges() and move to other processor
> --------------------------------------------------------------------------
>
>          Key: JAMES-559
>          URL: http://issues.apache.org/jira/browse/JAMES-559
>      Project: James
>         Type: Bug

>     Versions: 3.0, 2.3.0b2
>     Reporter: Norman Maurer
>     Assignee: Stefano Bagnara
>     Priority: Blocker
>      Fix For: 3.0, 2.3.0b3

>
> After call saveChanges() in a mailet and move the mail to a other processor with ToProcessor the whole messageBody getting lost.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-559) Message body get lost after call saveChanges() and move to other processor

Posted by "Norman Maurer (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-559?page=comments#action_12419902 ] 

Norman Maurer commented on JAMES-559:
-------------------------------------

Noel wrote in mailinglist:

OK, here is a scenario to reproduce.  In the root processor, add:

  LogMessage
  ToRepository (pre-header)
  SetMimeHeader
  LogMessage
  ToRepository (post-header)
  ToProcessor (test)

Needless to say, all of the ToRepository mailets should have passThrough
set.  And in the "test" processor, add:

  LogMessage
  ToRepository (post-processor)

You could also instrument AvalonMailRepository.store to add
mc.getMessage().writeTo(System.out) for debugging.  You will see that the
message is fine until we write to the spool, at which point it is corrupt.

> Message body get lost after call saveChanges() and move to other processor
> --------------------------------------------------------------------------
>
>          Key: JAMES-559
>          URL: http://issues.apache.org/jira/browse/JAMES-559
>      Project: James
>         Type: Bug

>     Versions: 3.0, 2.3.0b2
>     Reporter: Norman Maurer
>     Priority: Blocker
>      Fix For: 3.0, 2.3.0b2

>
> After call saveChanges() in a mailet and move the mail to a other processor with ToProcessor the whole messageBody getting lost.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Updated: (JAMES-559) Message body get lost after call saveChanges() and move to other processor

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
     [ http://issues.apache.org/jira/browse/JAMES-559?page=all ]

Stefano Bagnara updated JAMES-559:
----------------------------------

    Fix Version: 2.3.0b3
                     (was: 2.3.0b2)

> Message body get lost after call saveChanges() and move to other processor
> --------------------------------------------------------------------------
>
>          Key: JAMES-559
>          URL: http://issues.apache.org/jira/browse/JAMES-559
>      Project: James
>         Type: Bug

>     Versions: 3.0, 2.3.0b2
>     Reporter: Norman Maurer
>     Assignee: Stefano Bagnara
>     Priority: Blocker
>      Fix For: 3.0, 2.3.0b3

>
> After call saveChanges() in a mailet and move the mail to a other processor with ToProcessor the whole messageBody getting lost.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Resolved: (JAMES-559) Message body get lost after call saveChanges() and move to other processor

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
     [ http://issues.apache.org/jira/browse/JAMES-559?page=all ]
     
Stefano Bagnara resolved JAMES-559:
-----------------------------------

    Resolution: Fixed

Reverted the SharedFileInputStream to FileInputStream for file based repositories.
This is a workaround that disable previous optimisation.

There is a lot to do in 3.0 about this (both in file and db repositories).

> Message body get lost after call saveChanges() and move to other processor
> --------------------------------------------------------------------------
>
>          Key: JAMES-559
>          URL: http://issues.apache.org/jira/browse/JAMES-559
>      Project: James
>         Type: Bug

>     Versions: 2.3.0b2, 3.0
>     Reporter: Norman Maurer
>     Assignee: Stefano Bagnara
>     Priority: Blocker
>      Fix For: 3.0, 2.3.0b3

>
> After call saveChanges() in a mailet and move the mail to a other processor with ToProcessor the whole messageBody getting lost.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Assigned: (JAMES-559) Message body get lost after call saveChanges() and move to other processor

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
     [ http://issues.apache.org/jira/browse/JAMES-559?page=all ]

Stefano Bagnara reassigned JAMES-559:
-------------------------------------

    Assign To: Stefano Bagnara

> Message body get lost after call saveChanges() and move to other processor
> --------------------------------------------------------------------------
>
>          Key: JAMES-559
>          URL: http://issues.apache.org/jira/browse/JAMES-559
>      Project: James
>         Type: Bug

>     Versions: 3.0, 2.3.0b2
>     Reporter: Norman Maurer
>     Assignee: Stefano Bagnara
>     Priority: Blocker
>      Fix For: 3.0, 2.3.0b2

>
> After call saveChanges() in a mailet and move the mail to a other processor with ToProcessor the whole messageBody getting lost.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org