You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/08/12 02:46:20 UTC

[GitHub] [pulsar] littleorca commented on issue #11282: NPE in OpReadEntry

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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org