[ 
https://issues.apache.org/jira/browse/JAMES-1823?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul Lee updated JAMES-1823:
----------------------------
    Attachment: DefaultDelegatingMailboxListener.java

It would be a great pleasure to me if I could provide my patch for it. 
I'm not sure, however, if my solution is appropriate and on the right direction 
from the perspective of the system and its architecture because I don't fully 
understand it.
Anyway, I've attached my patched version of the file 
'DefaultDelegatingMailboxListener.java'.
My purpose in the patch is not to register the same listener in an instance of 
DefaultDelegatingMailboxListener.
I've added some checking code and data structure in order to achieve that.
If my solution isn't suitable for the whole system, you don't have to use it.

> quotaUpdater is invoked more than one time for a message addition or deletion
> -----------------------------------------------------------------------------
>
>                 Key: JAMES-1823
>                 URL: https://issues.apache.org/jira/browse/JAMES-1823
>             Project: James Server
>          Issue Type: Bug
>          Components: MailStore & MailRepository
>    Affects Versions: master
>            Reporter: Paul Lee
>             Fix For: master
>
>         Attachments: DefaultDelegatingMailboxListener.java
>
>
> The following code snippet in 'init' method in 'StoreMailboxManager.java' is 
> executed multiple times such that the same quotaUpdater is registered as a 
> global listener more than once.
>         if (quotaUpdater != null && quotaUpdater instanceof MailboxListener) {
>             this.addGlobalListener((MailboxListener) quotaUpdater, null);
>         }
> The above code is invoked multiple times by the below configuration in 
> 'spring-mailbox.xml'.
> <import resource="classpath:META-INF/spring/mailbox-jpa.xml"/>
> <import resource="classpath:META-INF/spring/mailbox-maildir.xml"/>
> The quota increase or decrease is currently being executed twice for each 
> message addition or deletion in our tests because the same quota updater is 
> registered twice by the above config. For example, if a message of 1MB is 
> appended to a mailbox, 'getCurrentStorage' method in 
> 'InMemoryCurrentQuotaManager.java' returns a size which is 2MBs larger than 
> before.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to