Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
[fix][txn] OpRequestSend reuse problem cause tbClient commitTxnOnTopi…
Browse files Browse the repository at this point in the history
…c timeout unexpectedly (apache#21505)

Co-authored-by: fanjianye <[email protected]>
  • Loading branch information
TakaHiR07 and fanjianye authored Nov 3, 2023
1 parent d47637f commit f3f5fbc
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ public void endTxn(OpRequestSend op) {
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());
Expand Down

0 comments on commit f3f5fbc

Please sign in to comment.