Skip to content

Fix RpcInvocation attribute cloning#16070

Closed
6mmLIU wants to merge 3 commits intoapache:3.3from
6mmLIU:3.3
Closed

Fix RpcInvocation attribute cloning#16070
6mmLIU wants to merge 3 commits intoapache:3.3from
6mmLIU:3.3

Conversation

@6mmLIU
Copy link

@6mmLIU 6mmLIU commented Feb 4, 2026

What is the purpose of the change?

Fix the issue where RpcInvocation's copy constructor shares the same attributes map with the source invocation.
This causes cloned invocations to be affected by later mutations to the original attributes, which is unexpected for a deep clone.
The change clones the attributes map and adds a unit test to verify the behavior.

Fixes #16069

Checklist

  • Make sure there is a GitHub_issue field for the change.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Make sure gitHub actions can pass. Why the workflow is failing and how to fix it?

@codecov-commenter
Copy link

codecov-commenter commented Feb 4, 2026

Codecov Report

❌ Patch coverage is 63.63636% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.75%. Comparing base (f27d0d7) to head (d237757).

Files with missing lines Patch % Lines
.../java/org/apache/dubbo/common/utils/LRU2Cache.java 63.63% 5 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #16070      +/-   ##
============================================
- Coverage     60.75%   60.75%   -0.01%     
- Complexity    11751    11753       +2     
============================================
  Files          1951     1951              
  Lines         88992    89008      +16     
  Branches      13418    13422       +4     
============================================
+ Hits          54070    54077       +7     
- Misses        29362    29369       +7     
- Partials       5560     5562       +2     
Flag Coverage Δ
integration-tests-java21 32.16% <59.09%> (-0.03%) ⬇️
integration-tests-java8 32.30% <59.09%> (-0.01%) ⬇️
samples-tests-java21 32.21% <63.63%> (+0.02%) ⬆️
samples-tests-java8 29.76% <59.09%> (-0.11%) ⬇️
unit-tests-java11 59.02% <63.63%> (+<0.01%) ⬆️
unit-tests-java17 58.51% <63.63%> (+0.02%) ⬆️
unit-tests-java21 58.50% <63.63%> (-0.01%) ⬇️
unit-tests-java25 58.47% <63.63%> (+<0.01%) ⬆️
unit-tests-java8 59.02% <63.63%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zrlw
Copy link
Contributor

zrlw commented Feb 4, 2026

  1. Are you sure LRU2Cache has something to do with RpcInvocation's copy constructor?
  2. As for me, RpcInvocation's copy constructor shares the same attributes map with the source invocation by design.

@zrlw zrlw added the wontfix label Feb 4, 2026
@zrlw zrlw closed this Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] RpcInvocation copy constructor shares attributes map with source invocation

3 participants