You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "6mmLIU (via GitHub)" <gi...@apache.org> on 2026/02/04 02:46:58 UTC
[I] [Bug] RpcInvocation copy constructor shares attributes map with source invocation [dubbo]
6mmLIU opened a new issue, #16069:
URL: https://github.com/apache/dubbo/issues/16069
### Pre-check
- [x] I am sure that all the content I provide is in English.
### Search before asking
- [x] I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar issues.
### Apache Dubbo Component
Java SDK (apache/dubbo)
### Dubbo Version
Dubbo 3.3.6, OpenJDK 17, Ubuntu 20.04
### Steps to reproduce this issue
1. Create a RpcInvocation instance and put attributes into it (e.g. invocation.put("k", "v")).
2. Clone it using new RpcInvocation(invocation).
3. Modify the original invocation's attributes (update or remove the key).
4. Observe that the cloned invocation's attributes are also affected.
### What you expected to happen
The cloned RpcInvocation should have its own independent attributes map, so changes to the original invocation do not affect the clone.
### Anything else
The copy constructor already deep-copies attachments, but attributes are passed by reference.
This causes unexpected side effects for filters or interceptors that clone and then mutate invocation attributes.
### Do you have a (mini) reproduction demo?
- [ ] Yes, I have a minimal reproduction demo to help resolve this issue more effectively!
### Are you willing to submit a pull request to fix on your own?
- [x] Yes I am willing to submit a pull request on my own!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
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: notifications-unsubscribe@dubbo.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] [Bug] RpcInvocation copy constructor shares attributes map with source invocation [dubbo]
Posted by "zrlw (via GitHub)" <gi...@apache.org>.
zrlw commented on issue #16069:
URL: https://github.com/apache/dubbo/issues/16069#issuecomment-3845732806
As for me, RpcInvocation's copy constructor shares the same attributes map with the source invocation by design.
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] [Bug] RpcInvocation copy constructor shares attributes map with source invocation [dubbo]
Posted by "zrlw (via GitHub)" <gi...@apache.org>.
zrlw closed issue #16069: [Bug] RpcInvocation copy constructor shares attributes map with source invocation
URL: https://github.com/apache/dubbo/issues/16069
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org