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 02:49:20 GMT

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

ASF GitHub Bot commented on JAMES-1823:
---------------------------------------

GitHub user leepaul21 opened a pull request:

    https://github.com/apache/james-project/pull/63

    JAMES-1823 quotaUpdater is invoked more than one time for a message addition or deletion

    I'm not sure 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. My purpose in the
patch is not to register the same listener duplicately in an instance of DefaultDelegatingMailboxListener.
For this, I've added some code and data structure for checking duplication. If my solution
isn't suitable for the whole system, you don't have to use it.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/leepaul21/james-project JAMES-1823

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/james-project/pull/63.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #63
    
----
commit 7b6fbadcdfcec9a872d3d19c6ca7060e1c7ac25e
Author: Dongho Lee <dhlee@kaoni.com>
Date:   2016-09-25T02:31:59Z

    JAMES-1823 quotaUpdater is invoked more than one time for a message addition or deletion

----


> 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-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message