[ https://issues.apache.org/jira/browse/JAMES-2298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16676044#comment-16676044 ]
ASF GitHub Bot commented on JAMES-2298: --------------------------------------- Github user chibenwa commented on a diff in the pull request: https://github.com/apache/james-project/pull/129#discussion_r230980594 --- Diff: server/queue/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueue.java --- @@ -197,20 +192,14 @@ public void enQueue(Mail mail, long delay, TimeUnit unit) throws MailQueueExcept } } + indexWriter.addDocument(toIndexDocument(mail, key)); + indexWriter.commit(); --- End diff -- I would say that `committing on each document` is slightly overkill. We can tolerate IMO the searched vue to be eventually consistent. Hence I would not commit at all. But I do understand this commit is useful for test correctness. What I would propose is to add a `commitIndex` method on the file mail queue. This method could be called by a `await` method in the MailQueueContract. By calling `await` where appropriate you can then correct the tests. > FileMailQueue do not support remove > ----------------------------------- > > Key: JAMES-2298 > URL: https://issues.apache.org/jira/browse/JAMES-2298 > Project: James Server > Issue Type: Bug > Components: Queue > Affects Versions: master > Reporter: Tellier Benoit > Priority: Major > > An exception is thrown or the code badly modify the state of the queue -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org