[JBoss JIRA] (DROOLS-458) Drools lock in StatelessKnowledgeSessionImpl.
by Desmond Silveira (JIRA)
Desmond Silveira created DROOLS-458:
---------------------------------------
Summary: Drools lock in StatelessKnowledgeSessionImpl.
Key: DROOLS-458
URL: https://issues.jboss.org/browse/DROOLS-458
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 6.0.1.Final
Environment: Tomcat 7
Reporter: Desmond Silveira
Assignee: Mark Proctor
My Tomcat HTTP BIO connector threads (129 of them) got BLOCKED in my production Tomcat 7 instance because Drool 6.0.1 wasn't releasing a lock.
Here is a snippet of the thread dump:
{noformat}
"http-bio-172.16.216.19-80-exec-37513" - Thread t@6245360
java.lang.Thread.State: BLOCKED
at org.drools.core.runtime.process.ProcessRuntimeFactory.getProcessRuntimeFactoryService(ProcessRuntimeFactory.java:20)
- waiting to lock <219dcd77> (a java.lang.Class) owned by "http-bio-172.16.216.19-80-exec-37511" t@6245358
at org.drools.core.runtime.process.ProcessRuntimeFactory.newProcessRuntime(ProcessRuntimeFactory.java:12)
at org.drools.core.common.AbstractWorkingMemory.createProcessRuntime(AbstractWorkingMemory.java:405)
at org.drools.core.common.AbstractWorkingMemory.setKnowledgeRuntime(AbstractWorkingMemory.java:1770)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.<init>(StatefulKnowledgeSessionImpl.java:125)
at org.drools.core.impl.StatelessKnowledgeSessionImpl.newWorkingMemory(StatelessKnowledgeSessionImpl.java:139)
at org.drools.core.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:397)
at com.local.lds.RuleEngineBean.applyKnowledge(RuleEngineBean.java:50)
at com.local.lds.LdsBean.search(LdsBean.java:200)
at com.local.lds.servlet.SearchServlet.doGet(SearchServlet.java:55)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
- locked <3575a054> (a org.apache.tomcat.util.net.SocketWrapper)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- locked <719df963> (a java.util.concurrent.ThreadPoolExecutor$Worker)
"http-bio-172.16.216.19-80-exec-37511" - Thread t@6245358
java.lang.Thread.State: RUNNABLE
at org.kie.internal.utils.ServiceRegistryImpl.addDefault(ServiceRegistryImpl.java:212)
- locked <3d710637> (a org.kie.internal.utils.ServiceRegistryImpl)
at org.kie.internal.utils.ServiceRegistryImpl.addDefault(ServiceRegistryImpl.java:207)
- locked <3d710637> (a org.kie.internal.utils.ServiceRegistryImpl)
at org.drools.core.runtime.process.ProcessRuntimeFactory.loadProvider(ProcessRuntimeFactory.java:27)
at org.drools.core.runtime.process.ProcessRuntimeFactory.getProcessRuntimeFactoryService(ProcessRuntimeFactory.java:21)
- locked <219dcd77> (a java.lang.Class)
at org.drools.core.runtime.process.ProcessRuntimeFactory.newProcessRuntime(ProcessRuntimeFactory.java:12)
at org.drools.core.common.AbstractWorkingMemory.createProcessRuntime(AbstractWorkingMemory.java:405)
at org.drools.core.common.AbstractWorkingMemory.setKnowledgeRuntime(AbstractWorkingMemory.java:1770)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.<init>(StatefulKnowledgeSessionImpl.java:125)
at org.drools.core.impl.StatelessKnowledgeSessionImpl.newWorkingMemory(StatelessKnowledgeSessionImpl.java:139)
at org.drools.core.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:397)
at com.local.lds.RuleEngineBean.applyKnowledge(RuleEngineBean.java:50)
at com.local.lds.LdsBean.search(LdsBean.java:200)
at com.local.lds.servlet.SearchServlet.doGet(SearchServlet.java:55)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
- locked <474f2464> (a org.apache.tomcat.util.net.SocketWrapper)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- locked <339f344e> (a java.util.concurrent.ThreadPoolExecutor$Worker)
"http-bio-172.16.216.19-80-exec-37447" - Thread t@6233953
java.lang.Thread.State: BLOCKED
at org.drools.core.common.ProjectClassLoader.loadClass(ProjectClassLoader.java:82)
- waiting to lock <555896b3> (a org.drools.core.common.ProjectClassLoader) owned by "http-bio-172.16.216.19-80-exec-37519" t@6245366
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.drools.core.base.ClassFieldAccessorCache.getClass(ClassFieldAccessorCache.java:122)
at org.drools.core.base.ClassFieldAccessorCache.getClassObjectType(ClassFieldAccessorCache.java:46)
at org.drools.core.reteoo.ClassObjectTypeConf.<init>(ClassObjectTypeConf.java:89)
at org.drools.core.common.ObjectTypeConfigurationRegistry.getObjectTypeConf(ObjectTypeConfigurationRegistry.java:71)
at org.drools.core.common.AbstractWorkingMemory.initInitialFact(AbstractWorkingMemory.java:385)
at org.drools.core.common.AbstractWorkingMemory.<init>(AbstractWorkingMemory.java:378)
at org.drools.core.common.AbstractWorkingMemory.<init>(AbstractWorkingMemory.java:261)
at org.drools.core.common.PhreakWorkingMemoryFactory.createWorkingMemory(PhreakWorkingMemoryFactory.java:15)
at org.drools.core.impl.StatelessKnowledgeSessionImpl.newWorkingMemory(StatelessKnowledgeSessionImpl.java:134)
at org.drools.core.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:397)
at com.local.lds.RuleEngineBean.applyKnowledge(RuleEngineBean.java:50)
at com.local.lds.LdsBean.search(LdsBean.java:200)
at com.local.lds.servlet.SearchServlet.doGet(SearchServlet.java:55)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
- locked <57e6b780> (a org.apache.tomcat.util.net.SocketWrapper)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- locked <726294fc> (a java.util.concurrent.ThreadPoolExecutor$Worker)
"http-bio-172.16.216.19-80-exec-37519" - Thread t@6245366
java.lang.Thread.State: RUNNABLE
at java.lang.ClassLoader.findLoadedClass0(Native Method)
at java.lang.ClassLoader.findLoadedClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
- locked <555896b3> (a org.drools.core.common.ProjectClassLoader)
at org.drools.core.common.ProjectClassLoader.internalLoadClass(ProjectClassLoader.java:99)
at org.drools.core.common.ProjectClassLoader.loadClass(ProjectClassLoader.java:82)
- locked <555896b3> (a org.drools.core.common.ProjectClassLoader)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.drools.core.base.ClassFieldAccessorCache.getClass(ClassFieldAccessorCache.java:122)
at org.drools.core.base.ClassFieldAccessorCache.getClassObjectType(ClassFieldAccessorCache.java:46)
at org.drools.core.reteoo.ClassObjectTypeConf.<init>(ClassObjectTypeConf.java:89)
at org.drools.core.common.ObjectTypeConfigurationRegistry.getObjectTypeConf(ObjectTypeConfigurationRegistry.java:71)
at org.drools.core.common.NamedEntryPoint.insert(NamedEntryPoint.java:164)
at org.drools.core.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1148)
at org.drools.core.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1092)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:308)
at org.drools.core.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:400)
at com.local.lds.RuleEngineBean.applyKnowledge(RuleEngineBean.java:50)
at com.local.lds.LdsBean.search(LdsBean.java:200)
at com.local.lds.servlet.SearchServlet.doGet(SearchServlet.java:55)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
- locked <43c2901> (a org.apache.tomcat.util.net.SocketWrapper)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- locked <88f8fa9> (a java.util.concurrent.ThreadPoolExecutor$Worker)
{noformat}
Here is the code that I use to call Drools:
{code:java}
public static Collection<ResultSet> applyRule(String rule,
KieBase kb, Collection<ResultSet> resultSets, SearchParameters params) {
try {
if (kb == null) {
return resultSets;
}
StatelessKieSession ksession = kb.newStatelessKieSession();
ksession.setGlobal(OUTPUT, new ArrayList<>());
Collection<Object> collection = new ArrayList<Object>(resultSets);
collection.add(params);
ksession.execute(collection);
return (Collection<ResultSet>) ksession.getGlobals().get(OUTPUT);
} catch (ConsequenceException e) {
LOG.error("Error in rule: " + rule + " " + e.getRule(), e);
throw e;
} catch (RuntimeException e) {
LOG.error("Error in rule: " + rule, e);
throw e;
}
}
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 9 months
[JBoss JIRA] (WFLY-939) Class-Path manifest entries for WARs-in-EAR not handled properly
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/WFLY-939?page=com.atlassian.jira.plugin.s... ]
RH Bugzilla Integration commented on WFLY-939:
----------------------------------------------
James Livingston <jlivings(a)redhat.com> changed the Status of [bug 955818|https://bugzilla.redhat.com/show_bug.cgi?id=955818] from NEW to POST
> Class-Path manifest entries for WARs-in-EAR not handled properly
> ----------------------------------------------------------------
>
> Key: WFLY-939
> URL: https://issues.jboss.org/browse/WFLY-939
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Server
> Reporter: James Livingston
> Assignee: Stuart Douglas
> Fix For: 8.0.0.Alpha1
>
>
> ManifestClassPathProcessor handles the processing of Class-Path entries in deployments. The handling of those entries in sub-deployments is broken.
> https://github.com/doctau/examples/tree/master/war-manifest-classpath builds an EAR containing a utility JAR and two WARs, where both WARs refer to the jar via Class-Path manifest headers. The jar is not in the EAR's library directory nor in application.xml
> The resulting module setup will result in the jar being added to the first WAR's module, and the remaining WAR(s) depending on a separate "jar classloader". All WARs should depend on the single shared jar classloader.
> When ManifestClassPathProcessor.handlingExistingClassPathEntry() runs for the first war, it will call createAdditionalModule(), which calls createResourceRoot(). The "deploymentUnit.addToAttachmentList(Attachments.RESOURCE_ROOTS, resourceRoot)" adds it to the resource roots for that WAR.
> When handlingExistingClassPathEntry() runs for the second (and subsequent) WAR, it will already be in the additionalModules list, so "target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, moduleSpecification.getModuleIdentifier())" gets run.
> I believe the step of adding it to the CLASS_PATH_ENTRIES attachment needs to happen on the first WAR (so it is added as a module dependency), and it should not be added to the DU RESOURCE_ROOTS so it is not in the WAR's own classloader.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 9 months
[JBoss JIRA] (WFLY-1013) Can't set attribute "suffix" on web access-log
by James Livingston (JIRA)
[ https://issues.jboss.org/browse/WFLY-1013?page=com.atlassian.jira.plugin.... ]
James Livingston commented on WFLY-1013:
----------------------------------------
This is done for 8.0.1
> Can't set attribute "suffix" on web access-log
> ----------------------------------------------
>
> Key: WFLY-1013
> URL: https://issues.jboss.org/browse/WFLY-1013
> Project: WildFly
> Issue Type: Enhancement
> Security Level: Public(Everyone can see)
> Components: Web (Undertow)
> Environment: N/A
> Reporter: Ed Roberts
> Assignee: James Livingston
> Labels: logging, suffix, web
> Fix For: 8.0.1.Final
>
>
> In JBoss 5.x you used to be able to specify a suffix attribute value for the JBossWeb access log file, which would be appended to generated log file names.
> In JBoss 7.x you can only specify a prefix. For the logging handlers you can specify both a prefix and a suffix, which is inconsistent.
> Please add the suffix attribute to the access-log element within the parent virtual-server element of the web subsystem xml configuration.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 9 months
[JBoss JIRA] (WFLY-1013) Can't set attribute "suffix" on web access-log
by James Livingston (JIRA)
[ https://issues.jboss.org/browse/WFLY-1013?page=com.atlassian.jira.plugin.... ]
James Livingston resolved WFLY-1013.
------------------------------------
Fix Version/s: 8.0.1.Final
Resolution: Done
> Can't set attribute "suffix" on web access-log
> ----------------------------------------------
>
> Key: WFLY-1013
> URL: https://issues.jboss.org/browse/WFLY-1013
> Project: WildFly
> Issue Type: Enhancement
> Security Level: Public(Everyone can see)
> Components: Web (Undertow)
> Environment: N/A
> Reporter: Ed Roberts
> Assignee: James Livingston
> Labels: logging, suffix, web
> Fix For: 8.0.1.Final
>
>
> In JBoss 5.x you used to be able to specify a suffix attribute value for the JBossWeb access log file, which would be appended to generated log file names.
> In JBoss 7.x you can only specify a prefix. For the logging handlers you can specify both a prefix and a suffix, which is inconsistent.
> Please add the suffix attribute to the access-log element within the parent virtual-server element of the web subsystem xml configuration.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 9 months