[JBoss JIRA] (WFCORE-4621) Create a service to install a dynamic 'wildflyee.api' module
by Yeray Borges Santana (Jira)
[ https://issues.redhat.com/browse/WFCORE-4621?page=com.atlassian.jira.plug... ]
Yeray Borges Santana commented on WFCORE-4621:
----------------------------------------------
Hi [~brian.stansberry],
My understanding is a static JBoss Modules module, instead of a dynamic one, with all its dependencies as optional, could work fine even if we are provisioning with {{passive+}} strategy. Galleon creates packages for the JBoss Modules to provision using the module.xml file, and when the dependencies are optional, the package created does not include them. That means a server with any kind of provisioning strategy won't provision the optional dependencies if they are not already included by any other package that could require them.
Do you agree or am I missing something?
If the above is correct, the approach could be then to create a static module.xml for a new module named {{wildflyee.api}}. This new module will have all its dependencies declared as {{optional}}. Replace the uses of the {{javaee.api}} module dependency in {{ExternalModuleSpecService}} by {{wildflyee.api}}. Make {{javaee.api}} in WildFly full become an alias of {{wildflyee.api}}. I understand we could have Jakarta EE APIs that could depend on other Jakarta EE APIs, but I understand it is assumable by the user using a slimmed server that does not contain all the Jakarta EE dependencies. Do you see any downside with this approach?
> Create a service to install a dynamic 'wildflyee.api' module
> ------------------------------------------------------------
>
> Key: WFCORE-4621
> URL: https://issues.redhat.com/browse/WFCORE-4621
> Project: WildFly Core
> Issue Type: Enhancement
> Components: Server
> Reporter: Brian Stansberry
> Assignee: Yeray Borges Santana
> Priority: Minor
>
> Follow up on WFCORE-4612 by removing the list of detailed optional dependencies added there and instead have a service that installs a dynamic 'wildflyee.api' module that optional depends on all those. Then ExternalModuleDependencySpecService would add a dependency on that 'wildflyee.api' module.
> Then the next step is the javaee.api module in full WildFly would become an alias to wildflyee.api.
> The benefit to this is the content set for this 'ee.api' convenience module
> a) gets set in one place (vs the two places that WFCORE-4612 introduces)
> b) is defined in core, which makes some sense as core utilizes the module for the ExternalModuleDependencySpecService use case.
> c) External uses of 'javaee.api' can benefit from the WFCORE-4612 improvement; i.e. if they have slimmed the server such that some APIs are not present, javaee.api can still be used. They just can't be using any APIs that they slimmed away.
> A downside is maintaining an 'ee.api' modules is not a great fit for core.
> The reason to use a dynamic module is a static module would be visible to Galleon, and with the standard passive+[1] provisioning scheme we use that would lead to Galleon provisioning the packages for all the EE APIs, regardless of whether the server config required them.
> [1] https://docs.wildfly.org/galleon/#_effective_package_set
> This is somewhat me brainstorming, so needs harder thought.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 2 months
[JBoss JIRA] (DROOLS-2729) KieScanner tries to read test dependencies
by Mario Fusco (Jira)
[ https://issues.redhat.com/browse/DROOLS-2729?page=com.atlassian.jira.plug... ]
Mario Fusco updated DROOLS-2729:
--------------------------------
Sprint: 2020 Week 10-12 (from Mar 2)
> KieScanner tries to read test dependencies
> ------------------------------------------
>
> Key: DROOLS-2729
> URL: https://issues.redhat.com/browse/DROOLS-2729
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.8.0.Final
> Reporter: Ales Dolecek
> Assignee: Mario Fusco
> Priority: Major
>
> Method KieRepositoryScannerImpl#indexArtifacts first reads ALL dependencies and then tries to exclude those with scope test/provided/system. This is wrong since the nested dependencies might have different scope. Conseder this case:
> A -> depends on B (with scope test)
> B -> depends on C (with scope compile)
> Asking for allDependencies will yield following descriptors:
> A (compile scope)
> B (test scope)
> C (compile scope)
> B gets discarded, but C remains and scanner will try to resolve it and add to class loader.
> Instead of fitering the results of ArtifactResolver#getAllDependencies() (without parameters) you should use overloaded version of this method that accepts dependency filter.
> I do not create rules via GUI, but have them in separate Maven project. This projects contains tests cases that check if the rules are OK. The tests create the knowlege base from filesystem and require drools-decisiontables in order to execute.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 2 months
[JBoss JIRA] (WFWIP-309) MP Fault Tolerance - WELD-001303: No active contexts for scope type javax.enterprise.context.ApplicationScoped
by Radoslav Husar (Jira)
[ https://issues.redhat.com/browse/WFWIP-309?page=com.atlassian.jira.plugin... ]
Radoslav Husar updated WFWIP-309:
---------------------------------
Description:
There is unexpected error log in following test scenario:
- Deploy MP FT service with:
{noformat}
@Asynchronous
@Bulkhead(value = 15, waitingTaskQueue = 15)
@Timeout(value = 1000)
@Fallback(fallbackMethod = "processFallback")
public CompletionStage<MyConnection> bulkheadTimeout(boolean fail) throws InterruptedException {
if (fail) {
Thread.sleep(2000);
}
return CompletableFuture.completedFuture(new MyConnection() {
@Override
public String getData() {
return "Hello from @Bulkhead @Timeout method";
}
});
}
private CompletionStage<MyConnection> processFallback(boolean fail) {
return CompletableFuture.completedFuture(new MyConnection() {
@Override
public String getData() {
return "Fallback Hello";
}
});
}
{noformat}
- Send 10+ parallel requests with fail == true
Expected result:
All requests should go to fallback.
Actual Result:
This test is currently hitting issue WFWIP-308 however additionally there is error in server log:
{noformat}
10:49:45,752 ERROR [stderr] (pool-22-thread-5) Exception in thread "pool-22-thread-5" Exception in thread "pool-22-thread-1" org.jboss.weld.contexts.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.enterprise.context.ApplicationScoped
10:49:45,752 ERROR [stderr] (pool-22-thread-5) at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:647)
10:49:45,753 ERROR [stderr] (pool-22-thread-5) at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:89)
10:49:45,753 ERROR [stderr] (pool-22-thread-5) at org.jboss.weld.bean.ContextualInstanceStrategy$ApplicationScopedContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:123)
10:49:45,753 ERROR [stderr] (pool-22-thread-5) at org.jboss.weld.bean.ContextualInstance.getIfExists(ContextualInstance.java:63)
10:49:45,753 ERROR [stderr] (pool-22-thread-5) at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:87)
10:49:45,753 ERROR [stderr] (pool-22-thread-5) at org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:131)
10:49:45,753 ERROR [stderr] (pool-22-thread-5) at org.eclipse.microprofile.metrics.MetricRegistry$Proxy$_$$_WeldClientProxy.getHistograms(Unknown Source)
10:49:45,754 ERROR [stderr] (pool-22-thread-5) at io.smallrye.faulttolerance.metrics.MetricsCollectorFactory$MetricsCollectorImpl.histogramOf(MetricsCollectorFactory.java:105)
10:49:45,754 ERROR [stderr] (pool-22-thread-5) at io.smallrye.faulttolerance.metrics.MetricsCollectorFactory$MetricsCollectorImpl.histogramUpdate(MetricsCollectorFactory.java:86)
10:49:45,754 ERROR [stderr] (pool-22-thread-5) at io.smallrye.faulttolerance.metrics.MetricsCollectorFactory$MetricsCollectorImpl.bulkheadQueueLeft(MetricsCollectorFactory.java:125)
10:49:45,754 ERROR [stderr] (pool-22-thread-5) at io.smallrye.faulttolerance.core.bulkhead.CompletionStageBulkhead$CompletionStageBulkheadTask.run(CompletionStageBulkhead.java:78)
10:49:45,754 ERROR [stderr] (pool-22-thread-5) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
10:49:45,754 ERROR [stderr] (pool-22-thread-5) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
10:49:45,754 ERROR [stderr] (pool-22-thread-5) at java.lang.Thread.run(Thread.java:748)
10:49:45,755 ERROR [stderr] (pool-22-thread-1) org.jboss.weld.contexts.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.enterprise.context.ApplicationScoped
10:49:45,755 ERROR [stderr] (pool-22-thread-1) at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:647)
10:49:45,755 ERROR [stderr] (pool-22-thread-1) at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:89)
10:49:45,755 ERROR [stderr] (pool-22-thread-1) at org.jboss.weld.bean.ContextualInstanceStrategy$ApplicationScopedContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:123)
10:49:45,755 ERROR [stderr] (pool-22-thread-1) at org.jboss.weld.bean.ContextualInstance.getIfExists(ContextualInstance.java:63)
10:49:45,755 ERROR [stderr] (pool-22-thread-1) at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:87)
10:49:45,756 ERROR [stderr] (pool-22-thread-1) at org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:131)
10:49:45,756 ERROR [stderr] (pool-22-thread-1) at org.eclipse.microprofile.metrics.MetricRegistry$Proxy$_$$_WeldClientProxy.getHistograms(Unknown Source)
10:49:45,756 ERROR [stderr] (pool-22-thread-1) at io.smallrye.faulttolerance.metrics.MetricsCollectorFactory$MetricsCollectorImpl.histogramOf(MetricsCollectorFactory.java:105)
10:49:45,756 ERROR [stderr] (pool-22-thread-1) at io.smallrye.faulttolerance.metrics.MetricsCollectorFactory$MetricsCollectorImpl.histogramUpdate(MetricsCollectorFactory.java:86)
10:49:45,756 ERROR [stderr] (pool-22-thread-1) at io.smallrye.faulttolerance.metrics.MetricsCollectorFactory$MetricsCollectorImpl.bulkheadQueueLeft(MetricsCollectorFactory.java:125)
10:49:45,756 ERROR [stderr] (pool-22-thread-1) at io.smallrye.faulttolerance.core.bulkhead.CompletionStageBulkhead$CompletionStageBulkheadTask.run(CompletionStageBulkhead.java:78)
10:49:45,757 ERROR [stderr] (pool-22-thread-1) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
10:49:45,757 ERROR [stderr] (pool-22-thread-1) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
10:49:45,757 ERROR [stderr] (pool-22-thread-1) at java.lang.Thread.run(Thread.java:748)
{noformat}
was:
There is unexpected error log in following test scenario:
- Deploy MP FT service with:
{noformat}
@Asynchronous
@Bulkhead(value = 15, waitingTaskQueue = 15)
@Timeout(value = 1000)
@Fallback(fallbackMethod = "processFallback")
public CompletionStage<MyConnection> bulkheadTimeout(boolean fail) throws InterruptedException {
if (fail) {
Thread.sleep(2000);
}
return CompletableFuture.completedFuture(new MyConnection() {
@Override
public String getData() {
return "Hello from @Bulkhead @Timeout method";
}
});
}
private CompletionStage<MyConnection> processFallback(boolean fail) {
return CompletableFuture.completedFuture(new MyConnection() {
@Override
public String getData() {
return "Fallback Hello";
}
});
}
{noformat}
- Send 10+ parallel requests with fail == true
Expected result:
All requests should go to fallback.
Actual Result:
This test is currently hitting issue WFWIP-308 however additionally there is error in server log:
{code}
16:55:41,374 ERROR [stderr] (pool-22-thread-2) Exception in thread "pool-22-thread-4" Exception in thread "pool-22-thread-2" org.jboss.weld.contexts.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.enterprise.context.ApplicationScoped
16:55:41,374 ERROR [stderr] (pool-22-thread-2) at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:647)
16:55:41,374 ERROR [stderr] (pool-22-thread-2) at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:89)
16:55:41,374 ERROR [stderr] (pool-22-thread-2) at org.jboss.weld.bean.ContextualInstanceStrategy$ApplicationScopedContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:123)
16:55:41,374 ERROR [stderr] (pool-22-thread-2) at org.jboss.weld.bean.ContextualInstance.getIfExists(ContextualInstance.java:63)
16:55:41,374 ERROR [stderr] (pool-22-thread-2) at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:87)
16:55:41,375 ERROR [stderr] (pool-22-thread-2) at org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:131)
16:55:41,375 ERROR [stderr] (pool-22-thread-2) at org.eclipse.microprofile.metrics.MetricRegistry$Proxy$_$$_WeldClientProxy.getHistograms(Unknown Source)
16:55:41,375 ERROR [stderr] (pool-22-thread-2) at io.smallrye.faulttolerance.metrics.MetricsCollectorFactory$MetricsCollectorImpl.histogramOf(MetricsCollectorFactory.java:105)
16:55:41,375 ERROR [stderr] (pool-22-thread-2) at io.smallrye.faulttolerance.metrics.MetricsCollectorFactory$MetricsCollectorImpl.histogramUpdate(MetricsCollectorFactory.java:86)
16:55:41,375 ERROR [stderr] (pool-22-thread-2) at io.smallrye.faulttolerance.metrics.MetricsCollectorFactory$MetricsCollectorImpl.bulkheadQueueLeft(MetricsCollectorFactory.java:125)
16:55:41,375 ERROR [stderr] (pool-22-thread-2) at io.smallrye.faulttolerance.core.bulkhead.CompletionStageBulkhead$CompletionStageBulkheadTask.run(CompletionStageBulkhead.java:78)
16:55:41,375 ERROR [stderr] (pool-22-thread-2) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
16:55:41,375 ERROR [stderr] (pool-22-thread-2) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
16:55:41,375 ERROR [stderr] (pool-22-thread-2) at java.lang.Thread.run(Thread.java:748)
{code}
> MP Fault Tolerance - WELD-001303: No active contexts for scope type javax.enterprise.context.ApplicationScoped
> --------------------------------------------------------------------------------------------------------------
>
> Key: WFWIP-309
> URL: https://issues.redhat.com/browse/WFWIP-309
> Project: WildFly WIP
> Issue Type: Bug
> Components: MP Fault Tolerance
> Reporter: Miroslav Novak
> Assignee: Radoslav Husar
> Priority: Blocker
>
> There is unexpected error log in following test scenario:
> - Deploy MP FT service with:
> {noformat}
> @Asynchronous
> @Bulkhead(value = 15, waitingTaskQueue = 15)
> @Timeout(value = 1000)
> @Fallback(fallbackMethod = "processFallback")
> public CompletionStage<MyConnection> bulkheadTimeout(boolean fail) throws InterruptedException {
> if (fail) {
> Thread.sleep(2000);
> }
> return CompletableFuture.completedFuture(new MyConnection() {
> @Override
> public String getData() {
> return "Hello from @Bulkhead @Timeout method";
> }
> });
> }
> private CompletionStage<MyConnection> processFallback(boolean fail) {
> return CompletableFuture.completedFuture(new MyConnection() {
> @Override
> public String getData() {
> return "Fallback Hello";
> }
> });
> }
> {noformat}
> - Send 10+ parallel requests with fail == true
> Expected result:
> All requests should go to fallback.
> Actual Result:
> This test is currently hitting issue WFWIP-308 however additionally there is error in server log:
> {noformat}
> 10:49:45,752 ERROR [stderr] (pool-22-thread-5) Exception in thread "pool-22-thread-5" Exception in thread "pool-22-thread-1" org.jboss.weld.contexts.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.enterprise.context.ApplicationScoped
> 10:49:45,752 ERROR [stderr] (pool-22-thread-5) at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:647)
> 10:49:45,753 ERROR [stderr] (pool-22-thread-5) at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:89)
> 10:49:45,753 ERROR [stderr] (pool-22-thread-5) at org.jboss.weld.bean.ContextualInstanceStrategy$ApplicationScopedContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:123)
> 10:49:45,753 ERROR [stderr] (pool-22-thread-5) at org.jboss.weld.bean.ContextualInstance.getIfExists(ContextualInstance.java:63)
> 10:49:45,753 ERROR [stderr] (pool-22-thread-5) at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:87)
> 10:49:45,753 ERROR [stderr] (pool-22-thread-5) at org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:131)
> 10:49:45,753 ERROR [stderr] (pool-22-thread-5) at org.eclipse.microprofile.metrics.MetricRegistry$Proxy$_$$_WeldClientProxy.getHistograms(Unknown Source)
> 10:49:45,754 ERROR [stderr] (pool-22-thread-5) at io.smallrye.faulttolerance.metrics.MetricsCollectorFactory$MetricsCollectorImpl.histogramOf(MetricsCollectorFactory.java:105)
> 10:49:45,754 ERROR [stderr] (pool-22-thread-5) at io.smallrye.faulttolerance.metrics.MetricsCollectorFactory$MetricsCollectorImpl.histogramUpdate(MetricsCollectorFactory.java:86)
> 10:49:45,754 ERROR [stderr] (pool-22-thread-5) at io.smallrye.faulttolerance.metrics.MetricsCollectorFactory$MetricsCollectorImpl.bulkheadQueueLeft(MetricsCollectorFactory.java:125)
> 10:49:45,754 ERROR [stderr] (pool-22-thread-5) at io.smallrye.faulttolerance.core.bulkhead.CompletionStageBulkhead$CompletionStageBulkheadTask.run(CompletionStageBulkhead.java:78)
> 10:49:45,754 ERROR [stderr] (pool-22-thread-5) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> 10:49:45,754 ERROR [stderr] (pool-22-thread-5) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> 10:49:45,754 ERROR [stderr] (pool-22-thread-5) at java.lang.Thread.run(Thread.java:748)
> 10:49:45,755 ERROR [stderr] (pool-22-thread-1) org.jboss.weld.contexts.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.enterprise.context.ApplicationScoped
> 10:49:45,755 ERROR [stderr] (pool-22-thread-1) at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:647)
> 10:49:45,755 ERROR [stderr] (pool-22-thread-1) at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:89)
> 10:49:45,755 ERROR [stderr] (pool-22-thread-1) at org.jboss.weld.bean.ContextualInstanceStrategy$ApplicationScopedContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:123)
> 10:49:45,755 ERROR [stderr] (pool-22-thread-1) at org.jboss.weld.bean.ContextualInstance.getIfExists(ContextualInstance.java:63)
> 10:49:45,755 ERROR [stderr] (pool-22-thread-1) at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:87)
> 10:49:45,756 ERROR [stderr] (pool-22-thread-1) at org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:131)
> 10:49:45,756 ERROR [stderr] (pool-22-thread-1) at org.eclipse.microprofile.metrics.MetricRegistry$Proxy$_$$_WeldClientProxy.getHistograms(Unknown Source)
> 10:49:45,756 ERROR [stderr] (pool-22-thread-1) at io.smallrye.faulttolerance.metrics.MetricsCollectorFactory$MetricsCollectorImpl.histogramOf(MetricsCollectorFactory.java:105)
> 10:49:45,756 ERROR [stderr] (pool-22-thread-1) at io.smallrye.faulttolerance.metrics.MetricsCollectorFactory$MetricsCollectorImpl.histogramUpdate(MetricsCollectorFactory.java:86)
> 10:49:45,756 ERROR [stderr] (pool-22-thread-1) at io.smallrye.faulttolerance.metrics.MetricsCollectorFactory$MetricsCollectorImpl.bulkheadQueueLeft(MetricsCollectorFactory.java:125)
> 10:49:45,756 ERROR [stderr] (pool-22-thread-1) at io.smallrye.faulttolerance.core.bulkhead.CompletionStageBulkhead$CompletionStageBulkheadTask.run(CompletionStageBulkhead.java:78)
> 10:49:45,757 ERROR [stderr] (pool-22-thread-1) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> 10:49:45,757 ERROR [stderr] (pool-22-thread-1) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> 10:49:45,757 ERROR [stderr] (pool-22-thread-1) at java.lang.Thread.run(Thread.java:748)
> {noformat}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 2 months
[JBoss JIRA] (DROOLS-5115) executable model fails with negation and BigDecimal
by Toshiya Kobayashi (Jira)
[ https://issues.redhat.com/browse/DROOLS-5115?page=com.atlassian.jira.plug... ]
Toshiya Kobayashi updated DROOLS-5115:
--------------------------------------
Story Points: 4
> executable model fails with negation and BigDecimal
> ---------------------------------------------------
>
> Key: DROOLS-5115
> URL: https://issues.redhat.com/browse/DROOLS-5115
> Project: Drools
> Issue Type: Bug
> Components: executable model
> Affects Versions: 7.33.0.Final
> Reporter: Toshiya Kobayashi
> Assignee: Toshiya Kobayashi
> Priority: Major
>
> When you have a rule like:
> {noformat}
> when
> $p : Person(!(money > 20))
> {noformat}
> , executable model fails with an error:
> {noformat}
> bad operand types for binary operator '>'
> first type: java.math.BigDecimal
> second type: int
> {noformat}
> This is because the generated code doesn't use EvaluationUtil.
> {code:java}
> org.drools.model.Rule rule = D.rule("R").build(D.pattern(var_$p).expr("CE47D630E9C0B4A2A149ED40CEC3E3B0",
> (org.drools.modelcompiler.domain.Person _this) -> !(_this.getMoney() > 20),
> D.reactOn("money")),
> {code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 2 months
[JBoss JIRA] (DROOLS-2278) Parallel rules compiling does not take into account JVM container security policy
by Mario Fusco (Jira)
[ https://issues.redhat.com/browse/DROOLS-2278?page=com.atlassian.jira.plug... ]
Mario Fusco updated DROOLS-2278:
--------------------------------
Sprint: 2020 Week 10-12 (from Mar 2)
> Parallel rules compiling does not take into account JVM container security policy
> ---------------------------------------------------------------------------------
>
> Key: DROOLS-2278
> URL: https://issues.redhat.com/browse/DROOLS-2278
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.5.0.Final
> Environment: Linux 2.6.32-696.13.2.el6.x86_64
> OpenJDK Runtime Environment (build 1.8.0_151-b12)
> OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
> Reporter: Dorin Opris
> Assignee: Mario Fusco
> Priority: Major
>
> We deployed Drools 7.5.0.Final libraries in a java container (commercial product) which specifies a security manager and a policy.
> When running the container with small Drools packages (i.e. number of rules is less than 10) processing goes very well. When it comes to more rules the following exception is issued:
> SEVERE Failed to instantiate <container_unit>; Caused by: org.jini.rio.core.JSBInstantiationException:
> java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "createClassLoader")
> at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
> at java.security.AccessController.checkPermission(AccessController.java:884)
> at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
> at java.lang.SecurityManager.checkCreateClassLoader(SecurityManager.java:611)
> at java.lang.ClassLoader.checkCreateClassLoader(ClassLoader.java:274)
> at java.lang.ClassLoader.<init>(ClassLoader.java:316)
> at org.drools.core.rule.JavaDialectRuntimeData$PackageClassLoader.<init>(JavaDialectRuntimeData.java:573)
> at org.drools.core.rule.JavaDialectRuntimeData.makeClassLoader(JavaDialectRuntimeData.java:555)
> at org.drools.core.rule.JavaDialectRuntimeData.onAdd(JavaDialectRuntimeData.java:238)
> at org.drools.compiler.rule.builder.dialect.java.JavaDialect.<init>(JavaDialect.java:189)
> at org.drools.compiler.rule.builder.dialect.java.JavaDialectConfiguration.newDialect(JavaDialectConfiguration.java:88)
> at org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl.buildDialectRegistry(KnowledgeBuilderConfigurationImpl.java:377)
> at org.drools.compiler.compiler.PackageRegistry.<init>(PackageRegistry.java:51)
> at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.createPackageRegistry(.java:1051)
> at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.lambda$getOrCreatePackageRegistry$0(KnowledgeBuilderImpl.java:1026)
> at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
> at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.getOrCreatePackageRegistry(KnowledgeBuilderImpl.java:1026)
> at org.drools.compiler.builder.impl.TypeDeclarationCache.createTypeDeclarationForBean(TypeDeclarationCache.java:262)
> at org.drools.compiler.builder.impl.TypeDeclarationCache.getAndRegisterTypeDeclaration(TypeDeclarationCache.java:90)
> at org.drools.compiler.builder.impl.TypeDeclarationBuilder.getAndRegisterTypeDeclaration(TypeDeclarationBuilder.java:69)
> at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.getAndRegisterTypeDeclaration(KnowledgeBuilderImpl.java:1781)
> at org.drools.compiler.rule.builder.PatternBuilder.processClassObjectType(PatternBuilder.java:306)
> at org.drools.compiler.rule.builder.PatternBuilder.build(PatternBuilder.java:181)
> at org.drools.compiler.rule.builder.PatternBuilder.build(PatternBuilder.java:151)
> at org.drools.compiler.rule.builder.PatternBuilder.build(PatternBuilder.java:133)
> at org.drools.compiler.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:66)
> at org.drools.compiler.rule.builder.RuleBuilder.build(RuleBuilder.java:105)
> at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.addRule(KnowledgeBuilderImpl.java:1202)
> at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.lambda$compileRulesLevel$3(KnowledgeBuilderImpl.java:1163)
> at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
> at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
> at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1380)
> at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
> at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291)
> at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
> at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
> at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
> at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
> at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
> It seems Drools 7.* version has introduced parallel compilation of rules using Java platform forkJoin threads that, according to its spec, are a bit security restrictive in the sense that container security policy or container class loader access control context is ignored.
> "If a SecurityManager is present and no factory is specified, then the default pool uses a factory supplying threads that have no Permissions enabled. The system class loader is used to load these classes." https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ForkJoinPo...
> Could Drools fix this serial-parallel asymmetric output of rules compilation logic? Or it's just a Java issue like https://bugs.java.com/view_bug.do?bug_id=8184335 ?
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 2 months