Issue Details (XML | Word | Printable)

Key: JAMES-268
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Noel J. Bergman
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JAMES Server

Spooler.accept(...) can leave locked messages and leak memory

Created: 22/Apr/04 12:42 AM   Updated: 05/Jun/04 07:29 PM
Return to search
Component/s: MailStore & MailRepository
Affects Version/s: 2.2.0
Fix Version/s: 2.2.0

Time Tracking:
Not Specified

Resolution Date: 22/Apr/04 01:50 AM


 Description  « Hide
I believe there is a memory leak under an error condition in the spooler that I'll be fixing, but that should be able to wait for a 2.2.1. If I am correct, the nature of the error is here:

 if (lock(s)) {
     MailImpl mail = null;
     try {
        mail = retrieve(s);
     } catch (javax.mail.MessagingException e) {
       ...
     }
     if (mail == null) {
        continue;
     }

If retrieve returns null or throws an exception, the lock is kept, and we leak memory. Also ...

     if (filter.accept (mail.getName(),
                        mail.getState(),
                        mail.getLastUpdated().getTime(),
                        mail.getErrorMessage())) {
        return mail;
     }

If the filter doesn't accept, we leak the lock info, although we'll eventually clean it up. The problem here is that the message is forever locked for this specific thread.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #109117 Thu Apr 22 01:54:03 UTC 2004 noel Fix JAMES-268. Make sure that messages are not left in the lock set if there is an error retrieving them or the filter does not accept them for processing at this time.
Files Changed
MODIFY /james/server/branches/branch_2_1_fcs/src/java/org/apache/james/mailrepository/AvalonSpoolRepository.java
MODIFY /james/server/branches/branch_2_1_fcs/src/java/org/apache/james/mailrepository/JDBCSpoolRepository.java