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

penghui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new c174b4c  No need to check op (#9371)
c174b4c is described below

commit c174b4cf0c8ca22e155827468a8c31ff7c997a11
Author: penny <[email protected]>
AuthorDate: Sun Jan 31 00:51:06 2021 +0800

    No need to check op (#9371)
---
 .../src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

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 729b895..36248e8 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
@@ -1722,15 +1722,11 @@ public class ProducerImpl<T> extends ProducerBase<T> 
implements TimerTask, Conne
         } catch (InterruptedException ie) {
             Thread.currentThread().interrupt();
             releaseSemaphoreForSendOp(op);
-            if (op != null) {
-                op.sendComplete(new PulsarClientException(ie, op.sequenceId));
-            }
+            op.sendComplete(new PulsarClientException(ie, op.sequenceId));
         } catch (Throwable t) {
             releaseSemaphoreForSendOp(op);
             log.warn("[{}] [{}] error while closing out batch -- {}", topic, 
producerName, t);
-            if (op != null) {
-                op.sendComplete(new PulsarClientException(t, op.sequenceId));
-            }
+            op.sendComplete(new PulsarClientException(t, op.sequenceId));
         }
     }
 

Reply via email to