You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Based on the issue topic, the synchronous call of initStatesFromDataBase() causes a slow start on the demo.thingsboard.io cause we have ~100K tenants there.
Stacktrace:
tb-core1_1 | at org.thingsboard.server.dao.sql.tenant.JpaTenantDao.findTenantsByRegion(JpaTenantDao.java:63)
tb-core1_1 | at org.thingsboard.server.dao.sql.tenant.JpaTenantDao$$FastClassBySpringCGLIB$$bb4581c1.invoke()
tb-core1_1 | at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
tb-core1_1 | at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
tb-core1_1 | at org.thingsboard.server.dao.sql.tenant.JpaTenantDao$$EnhancerBySpringCGLIB$$217df218.findTenantsByRegion()
tb-core1_1 | at org.thingsboard.server.dao.tenant.TenantServiceImpl.findTenants(TenantServiceImpl.java:171)
tb-core1_1 | at org.thingsboard.server.service.apiusage.DefaultTbApiUsageStateService$$Lambda$1721/0x000000084103a040.fetch(Unknown Source)
tb-core1_1 | at org.thingsboard.server.common.data.page.PageDataIterable.fetchPageData(PageDataIterable.java:29)
tb-core1_1 | at org.thingsboard.server.common.data.page.BasePageDataIterable.fetch(BasePageDataIterable.java:65)
tb-core1_1 | at org.thingsboard.server.common.data.page.BasePageDataIterable.hasNext(BasePageDataIterable.java:50)
tb-core1_1 | at org.thingsboard.server.service.apiusage.DefaultTbApiUsageStateService.initStatesFromDataBase(DefaultTbApiUsageStateService.java:494)
tb-core1_1 | at org.thingsboard.server.service.apiusage.DefaultTbApiUsageStateService.onTbApplicationEvent(DefaultTbApiUsageStateService.java:228)
tb-core1_1 | at org.thingsboard.server.service.apiusage.DefaultTbApiUsageStateService.onTbApplicationEvent(DefaultTbApiUsageStateService.java:88)
tb-core1_1 | at org.thingsboard.server.queue.discovery.TbApplicationEventListener.onApplicationEvent(TbApplicationEventListener.java:44)
tb-core1_1 | at org.thingsboard.server.queue.discovery.TbApplicationEventListener.onApplicationEvent(TbApplicationEventListener.java:25)
tb-core1_1 | at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
tb-core1_1 | at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
tb-core1_1 | at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
tb-core1_1 | at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:404)
tb-core1_1 | at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:361)
tb-core1_1 | at org.thingsboard.server.queue.discovery.HashPartitionService.lambda$recalculatePartitions$7(HashPartitionService.java:174)
tb-core1_1 | at org.thingsboard.server.queue.discovery.HashPartitionService$$Lambda$1717/0x000000084103b040.accept(Unknown Source)
tb-core1_1 | at java.util.concurrent.ConcurrentHashMap.forEach(java.base@11.0.12/ConcurrentHashMap.java:1603)
tb-core1_1 | at org.thingsboard.server.queue.discovery.HashPartitionService.recalculatePartitions(HashPartitionService.java:168)
tb-core1_1 | - locked <0x0000000083d4d568> (a org.thingsboard.server.queue.discovery.HashPartitionService)
tb-core1_1 | at org.thingsboard.server.queue.discovery.ZkDiscoveryService.recalculatePartitions(ZkDiscoveryService.java:301)
tb-core1_1 | - locked <0x00000000853888f0> (a org.thingsboard.server.queue.discovery.ZkDiscoveryService)
tb-core1_1 | at org.thingsboard.server.queue.discovery.ZkDiscoveryService.childEvent(ZkDiscoveryService.java:289)
The text was updated successfully, but these errors were encountered:
Describe the bug
Based on the issue topic, the synchronous call of initStatesFromDataBase() causes a slow start on the demo.thingsboard.io cause we have ~100K tenants there.
Stacktrace:
tb-core1_1 | at org.thingsboard.server.dao.sql.tenant.JpaTenantDao.findTenantsByRegion(JpaTenantDao.java:63)
tb-core1_1 | at org.thingsboard.server.dao.sql.tenant.JpaTenantDao$$FastClassBySpringCGLIB$$bb4581c1.invoke()
tb-core1_1 | at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
tb-core1_1 | at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
tb-core1_1 | at org.thingsboard.server.dao.sql.tenant.JpaTenantDao$$EnhancerBySpringCGLIB$$217df218.findTenantsByRegion()
tb-core1_1 | at org.thingsboard.server.dao.tenant.TenantServiceImpl.findTenants(TenantServiceImpl.java:171)
tb-core1_1 | at org.thingsboard.server.service.apiusage.DefaultTbApiUsageStateService$$Lambda$1721/0x000000084103a040.fetch(Unknown Source)
tb-core1_1 | at org.thingsboard.server.common.data.page.PageDataIterable.fetchPageData(PageDataIterable.java:29)
tb-core1_1 | at org.thingsboard.server.common.data.page.BasePageDataIterable.fetch(BasePageDataIterable.java:65)
tb-core1_1 | at org.thingsboard.server.common.data.page.BasePageDataIterable.hasNext(BasePageDataIterable.java:50)
tb-core1_1 | at org.thingsboard.server.service.apiusage.DefaultTbApiUsageStateService.initStatesFromDataBase(DefaultTbApiUsageStateService.java:494)
tb-core1_1 | at org.thingsboard.server.service.apiusage.DefaultTbApiUsageStateService.onTbApplicationEvent(DefaultTbApiUsageStateService.java:228)
tb-core1_1 | at org.thingsboard.server.service.apiusage.DefaultTbApiUsageStateService.onTbApplicationEvent(DefaultTbApiUsageStateService.java:88)
tb-core1_1 | at org.thingsboard.server.queue.discovery.TbApplicationEventListener.onApplicationEvent(TbApplicationEventListener.java:44)
tb-core1_1 | at org.thingsboard.server.queue.discovery.TbApplicationEventListener.onApplicationEvent(TbApplicationEventListener.java:25)
tb-core1_1 | at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
tb-core1_1 | at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
tb-core1_1 | at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
tb-core1_1 | at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:404)
tb-core1_1 | at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:361)
tb-core1_1 | at org.thingsboard.server.queue.discovery.HashPartitionService.lambda$recalculatePartitions$7(HashPartitionService.java:174)
tb-core1_1 | at org.thingsboard.server.queue.discovery.HashPartitionService$$Lambda$1717/0x000000084103b040.accept(Unknown Source)
tb-core1_1 | at java.util.concurrent.ConcurrentHashMap.forEach(java.base@11.0.12/ConcurrentHashMap.java:1603)
tb-core1_1 | at org.thingsboard.server.queue.discovery.HashPartitionService.recalculatePartitions(HashPartitionService.java:168)
tb-core1_1 | - locked <0x0000000083d4d568> (a org.thingsboard.server.queue.discovery.HashPartitionService)
tb-core1_1 | at org.thingsboard.server.queue.discovery.ZkDiscoveryService.recalculatePartitions(ZkDiscoveryService.java:301)
tb-core1_1 | - locked <0x00000000853888f0> (a org.thingsboard.server.queue.discovery.ZkDiscoveryService)
tb-core1_1 | at org.thingsboard.server.queue.discovery.ZkDiscoveryService.childEvent(ZkDiscoveryService.java:289)
The text was updated successfully, but these errors were encountered: