You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "iamhucong (via GitHub)" <gi...@apache.org> on 2026/07/02 07:46:01 UTC
[I] OrderedSPILoader may retain transient multi-object lookup keys [shardingsphere]
iamhucong opened a new issue, #38981:
URL: https://github.com/apache/shardingsphere/issues/38981
## Bug Report
`OrderedSPILoader` keeps a singleton-registry cache for multi-object lookups. The cache key is the input `Collection<?>` itself.
When callers repeatedly pass newly created object collections, such as transient `RuleConfiguration` or `YamlRuleConfiguration` collections, semantically equivalent inputs may become different cache keys. Since the cache is held by the singleton SPI registry, these keys can retain the whole configuration object graph for the lifetime of the process.
This can cause continuous heap growth under workloads that repeatedly rebuild and convert rule configuration collections.
## Expected behavior
`OrderedSPILoader` should not retain transient object collections as long-lived cache keys.
For multi-object lookups, it should reuse stable class-based lookup results where possible and build the current object-keyed result without storing the transient input collection globally.
## Actual behavior
For singleton ordered SPI services, multi-object `getServices(...)` lookups are cached by the original input collection.
If the input contains newly allocated rule configuration objects, each call may add another long-lived cache entry, even if the logical rule types are the same.
## Impact
This may lead to unnecessary heap retention, frequent GC, and eventually OOM in metadata or management workloads that repeatedly load and convert database rule configurations.
## Related pull request
A proposed fix is available in:
- https://github.com/apache/shardingsphere/pull/38980
--
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@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] OrderedSPILoader may retain transient multi-object lookup keys [shardingsphere]
Posted by "hiSandog (via GitHub)" <gi...@apache.org>.
hiSandog commented on issue #38981:
URL: https://github.com/apache/shardingsphere/issues/38981#issuecomment-4921256889
This is specific enough for a focused regression test around OrderedSPILoader may retain transient multi-object lookup keys. The test should set up the failing path, assert the intended behavior, and include the current error or bad output so the fix is not only verified manually. `OrderedSPILoader` is a useful concrete anchor because it is named directly in the report.
--
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@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org