gaoran10 commented on code in PR #23683:
URL: https://github.com/apache/pulsar/pull/23683#discussion_r1873207164
##########
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:
Good idea.
It makes sense. Normally, the release operation will execute in the
Processor's release method, but if exceptions are thrown, the release operation
can't be executed, if we don't release data here, the processor needs to
release data when throwing exceptions.
--
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]