littleorca commented on issue #11282:
URL: https://github.com/apache/pulsar/issues/11282#issuecomment-897304788


   > @littleorca I am a litter confused for the NPE in 
`cursor.readOperationCompleted()`, would you please provide the stack of the 
NPE?
   
   Try this test case:
   
   ```java
       @Test
       public void readEntryNPE() throws Exception {
           MetadataStore metadataStore = new ZKMetadataStore(ZK_CONNECTION, 
MetadataStoreConfig.builder().build());
           ClientConfiguration bkClientConf = new ClientConfiguration();
           bkClientConf.setMetadataServiceUri(METADATA_SERVICE_URI);
           ManagedLedgerFactoryImpl factory = new 
ManagedLedgerFactoryImpl(metadataStore, bkClientConf);
           ManagedLedger ml = factory.open(ML_NAME);
           ManagedCursor c = ml.openCursor(CURSOR_NAME);
           Position pos = ml.addEntry("Hello 
world!".getBytes(StandardCharsets.UTF_8));
           c.close();
           ml.close();
           factory.shutdown();
   
           factory = new ManagedLedgerFactoryImpl(metadataStore, bkClientConf);
           ml = factory.open(ML_NAME);
           c = ml.openCursor(CURSOR_NAME);
           c.markDelete(pos);
           ml.terminate();
           ml.close();
           factory.shutdown();
   
           factory = new ManagedLedgerFactoryImpl(metadataStore, bkClientConf);
           ml = factory.open(ML_NAME);
           c = ml.openCursor(CURSOR_NAME);
           c.seek(pos);
           c.readEntries(1);
       }
   ```
   


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