poorbarcode commented on code in PR #25767:
URL: https://github.com/apache/pulsar/pull/25767#discussion_r3247466328


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java:
##########
@@ -533,6 +531,15 @@ public void readEntriesFailed(ManagedLedgerException 
exception, Object ctx) {
         brokerService.executor().schedule(this::readMoreEntries, 
waitTimeMillis, TimeUnit.MILLISECONDS);
     }
 
+    private void completeFailedReadTask(Object ctx) {
+        if (ctx instanceof InFlightTask) {

Review Comment:
   If you think the object ctx will not be an instance of `InflightTask` in the 
future, please add an error log for the logic case, which can quickly expose 
incorrect modifications.
   



##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java:
##########
@@ -533,6 +531,15 @@ public void readEntriesFailed(ManagedLedgerException 
exception, Object ctx) {
         brokerService.executor().schedule(this::readMoreEntries, 
waitTimeMillis, TimeUnit.MILLISECONDS);
     }
 
+    private void completeFailedReadTask(Object ctx) {
+        if (ctx instanceof InFlightTask) {
+            InFlightTask inFlightTask = (InFlightTask) ctx;
+            if (inFlightTask.entries == null) {

Review Comment:
   If the value of `inFlightTask.entries` is not null, there must be a bug; you 
should add an error log in the `else` logic branch



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to