james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <server-...@james.apache.org>
Subject [jira] [Commented] (JAMES-1823) quotaUpdater is invoked more than one time for a message addition or deletion
Date Sun, 25 Sep 2016 13:14:20 GMT

    [ https://issues.apache.org/jira/browse/JAMES-1823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15520811#comment-15520811

ASF GitHub Bot commented on JAMES-1823:

Github user chibenwa commented on the issue:

    In DefaultDelegatingMailboxListener, the intent was to add a business logic layer over
listener lists, especially about updating stored listeners upon events.
    In over worlds, there is no need to add logic for avoiding multiple storage of listeners
as it is some tasks of underlying layers (not to mention that your implementation is not concurrent
friendly, as applied at the wrong layer).
    To obtain desired effect, you should modify type for **globalListeners** in **MailboxListenerRegistry**
to **ConcurrentSkipListSet** or over concurrent friendly set datastructure.

> 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
>         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

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

View raw message