dao-jun commented on code in PR #23683:
URL: https://github.com/apache/pulsar/pull/23683#discussion_r1872539035
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpAddEntry.java:
##########
@@ -139,8 +139,14 @@ public void initiate() {
lastInitTime = System.nanoTime();
if (ml.getManagedLedgerInterceptor() != null) {
long originalDataLen = data.readableBytes();
- payloadProcessorHandle = ml.getManagedLedgerInterceptor()
- .processPayloadBeforeLedgerWrite(this.getCtx(),
duplicateBuffer);
+ try {
+ payloadProcessorHandle = ml.getManagedLedgerInterceptor()
+ .processPayloadBeforeLedgerWrite(this.getCtx(),
duplicateBuffer);
+ } catch (Exception e) {
+ log.error("[{}] Error processing payload before ledger
write", ml.getName(), e);
Review Comment:
+1.
Referring to:
https://github.com/apache/pulsar/blob/master/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java#L811-L879
it will call OpAddEntry.failed(..) before OpAddEntry.initiate(). Since
OpAddEntry.initiate() retained the buffer, so call `duplicateBuffer.release()`
here is reasonable.
--
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]