This is an automated email from the ASF dual-hosted git repository.
mridulpathak pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new 5558cc53e2 Improved: ServiceGroupReader.readConfig() lacks cache-hit
guard, causing redundant XML re-parsing on every ServiceDispatcher construction
(OFBIZ-13515)
5558cc53e2 is described below
commit 5558cc53e2b40172b2b94d612a5f96bbd35a65e1
Author: Mridul Pathak <[email protected]>
AuthorDate: Tue Sep 1 19:36:26 2026 +0530
Improved: ServiceGroupReader.readConfig() lacks cache-hit guard, causing
redundant XML re-parsing on every ServiceDispatcher construction (OFBIZ-13515)
readConfig() had no cache-hit check, so it re-parsed every component's
service-group XML on each call. Its sibling getGroupModel() already guards with
an empty-cache check before calling it, but readConfig() itself didn't. It is
called unconditionally from ServiceDispatcher's constructor on every dispatcher
construction, so a full testIntegration run re-parsed this XML dozens of times
for no reason. Added the same empty-cache guard inside readConfig() itself;
GROUPS_CACHE is a plain C [...]
---
.../main/java/org/apache/ofbiz/service/group/ServiceGroupReader.java | 3 +++
1 file changed, 3 insertions(+)
diff --git
a/framework/service/src/main/java/org/apache/ofbiz/service/group/ServiceGroupReader.java
b/framework/service/src/main/java/org/apache/ofbiz/service/group/ServiceGroupReader.java
index 7c0eee26e0..cbd819c4aa 100644
---
a/framework/service/src/main/java/org/apache/ofbiz/service/group/ServiceGroupReader.java
+++
b/framework/service/src/main/java/org/apache/ofbiz/service/group/ServiceGroupReader.java
@@ -45,6 +45,9 @@ public final class ServiceGroupReader {
protected ServiceGroupReader() { }
public static void readConfig() {
+ if (!GROUPS_CACHE.isEmpty()) {
+ return;
+ }
List<ServiceGroups> serviceGroupsList = null;
try {
serviceGroupsList =
ServiceConfigUtil.getServiceEngine().getServiceGroups();