You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by ch...@apache.org on 2021/08/29 04:16:14 UTC

[pulsar] branch branch-2.8 updated (ad25379 -> 00f99bb)

This is an automated email from the ASF dual-hosted git repository.

chenhang pushed a change to branch branch-2.8
in repository https://gitbox.apache.org/repos/asf/pulsar.git.


    from ad25379  fix flaky test testReacquireLocksAfterSessionLost (#11815)
     new 014a69c  Fixed accessing MessageImpl after it was enqueued on user queue (#11824)
     new 00f99bb  fix java_test_functions build failed (#11829)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/java/org/apache/pulsar/client/impl/ConsumerBase.java |  9 ++++-----
 tests/docker-images/java-test-functions/pom.xml               | 11 +++++++++++
 2 files changed, 15 insertions(+), 5 deletions(-)

[pulsar] 01/02: Fixed accessing MessageImpl after it was enqueued on user queue (#11824)

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

chenhang pushed a commit to branch branch-2.8
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit 014a69c701513e53508afde69411784d82964924
Author: Matteo Merli <mm...@apache.org>
AuthorDate: Sat Aug 28 08:46:41 2021 -0700

    Fixed accessing MessageImpl after it was enqueued on user queue (#11824)
    
    (cherry picked from commit 666ad3b13cbbf35c329fb3fd433f117d6d893e0a)
---
 .../main/java/org/apache/pulsar/client/impl/ConsumerBase.java    | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java
index f4002c2..d2b4f2a 100644
--- a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java
+++ b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java
@@ -727,8 +727,11 @@ public abstract class ConsumerBase<T> extends HandlerState implements Consumer<T
     }
 
     protected boolean enqueueMessageAndCheckBatchReceive(Message<T> message) {
+        int messageSize = message.size();
         if (canEnqueueMessage(message) && incomingMessages.offer(message)) {
-            increaseIncomingMessageSize(message);
+            // After we have enqueued the messages on `incomingMessages` queue, we cannot touch the message instance
+            // anymore, since for pooled messages, this instance was possibly already been released and recycled.
+            INCOMING_MESSAGES_SIZE_UPDATER.addAndGet(this, messageSize);
         }
         return hasEnoughMessagesForBatchReceive();
     }
@@ -970,10 +973,6 @@ public abstract class ConsumerBase<T> extends HandlerState implements Consumer<T
         return pendingBatchReceives != null && hasNextBatchReceive();
     }
 
-    protected void increaseIncomingMessageSize(final Message<?> message) {
-        INCOMING_MESSAGES_SIZE_UPDATER.addAndGet(this, message.size());
-    }
-
     protected void resetIncomingMessageSize() {
         INCOMING_MESSAGES_SIZE_UPDATER.set(this, 0);
     }

[pulsar] 02/02: fix java_test_functions build failed (#11829)

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

chenhang pushed a commit to branch branch-2.8
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit 00f99bb3e47ee097dcdadfdd6a1458b36264e254
Author: Hang Chen <ch...@apache.org>
AuthorDate: Sun Aug 29 12:08:57 2021 +0800

    fix java_test_functions build failed (#11829)
    
    ### Motivation
    When build java-test-functions, it throw the following exception
    
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project java-test-functions: Compilation failure: Compilation failure:
    [ERROR] /Users/hangc/Workspace/release/pulsar-2.8.1/v2/pulsar/tests/docker-images/java-test-functions/src/main/java/org/apache/pulsar/tests/integration/io/TestGenericObjectSink.java:[21,38] package com.fasterxml.jackson.databind does not exist
    [ERROR] /Users/hangc/Workspace/release/pulsar-2.8.1/v2/pulsar/tests/docker-images/java-test-functions/src/main/java/org/apache/pulsar/tests/integration/io/TestGenericObjectSink.java:[23,31] package org.apache.avro.generic does not exist
    [ERROR] -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
    
    ### Modification
    add maven dependency for java-test-functions module
    
    (cherry picked from commit 42054e057272770aa3e787f9559513e66bf9d1d6)
---
 tests/docker-images/java-test-functions/pom.xml | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/docker-images/java-test-functions/pom.xml b/tests/docker-images/java-test-functions/pom.xml
index 8b21e238..dbf4e4b 100644
--- a/tests/docker-images/java-test-functions/pom.xml
+++ b/tests/docker-images/java-test-functions/pom.xml
@@ -39,6 +39,17 @@
             <artifactId>pulsar-client</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.avro</groupId>
+            <artifactId>avro</artifactId>
+            <version>${avro.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>${jackson.databind.version}</version>
+        </dependency>
     </dependencies>
     <packaging>jar</packaging>