nanjiek opened a new issue, #795:
URL: https://github.com/apache/dubbo-go-pixiu/issues/795

   ### ⚠️ Verification
   
   - [x] I have searched the 
[issues](https://github.com/apache/dubbo-go-pixiu/issues) of this repository 
and believe that this is not a duplicate.
   - [x] I have searched the [release 
notes](https://github.com/apache/dubbo-go-pixiu/releases) of this repository 
and believe that this is not a duplicate.
   
   ### 🎯 Solution Description
   
   This proposal addresses the issue where 18 out of 30 filters violate the 
HttpFilterFactory interface contract by passing factory config pointers to 
filter instances. The solution proposes using shallow or deep copying for 
proper config isolation, depending on config complexity.  
   
   🔍 Filter Compliance Overview
   
   Category | Count | Percentage
   -- | -- | --
   ✅ Compliant | 7 | 23.3%
   ⚠️ Special Cases (Safe) | 5 | 16.7%
   ❌ Violates Contract | 18 | 60.0%
   Total | 30 | 100%
   
   
   ### 📋 Use Cases
   
   Dynamic Metric Mode Switch
   
   Scenario: Changing from pull to push mode during a traffic spike without 
restarting the service.
   
   Problem: Shared pointers lead to inconsistencies between requests.
   
   Solution: Copy the config per request to maintain consistent behavior during 
hot reloads.
   
   CORS Policy Emergency Update
   
   Scenario: Updating CORS policy to block malicious origins in case of a 
security incident.
   
   Problem: Hot reload can lead to race conditions and policy inconsistencies.
   
   Solution: Immutable config copies ensure security policies don't change 
during in-flight requests.
   
   ### ⚖️ Complexity & Risks
   
   Complexity & Risks
   
   Low Complexity (Shallow Copy for Simple Configs):
   Filters with simple value-type configurations can be fixed with minimal 
changes.
   Risk: Low — Easy to verify correctness.
   
   Medium Complexity (Deep Copy for Complex Configs):
   Filters with reference-type configurations require custom deep copy 
implementations.
   Risk: Medium — Needs comprehensive testing to handle nested structures.
   
   ### 🔗 External Dependencies
   
   _No response_
   
   ### 📘 Additional Context
   
   _No response_


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