liaochengjie opened a new pull request, #7795:
URL: https://github.com/apache/shenyu/pull/7795

   Fixes #7714
   
   Concurrent first requests could each create a selector cache backend, with 
the later `put` overwriting an instance that would never be closed. Initialize 
each selector atomically with `computeIfAbsent` and publish its backend and 
upstream configuration together in one entry. Both requests reuse the same 
backend, without creating and closing competing instances.
   
   Detach entries before closing them. Bulk invalidation removes only entries 
matching its captured snapshot, so an older invalidation cannot discard a 
replacement or close the same backend twice.
   
   Validation:
   
   - Eight deterministic regression cases exercise the real request-side lazy 
initialization helper, concurrent initialization/invalidation, failed 
initialization retries, close failures, and selector isolation. Before the fix: 
8 run, 6 failures. After the fix: 8 passed.
   - Related cache suites: 98 tests executed, 0 failures/errors. The existing 
`RedisCacheTest` and `CachePluginDataHandlerTest` classes reported 0 executed 
tests on this Windows/JDK 23 environment; they are excluded from that count. 
The new concurrency tests use mock backends and require no Redis service.
   - Checkstyle: 0 violations across the selected module and its reactor 
dependencies.
   - Apache RAT on `shenyu-plugin-cache-handler`: 16 approved files, 0 
unapproved/unknown licenses.
   - `git diff --check` passed.
   
   The existing immediate-close behavior on configuration invalidation is 
retained. This change prevents duplicate creation and lost ownership; it does 
not introduce request reference counting or delayed shutdown.
   
   Make sure that:
   
   - [x] You have read the [contribution 
guidelines](https://shenyu.apache.org/community/contributor-guide/).
   - [x] You submit test cases (unit or integration tests) that back your 
changes.
   - [ ] Your local test passed `./mvnw clean install 
-Dmaven.javadoc.skip=true`.
   
   The repository-wide clean install has not been run. Validation was scoped to 
the cache modules and their build dependencies.
   


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

Reply via email to