lhotari commented on a change in pull request #9763:
URL: https://github.com/apache/pulsar/pull/9763#discussion_r584609027



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java
##########
@@ -190,12 +190,14 @@ protected long getNumberOfEntriesInBacklog() {
 
     @Override
     protected void disableReplicatorRead() {
-        // deactivate cursor after successfully close the producer
-        this.cursor.setInactive();
+        if (this.cursor != null) {
+            // deactivate cursor after successfully close the producer
+            this.cursor.setInactive();

Review comment:
       It shouldn't be necessary in this cases since in the 
`PersistentReplicator` class, the cursor field is never updated to null after 
it has been set by the `openCursorComplete` callback. The cursor field is null 
only before the cursor has been opened.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to