Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2427#discussion_r233513734
  
    --- Diff: 
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java
 ---
    @@ -564,34 +604,59 @@ public CoreMessage setUserID(UUID userID) {
        /**
         * I am keeping this synchronized as the decode of the Properties is 
lazy
         */
    -   protected TypedProperties checkProperties() {
    +   protected final TypedProperties checkProperties() {
           try {
    +         TypedProperties properties = this.properties;
              if (properties == null) {
    -            synchronized (this) {
    -               if (properties == null) {
    -                  TypedProperties properties = new TypedProperties();
    -                  if (buffer != null && propertiesLocation >= 0) {
    -                     final ByteBuf byteBuf = 
buffer.duplicate().readerIndex(propertiesLocation);
    -                     properties.decode(byteBuf, coreMessageObjectPools == 
null ? null : coreMessageObjectPools.getPropertiesDecoderPools());
    -                  }
    -                  this.properties = properties;
    -               }
    +            properties = getOrInitializeTypedProperties();
    +         }
    +         return properties;
    +      } catch (Throwable e) {
    +         throw onCheckPropertiesError(e);
    --- End diff --
    
    this MUST throw the original exception if such exception, to keep exception 
behaviour of any code upstream that maybe catching specific exceptions..


---

Reply via email to