Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.3.0
    • Labels:
      None
    • Environment:
      Linux

      Description

      I received several hundred of the following messages in my mailstore log and lost entire inboxes at the same time:

      04/05/05 11:08:30 DEBUG mailstore: Exception retrieving mail:
      java.lang.RuntimeException: Exception caught while retrieving an
      object, cause: java.lang.OutOfMemoryError, so we're deleting it... good
      riddance!

      I'm guessing whoever was checking their email at this time lost all their mail.

      I was also asked to remind you to change your error message. I must say, I laughed after reading "good riddance" in regard to all of these valid emails.

      1. AvalonMailRepository.java
        17 kB
        Theodore Watson
      2. AvalonMailRepository.java.diff
        1 kB
        Kris Maglione
      3. james.diff
        2 kB
        Kris Maglione
      4. james2.diff
        2 kB
        Kris Maglione

        Activity

        Hide
        tedpwatson Theodore Watson added a comment -

        A quick fix for 2.2.0.

        Show
        tedpwatson Theodore Watson added a comment - A quick fix for 2.2.0.
        Hide
        kmaglione Kris Maglione added a comment -

        Added a diff of the above patch

        Show
        kmaglione Kris Maglione added a comment - Added a diff of the above patch
        Hide
        danny@apache.org Danny Angus added a comment -

        Patch applied, commited "Completed: At revision: 191791"

        Show
        danny@apache.org Danny Angus added a comment - Patch applied, commited "Completed: At revision: 191791"
        Hide
        bago Stefano Bagnara added a comment -

        OutOfMemoryError is not a RuntimeException but an Error, isn't it?

        The debug was from that code but I think the exception was really a RuntimeException and not an OutOfMemoryError: it probably was encapsulated in a RuntimeException before.

        Let's read the DEBUG log...

        > DEBUG mailstore: Exception retrieving mail:
        > java.lang.RuntimeException: Exception caught while retrieving an
        > object, cause: java.lang.OutOfMemoryError, so we're deleting it...
        > good riddance!

        So the "re" caught is a Runtime and is created by the File_Persistent_Object_Repository with this snippet:

        catch( final Throwable e )
        {
        throw new RuntimeException(
        "Exception caught while retrieving an object, cause: " + e.toString() );
        }

        I think this patch is wrong (the OOME is not a RuntimeException!). You should change the File_Persistent_Object_Repository.

        Show
        bago Stefano Bagnara added a comment - OutOfMemoryError is not a RuntimeException but an Error, isn't it? The debug was from that code but I think the exception was really a RuntimeException and not an OutOfMemoryError: it probably was encapsulated in a RuntimeException before. Let's read the DEBUG log... > DEBUG mailstore: Exception retrieving mail: > java.lang.RuntimeException: Exception caught while retrieving an > object, cause: java.lang.OutOfMemoryError, so we're deleting it... > good riddance! So the "re" caught is a Runtime and is created by the File_Persistent_Object_Repository with this snippet: catch( final Throwable e ) { throw new RuntimeException( "Exception caught while retrieving an object, cause: " + e.toString() ); } I think this patch is wrong (the OOME is not a RuntimeException!). You should change the File_Persistent_Object_Repository.
        Hide
        danny@apache.org Danny Angus added a comment -

        Agree with Stefano, change commited to use the type of the cause of the RE as the criteria in the decsion whether or not to delete.
        If the cause is an Error don't delete, else delete.

        Show
        danny@apache.org Danny Angus added a comment - Agree with Stefano, change commited to use the type of the cause of the RE as the criteria in the decsion whether or not to delete. If the cause is an Error don't delete, else delete.
        Hide
        kmaglione Kris Maglione added a comment -

        Suggest the attached diff.
        Adds Throwable to the RuntimeException thrown by File_Persistent_Object_Repository.
        AvalonMailRepository checks if the cause subclasses Error, and deletes the message if it doesn't.

        Show
        kmaglione Kris Maglione added a comment - Suggest the attached diff. Adds Throwable to the RuntimeException thrown by File_Persistent_Object_Repository. AvalonMailRepository checks if the cause subclasses Error, and deletes the message if it doesn't.
        Hide
        kmaglione Kris Maglione added a comment -

        Sorry... re.getClass() should be re.getCause().getClass()

        Show
        kmaglione Kris Maglione added a comment - Sorry... re.getClass() should be re.getCause().getClass()
        Hide
        kmaglione Kris Maglione added a comment -

        Sorry for all the noise.

        The last diff was backwards and incomplete. This one is correct.

        Show
        kmaglione Kris Maglione added a comment - Sorry for all the noise. The last diff was backwards and incomplete. This one is correct.
        Hide
        kmaglione Kris Maglione added a comment -

        Unless another commit has happened since the first, this issue is not resolved. The first patch did not fix the problem, as noted above.

        Would someone please reopen this issue.

        Show
        kmaglione Kris Maglione added a comment - Unless another commit has happened since the first, this issue is not resolved. The first patch did not fix the problem, as noted above. Would someone please reopen this issue.
        Hide
        danny@apache.org Danny Angus added a comment -

        Please don't post speculative comments.
        This issues is resolved fixed, if you believe it may not be fixed please provide evidence.
        For the record there were three commits, and the change was discussed on server-dev@

        FWIW I will happily re-open this defect if it can be demonstrated that it still exists.

        Show
        danny@apache.org Danny Angus added a comment - Please don't post speculative comments. This issues is resolved fixed, if you believe it may not be fixed please provide evidence. For the record there were three commits, and the change was discussed on server-dev@ FWIW I will happily re-open this defect if it can be demonstrated that it still exists.
        Hide
        danny@apache.org Danny Angus added a comment -

        Closing issue fixed in released version.

        Show
        danny@apache.org Danny Angus added a comment - Closing issue fixed in released version.

          People

          • Assignee:
            danny@apache.org Danny Angus
            Reporter:
            tedpwatson Theodore Watson
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development