You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by eo...@apache.org on 2021/11/09 13:39:52 UTC

[pulsar] 03/03: [Java Client] Remove invalid call to Thread.currentThread().interrupt(); (#12652)

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

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

commit f849d467689ed6e3e30438722e3ebc6779d059ae
Author: Lari Hotari <lh...@users.noreply.github.com>
AuthorDate: Sun Nov 7 01:50:13 2021 +0200

    [Java Client] Remove invalid call to Thread.currentThread().interrupt(); (#12652)
    
    - Thread.currentThread().interrupt() shouldn't be called here.
      - it must only be called when handling an InterruptedException.
      - this looks like a copy-paste bug introduced in
        https://github.com/apache/pulsar/pull/731/files#diff-d6fcf8aa2d0035cc386dca0942a452343d6854763c7fd397efa4e660c0069767R1183
    
    (cherry picked from commit b5f78f8ae5b4f2419e97044541722062fe388d9d)
---
 .../src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java        | 1 -
 1 file changed, 1 deletion(-)

diff --git a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
index 0f27a63..34e4b6c 100644
--- a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
+++ b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
@@ -1775,7 +1775,6 @@ public class ProducerImpl<T> extends ProducerBase<T> implements TimerTask, Conne
                     processOpSendMsg(opSendMsg);
                 }
             } catch (PulsarClientException e) {
-                Thread.currentThread().interrupt();
                 semaphore.ifPresent(s -> s.release(batchMessageContainer.getNumMessagesInBatch()));
             } catch (Throwable t) {
                 semaphore.ifPresent(s -> s.release(batchMessageContainer.getNumMessagesInBatch()));