gaoran10 commented on code in PR #23817:
URL: https://github.com/apache/pulsar/pull/23817#discussion_r1906296649
##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/intercept/ManagedLedgerInterceptorImplTest.java:
##########
@@ -446,26 +446,33 @@ public Processor inputProcessor() {
return new Processor() {
@Override
public ByteBuf process(Object contextObj, ByteBuf
inputPayload) {
- throw new RuntimeException(failureMsg);
+ Commands.skipBrokerEntryMetadataIfExist(inputPayload);
+ if (inputPayload.readBoolean()) {
+ throw new RuntimeException(failureMsg);
+ }
+ return inputPayload;
}
@Override
public void release(ByteBuf processedPayload) {
// no-op
- fail("the release method can't be reached");
}
};
}
})));
var ledger = factory.open("testManagedLedgerPayloadProcessorFailure",
config);
- var countDownLatch = new CountDownLatch(1);
+ int count = 10;
+ var countDownLatch = new CountDownLatch(count);
+ var successCount = new AtomicInteger(0);
var expectedException = new ArrayList<Exception>();
- ledger.asyncAddEntry("test".getBytes(), 1, 1, new
AsyncCallbacks.AddEntryCallback() {
+
+ var addEntryCallback = new AsyncCallbacks.AddEntryCallback() {
@Override
public void addComplete(Position position, ByteBuf entryData,
Object ctx) {
entryData.release();
Review Comment:
Oh, sorry, we don't need to release the ByteBuf here. I'll remove it. Thanks.
--
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]