This is an automated email from the ASF dual-hosted git repository.
technoboy pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new 7bc49567385 [fix][txn] OpRequestSend reuse problem cause tbClient
commitTxnOnTopic timeout unexpectedly (#21505)
7bc49567385 is described below
commit 7bc495673853cc7f19afd61e057fe17416accf29
Author: ken <[email protected]>
AuthorDate: Fri Nov 3 17:58:18 2023 +0800
[fix][txn] OpRequestSend reuse problem cause tbClient commitTxnOnTopic
timeout unexpectedly (#21505)
Co-authored-by: fanjianye <[email protected]>
---
.../broker/transaction/buffer/impl/TransactionBufferHandlerImpl.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TransactionBufferHandlerImpl.java
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TransactionBufferHandlerImpl.java
index 625d27329d3..9aac9ab64d0 100644
---
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TransactionBufferHandlerImpl.java
+++
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TransactionBufferHandlerImpl.java
@@ -137,8 +137,9 @@ public class TransactionBufferHandlerImpl implements
TransactionBufferHandler {
if (clientCnx.ctx().channel().isActive()) {
clientCnx.registerTransactionBufferHandler(TransactionBufferHandlerImpl.this);
outstandingRequests.put(op.requestId, op);
+ final long requestId = op.requestId;
timer.newTimeout(timeout -> {
- OpRequestSend peek =
outstandingRequests.remove(op.requestId);
+ OpRequestSend peek =
outstandingRequests.remove(requestId);
if (peek != null && !peek.cb.isDone() &&
!peek.cb.isCompletedExceptionally()) {
peek.cb.completeExceptionally(new
TransactionBufferClientException
.RequestTimeoutException());