[prev in list] [next in list] [prev in thread] [next in thread] 

List:       james-dev
Subject:    [jira] [Commented] (JAMES-3477) MimeMessageCopyOnWriteProxy is not thread safe
From:       "ASF GitHub Bot (Jira)" <server-dev () james ! apache ! org>
Date:       2020-12-31 13:19:00
Message-ID: JIRA.13345492.1607684569000.388955.1609420740556 () Atlassian ! JIRA
[Download RAW message or body]


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

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

jeantil commented on a change in pull request #282:
URL: https://github.com/apache/james-project/pull/282#discussion_r550481314



##########
File path: server/protocols/webadmin/webadmin-mailrepository/src/test/java/org/apache/james/webadmin/routes/MailRepositoriesRoutesTest.java
 ##########
@@ -107,6 +109,7 @@
     private static final MailQueueName CUSTOM_QUEUE = \
MailQueueName.of("customQueue");  private static final String NAME_1 = "name1";
     private static final String NAME_2 = "name2";
+    private static final byte[] MESSAGE_BYTES = "header: value \
\r\n".getBytes(UTF_8);

Review comment:
       another occurence where the value itself has been extracted to a local \
constant

##########
File path: server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/JamesMailetContextTest.java
 ##########
@@ -289,7 +291,7 @@ public void bounceShouldNotFailWhenNonConfiguredPostmaster() \
                throws Exception {
             .name("mail1")
             .sender(mailAddress)
             .addRecipient(mailAddress)
-            .mimeMessage(MimeMessageUtil.defaultMimeMessage())
+            .mimeMessage(MimeMessageUtil.mimeMessageFromBytes("header: \
value\r\n".getBytes(UTF_8)))

Review comment:
       considering how many times MimeMessageUtil.mimeMessageFromBytes("header: \
value\r\n".getBytes(UTF_8) is repeated over multiple tests, it could be worth a \
constant.  I think FakeMail is a good candidate to hold the constant or a factory \
method + constant if we want to avoid sharing the byte[]

##########
File path: server/protocols/webadmin/webadmin-mailrepository/src/test/java/org/apache/james/webadmin/service/ReprocessingServiceTest.java
 ##########
@@ -61,6 +63,7 @@
     private static final MailQueueName SPOOL = MailQueueName.of("spool");
     private static final Consumer<MailKey> NOOP_CONSUMER = key -> { };
     private static final Optional<String> NO_TARGET_PROCESSOR = Optional.empty();
+    private static final byte[] MESSAGE_BYTES = "header: value \
\r\n".getBytes(UTF_8);

Review comment:
       more of the same 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> MimeMessageCopyOnWriteProxy is not thread safe
> ----------------------------------------------
> 
> Key: JAMES-3477
> URL: https://issues.apache.org/jira/browse/JAMES-3477
> Project: James Server
> Issue Type: Wish
> Reporter: Benoit Tellier
> Priority: Major
> 
> https://www.mail-archive.com/server-dev@james.apache.org/msg69221.html
> & https://github.com/jeantil/james-project/commit/c0354ea21c5b0a8f6d46e9919f7db0d97db9eb23
>  proves there is a concurrency issue in MimeMessageCopyOnWriteProxy class that we \
> need to investigate. It causes our test suite to be flacky.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic