You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Tellier Benoit (JIRA)" <ji...@apache.org> on 2019/05/20 03:50:00 UTC
[jira] [Resolved] (MAILBOX-350) Double added events from
StoreMessageManager can cause wrong sequence numbers
[ https://issues.apache.org/jira/browse/MAILBOX-350?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tellier Benoit resolved MAILBOX-350.
------------------------------------
Resolution: Fixed
Fix Version/s: 3.3.0
This serie of commits solved this issue and contributed related tests:
{code:java}
c4007e5862 MAILBOX-350 Solve double added events firing upon copies
e7c9167c9e MAILBOX-350 Add more tests for event firing in MailboxManagerTest
9b1d3ce497 MAILBOX-350 Improve existing EventTests
20a7ac4470 MAILBOX-350 Avoid closing an already closed CassandraCluster
1c62cfcff4 MAILBOX-350 Review MailboxManagerTest: Use nested tests
11e3832686 MAILBOX-350 Review MailboxManagerTest: Remove no more needed visibility qualifiers
0d28c9df79 MAILBOX-350 Review MailboxManagerTest: Migrate to Junit 5
7c19e19f60 MAILBOX-350 Review MailboxManagerTest: Rely on AssertJ soft assertions
315e24e7d4 MAILBOX-350 Review MailboxManagerTest: Tests should throw Exception
17e5ecad5d MAILBOX-350 Review MailboxManagerTest: Get rid of ExpectedException
466a4f461a MAILBOX-350 Add a test demonstrating UidMsnConverter is idempotent
{code}
> Double added events from StoreMessageManager can cause wrong sequence numbers
> -----------------------------------------------------------------------------
>
> Key: MAILBOX-350
> URL: https://issues.apache.org/jira/browse/MAILBOX-350
> Project: James Mailbox
> Issue Type: Bug
> Components: store
> Affects Versions: master, 3.1.0, 3.2.0
> Environment: Tested on Linux with Maildir storage and James 3.1.0
> Reporter: Johan Tjernström
> Priority: Major
> Fix For: 3.3.0
>
>
> When a COPY command is issued for a message two added events are dispatched from StoreMessageManager (mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageManager.java). The first event (row 712) use the message UID from the source mailbox and the second event (row 743) use a new UID from the target mailbox. If the source UID is "available" in the target mailbox a new entry will be added to the target mailbox UidMsnConverter which will mess up the sequence numbers.
> In the example below two connection A and B are used. A selects the Inbox and B selects the Trash mailbox. Inbox and Trash contains one message each.
> {{* OK JAMES IMAP4rev1 Server Server imapsrv is ready.}}
> {{A1 LOGIN "user@test.com" "1234"}}
> {{A1 OK LOGIN completed.}}
> {{A2 SELECT inbox}}
> {{* FLAGS (\Answered \Deleted \Draft \Flagged \Seen)}}
> {{* 1 EXISTS}}
> {{* 0 RECENT}}
> {{* OK [UIDVALIDITY 1892339292] UIDs valid}}
> {{* OK [UNSEEN 1] MailboxMessage 1 is first unseen}}
> {{* OK [PERMANENTFLAGS (\Answered \Deleted \Draft \Flagged \Seen)] Limited}}
> {{* OK [HIGHESTMODSEQ 1538993301626] Highest}}
> {{* OK [UIDNEXT 2] Predicted next UID}}
> {{A2 OK [READ-WRITE] SELECT completed.}}
> {{A3 FETCH 1:* (FLAGS)}}
> {{* 1 FETCH (FLAGS ())}}
> {{A3 OK FETCH completed.}}
> {{* OK JAMES IMAP4rev1 Server Server imapsrv is ready.}}
> {{B1 LOGIN "user@test.com" "1234"}}
> {{B1 OK LOGIN completed.}}
> {{B3 SELECT Trash}}
> {{* FLAGS (\Answered \Deleted \Draft \Flagged \Seen)}}
> {{* 1 EXISTS}}
> {{* 1 RECENT}}
> {{* OK [UIDVALIDITY 286991256] UIDs valid}}
> {{* OK [UNSEEN 1] MailboxMessage 1 is first unseen}}
> {{* OK [PERMANENTFLAGS (\Answered \Deleted \Draft \Flagged \Seen)] Limited}}
> {{* OK [HIGHESTMODSEQ 1538993663429] Highest}}
> {{* OK [UIDNEXT 3] Predicted next UID}}
> {{B3 OK [READ-WRITE] SELECT completed.}}
> Clear Trash
> {{B4 STORE 1 +FLAGS (\Deleted)}}
> {{* 1 FETCH (FLAGS (\Deleted \Recent))}}
> {{B4 OK STORE completed.}}
> {{B5 EXPUNGE}}
> {{* 1 EXPUNGE}}
> {{* 0 RECENT}}
> {{B5 OK EXPUNGE completed.}}
> {{B6 FETCH 1:* (FLAGS)}}
> {{B6 BAD FETCH failed. Invalid messageset.}}
> Copy message from Inbox to Trash
> {{A4 COPY 1 Trash}}
> {{A4 OK [COPYUID 286991256 1 3] COPY completed.}}
> Check messages in Trash
> {{B7 FETCH 1:* (FLAGS)}}
> {{* 2 FETCH (FLAGS (\Recent))}}
> {{* 2 EXISTS}} <-- SHOULD ONLY BE ONE!
> {{* 2 RECENT}}
> {{B7 OK FETCH completed.}}
> Removing the first event seems to fix the problem.
> (BTW: Is it correct to allow reuse of UIDs in UidMsnConverter?)
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org