Skip to content

[ISSUE #10797] Propagate proxy end transaction result - #10798

Open
Aias00 wants to merge 2 commits into
apache:developfrom
Aias00:fix/proxy-end-transaction-10797
Open

[ISSUE #10797] Propagate proxy end transaction result#10798
Aias00 wants to merge 2 commits into
apache:developfrom
Aias00:fix/proxy-end-transaction-10797

Conversation

@Aias00

@Aias00 Aias00 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Which Issue(s) This PR Fixes

Fixes #10797

Brief Description

  • Stop returning success before Proxy remoting end-transaction operations complete
  • Write the success response only after messagingProcessor.endTransaction(...) completes
  • Route async failures through the existing remoting error response mapping
  • Add regression tests for success and broker-exception failure responses

How Did You Test This Change?

  • mvn -pl proxy -Dtest=TransactionActivityTest test

The target test passed: 2 tests, 0 failures, 0 errors. The Maven run completed with BUILD SUCCESS; the output still includes existing Jacoco/JDK17 instrumentation warnings.

Copilot AI review requested due to automatic review settings August 3, 2026 14:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Propagates the async result of proxy end-transaction operations to the remoting response, ensuring success is only returned after the underlying endTransaction(...) future completes (and failures map to the appropriate error response).

Changes:

  • Make TransactionActivity write the response asynchronously after messagingProcessor.endTransaction(...) completes.
  • Route async failures through the existing remoting error response mapping.
  • Add regression tests for success and broker-exception failure responses.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
proxy/src/main/java/org/apache/rocketmq/proxy/remoting/activity/TransactionActivity.java Defers success response until the end-transaction future completes; maps async failures to error responses.
proxy/src/test/java/org/apache/rocketmq/proxy/remoting/activity/TransactionActivityTest.java Adds unit coverage for async success and async failure response behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +66 to +70
).thenRun(() -> writeResponse(ctx, context, request, response))
.exceptionally(t -> {
writeErrResponse(ctx, context, request, t);
return null;
});
Comment on lines +64 to +69
private ChannelHandlerContext ctx = new SimpleChannelHandlerContext(new SimpleChannel(null, "0.0.0.0:0", "1.1.1.1:1")) {
@Override
public ChannelFuture writeAndFlush(Object msg, ChannelPromise promise) {
return null;
}
};
Comment on lines +80 to +84
@Test
public void testEndTransactionWritesSuccessAfterFutureCompletes() throws Exception {
when(messagingProcessor.endTransaction(any(), eq("topic"), eq("transactionId"), eq("msgId"),
eq("producerGroup"), eq(TransactionStatus.COMMIT), eq(false)))
.thenReturn(CompletableFuture.completedFuture(null));
@codecov-commenter

codecov-commenter commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.25%. Comparing base (eddb235) to head (70960ba).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10798      +/-   ##
=============================================
- Coverage      48.34%   48.25%   -0.10%     
+ Complexity     13527    13498      -29     
=============================================
  Files           1380     1380              
  Lines         101104   101142      +38     
  Branches       13107    13120      +13     
=============================================
- Hits           48882    48807      -75     
- Misses         46267    46342      +75     
- Partials        5955     5993      +38     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Proxy remoting end transaction ignores async failures

3 participants