dubbo-go-bot opened a new pull request, #815:
URL: https://github.com/apache/dubbo-go-pixiu/pull/815

   ## 🔄 Upstream Sync from Community Fork
   
   This PR automatically syncs changes from the community fork to the upstream 
repository.
   
   ### Original Contribution
   
   - **Author**: @Aetherance
   - **Original PR**: https://github.com/dubbo-go-pixiu/dubbo-go-pixiu/pull/35
   - **Merged at**: 2025-11-23 03:54:18 UTC
   
   ### Original PR Description
   
   ---
   
   <!--  Thanks for sending a pull request! 
   -->
   
   **What this PR does**:
   
   Fixes shallow copy issue in several filters where factory.cfg pointers were 
directly passed to Filter instances. 
   Now each Filter receives an independent copy of its factory config, ensuring 
safety during hot reload.
   
   **Which issue(s) this PR fixes**:
   <!--
   *Automatically closes linked issue when PR is merged.
   Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
   _If PR is about `failing-tests or flakes`, please post the related 
issues/tests in a comment and do not use `Fixes`_*
   -->
   Fixes #795
   
   **Special notes for your reviewer**:
   
   - Only applies shallow copy to filters with simple value-type configs.
   - Does not affect filters requiring deep copy.
   - Includes added comments explaining the shallow copy usage and hot reload 
safety.
   
   **Does this PR introduce a user-facing change?**:
   <!--
   If no, just write "NONE" in the release-note block below.
   If yes, a release note is required:
   Enter your extended release note in the block below. If the PR requires 
additional action from users switching to the new release, include the string 
"action required".
   -->
   NONE
   ```release-note
   Shallow copy applied to selected filters to avoid pointer sharing of factory 
configuration during hot reload.
   ```
   
   ## Summary by Sourcery
   
   Create an independent shallow copy of factory.cfg in PrepareFilterChain of 
selected filters (event, header, host, loadbalancer, tokenizer, and OPA) to 
prevent shared pointers and fix hot reload issues
   
   Bug Fixes:
   - Avoid pointer sharing of factory configuration by creating a shallow copy 
for each filter instance to ensure hot reload safety
   
   Documentation:
   - Add comments in filter code explaining the shallow copy usage for hot 
reload safety
   
   <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
   ## Summary by CodeRabbit
   
   * **Refactor**
     * Filters now receive isolated copies of their configuration instead of 
sharing a factory-held configuration, reducing risk of cross-component mutation 
and improving stability and predictability.
     * No public APIs or exported type signatures were changed.
   
   <sub>✏️ Tip: You can customize this high-level summary in your review 
settings.</sub>
   <!-- end of auto-generated comment: release notes by coderabbit.ai -->
   
   ---
   
   All commits preserve original authorship.
   
   **Note**: Auto-created when PR #35 was merged into 
`dubbo-go-pixiu/dubbo-go-pixiu:develop`.
   
   cc @Aetherance
   


-- 
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