pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] sijie commented on a change in pull request #3581: Fix thread safety violation on ProducerImpl
Date Thu, 14 Feb 2019 02:31:06 GMT
sijie commented on a change in pull request #3581: Fix thread safety violation on ProducerImpl
URL: https://github.com/apache/pulsar/pull/3581#discussion_r256670903
 
 

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
 ##########
 @@ -803,12 +806,12 @@ protected boolean verifyLocalBufferIsNotCorrupted(OpSendMsg op) {
     }
 
     protected static final class OpSendMsg {
-        MessageImpl<?> msg;
-        List<MessageImpl<?>> msgs;
-        ByteBufPair cmd;
-        SendCallback callback;
-        long sequenceId;
-        long createdAt;
+        volatile MessageImpl<?> msg;
 
 Review comment:
   @lovelle Have you seen any issues regarding these fields? OpSendMsg is a per-message structure.
I don't expect it to be shared by multiple threads a lot. Is it too heavy to convert all fields
to `volatile`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

Mime
View raw message