You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2021/12/11 15:57:30 UTC
[pulsar] 04/11: [Java Client] Remove invalid call to Thread.currentThread().interrupt(); (#12652)
This is an automated email from the ASF dual-hosted git repository.
penghui pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit 48c701a3861691cb637636c226068cd5eb2d6158
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 40eba48..1c6e987 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
@@ -1663,7 +1663,6 @@ public class ProducerImpl<T> extends ProducerBase<T> implements TimerTask, Conne
processOpSendMsg(opSendMsg);
}
} catch (PulsarClientException e) {
- Thread.currentThread().interrupt();
semaphore.release(batchMessageContainer.getNumMessagesInBatch());
} catch (Throwable t) {
semaphore.release(batchMessageContainer.getNumMessagesInBatch());