[
https://issues.apache.org/jira/browse/JAMES-3477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17254948#comment-17254948
]
ASF GitHub Bot commented on JAMES-3477:
---------------------------------------
chibenwa opened a new pull request #282:
URL: https://github.com/apache/james-project/pull/282
Previous implementation was not thread safe as demonstrated
by @jeantil and @mbaechler. Upon concurrent writes and disposes
it leads to corruption of the underlying message, throwing
NullPointerExceptions and leads to data loss. [1]
Attempts to make it thread safe like [2] were complex, error
prone (double read-write lock involved!), and ultimately did
not manage to protect 'optimized' raw access to the underlying
data thus not fully addressing the concurrency issues.
Benchmarks were conducted in order to compare the Copy On
Write implementation with its always-copy equivalent. We
highlighted minor benefits of the copy-on-write version (
up to a few percent) both on compute time and memory allocation.
Only for bigger messages (10MB) did we reach higher differences,
of around 10%.
Note that the actual copy uses DeferredFileOutputStream
(commons.io) thus limits memory usage to 100KB upon copy.
[1]
https://github.com/apache/james-project/pull/280/commits/09b5554bbcbbb98757910d59bac54f97ee1f8b4f
[2] https://github.com/apache/james-project/pull/280
[3] https://github.com/apache/james-project/pull/280#issuecomment-745211736
----------------------------------------------------------------
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:
[email protected]
> 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/[email protected]/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: [email protected]
For additional commands, e-mail: [email protected]