wsyjh8 commented on issue #16268:
URL: https://github.com/apache/dubbo/issues/16268#issuecomment-4640766388

   The root cause is that 
`DubboDefaultPropertiesEnvironmentPostProcessor#addOrReplace` mutates the 
existing `defaultProperties` `MapPropertySource`'s backing map in place via 
`target.getSource().put(...)`. When that source was already registered with an 
immutable map (e.g. the Guava `ImmutableMap` in the stack trace), the `put` 
throws `UnsupportedOperationException`. Since the post-processor runs at 
`LOWEST_PRECEDENCE`, an earlier `EnvironmentPostProcessor` (Nacos / Spring 
Cloud bootstrap) can register such an immutable `defaultProperties` before 
Dubbo runs.
   
   The fix copies the existing entries into a new mutable map and replaces the 
property source instead of mutating it in place, preserving the existing 
merge/precedence semantics, plus unit tests that reproduce the failure and 
verify the fix.
   
   I've opened a PR: https://github.com/apache/dubbo/pull/16313
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to