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

xiangying pushed a commit to branch xiangying/branch-2.10/return_loclThread
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit 253d455c273870b87d1d14ece126853aa0c6eba3
Author: xiangying <[email protected]>
AuthorDate: Fri Mar 10 13:58:32 2023 +0800

    [fix][client][branch-2.10]Return local thread for the `newThread`
---
 .../src/main/java/org/apache/pulsar/client/util/ExecutorProvider.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/pulsar-client/src/main/java/org/apache/pulsar/client/util/ExecutorProvider.java
 
b/pulsar-client/src/main/java/org/apache/pulsar/client/util/ExecutorProvider.java
index 8997d714194..90e1a59ed4d 100644
--- 
a/pulsar-client/src/main/java/org/apache/pulsar/client/util/ExecutorProvider.java
+++ 
b/pulsar-client/src/main/java/org/apache/pulsar/client/util/ExecutorProvider.java
@@ -52,9 +52,10 @@ public class ExecutorProvider {
 
         @Override
         public Thread newThread(Runnable r) {
-            thread = super.newThread(r);
+            Thread thread = super.newThread(r);
             thread.setUncaughtExceptionHandler((t, e) ->
                     log.error("Thread {} got uncaught Exception", t.getName(), 
e));
+            this.thread = thread;
             return thread;
         }
     }

Reply via email to