[JBoss JIRA] (WFLY-6591) Memory leak of expired session in Infinispan cache with optimistic locking
by Gabriel Lavoie (JIRA)
[ https://issues.jboss.org/browse/WFLY-6591?page=com.atlassian.jira.plugin.... ]
Gabriel Lavoie updated WFLY-6591:
---------------------------------
Description:
When using optimistic locking on the web cache, data from expired sessions is not removed from the web cache by the org.wildfly.clustering.web.infinispan.session.SessionExpirationScheduler and leaks forever.
Session seems to be invalidated correctly and isn't accessible anymore.
After tracing the code, org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.remove() doesn't remove the metadata entries when "this.properties.isLockOnWrite()" returns false (which is always the case for optimistic locking). Then in org.wildfly.clustering.web.infinispan.session.InfinispanSessionFactory.remove(), the call to attributesFactory.remove(id) also gets skipped.
We've tried to adjust the code of org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.remove() to the following:
{code}
private boolean remove(String id, Cache<SessionCreationMetaDataKey, SessionCreationMetaDataEntry<L>> creationMetaDataCache) {
SessionCreationMetaDataKey key = new SessionCreationMetaDataKey(id);
if (this.properties.isLockOnWrite()) {
if (creationMetaDataCache.getAdvancedCache().withFlags(Flag.ZERO_LOCK_ACQUISITION_TIMEOUT, Flag.FAIL_SILENTLY).lock(key)) {
creationMetaDataCache.getAdvancedCache().withFlags(Flag.IGNORE_RETURN_VALUES).remove(key);
this.accessMetaDataCache.getAdvancedCache().withFlags(Flag.IGNORE_RETURN_VALUES).remove(new SessionAccessMetaDataKey(id));
return true;
}
return false;
} else {
creationMetaDataCache.getAdvancedCache().withFlags(Flag.IGNORE_RETURN_VALUES).remove(key);
this.accessMetaDataCache.getAdvancedCache().withFlags(Flag.IGNORE_RETURN_VALUES).remove(new SessionAccessMetaDataKey(id));
return true;
}
}
{code}
With that change, the memory leaks disappears.
was:
When using optimistic locking on the web cache, data from expired sessions is not removed from the web cache by the org.wildfly.clustering.web.infinispan.session.SessionExpirationScheduler and leaks forever.
Session seems to be invalidated correctly and isn't accessible anymore.
After tracing the code, org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.remove() doesn't remove the metadata entries when "this.properties.isLockOnWrite()" returns false (which is always the case for optimistic locking). Then in org.wildfly.clustering.web.infinispan.session.InfinispanSessionFactory.remove(), the call to attributesFactory.remove(id) also gets skipped.
> Memory leak of expired session in Infinispan cache with optimistic locking
> --------------------------------------------------------------------------
>
> Key: WFLY-6591
> URL: https://issues.jboss.org/browse/WFLY-6591
> Project: WildFly
> Issue Type: Bug
> Components: Clustering
> Affects Versions: 10.0.0.Final, 10.1.0.Final
> Reporter: Gabriel Lavoie
> Assignee: Paul Ferraro
>
> When using optimistic locking on the web cache, data from expired sessions is not removed from the web cache by the org.wildfly.clustering.web.infinispan.session.SessionExpirationScheduler and leaks forever.
> Session seems to be invalidated correctly and isn't accessible anymore.
> After tracing the code, org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.remove() doesn't remove the metadata entries when "this.properties.isLockOnWrite()" returns false (which is always the case for optimistic locking). Then in org.wildfly.clustering.web.infinispan.session.InfinispanSessionFactory.remove(), the call to attributesFactory.remove(id) also gets skipped.
> We've tried to adjust the code of org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.remove() to the following:
> {code}
> private boolean remove(String id, Cache<SessionCreationMetaDataKey, SessionCreationMetaDataEntry<L>> creationMetaDataCache) {
> SessionCreationMetaDataKey key = new SessionCreationMetaDataKey(id);
> if (this.properties.isLockOnWrite()) {
> if (creationMetaDataCache.getAdvancedCache().withFlags(Flag.ZERO_LOCK_ACQUISITION_TIMEOUT, Flag.FAIL_SILENTLY).lock(key)) {
> creationMetaDataCache.getAdvancedCache().withFlags(Flag.IGNORE_RETURN_VALUES).remove(key);
> this.accessMetaDataCache.getAdvancedCache().withFlags(Flag.IGNORE_RETURN_VALUES).remove(new SessionAccessMetaDataKey(id));
> return true;
> }
> return false;
> } else {
> creationMetaDataCache.getAdvancedCache().withFlags(Flag.IGNORE_RETURN_VALUES).remove(key);
> this.accessMetaDataCache.getAdvancedCache().withFlags(Flag.IGNORE_RETURN_VALUES).remove(new SessionAccessMetaDataKey(id));
> return true;
> }
> }
> {code}
> With that change, the memory leaks disappears.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 12 months
[JBoss JIRA] (WFLY-6591) Memory leak of expired session in Infinispan cache with optimistic locking
by Gabriel Lavoie (JIRA)
Gabriel Lavoie created WFLY-6591:
------------------------------------
Summary: Memory leak of expired session in Infinispan cache with optimistic locking
Key: WFLY-6591
URL: https://issues.jboss.org/browse/WFLY-6591
Project: WildFly
Issue Type: Bug
Components: Clustering
Affects Versions: 10.0.0.Final, 10.1.0.Final
Reporter: Gabriel Lavoie
Assignee: Paul Ferraro
When using optimistic locking on the web cache, data from expired sessions is not removed from the web cache by the org.wildfly.clustering.web.infinispan.session.SessionExpirationScheduler and leaks forever.
Session seems to be invalidated correctly and isn't accessible anymore.
After tracing the code, org.wildfly.clustering.web.infinispan.session.InfinispanSessionMetaDataFactory.remove() doesn't remove the metadata entries when "this.properties.isLockOnWrite()" returns false (which is always the case for optimistic locking). Then in org.wildfly.clustering.web.infinispan.session.InfinispanSessionFactory.remove(), the call to attributesFactory.remove(id) also gets skipped.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 12 months
[JBoss JIRA] (WFLY-4769) WildFly 8 and 9. Connecting to topic using http-remoting and JNDI fails when server is behind NAT firewall
by George Turner (JIRA)
[ https://issues.jboss.org/browse/WFLY-4769?page=com.atlassian.jira.plugin.... ]
George Turner resolved WFLY-4769.
---------------------------------
Resolution: Done
Thank you VERY MUCH for providing a valid response! This worked entirely as expected!
> WildFly 8 and 9. Connecting to topic using http-remoting and JNDI fails when server is behind NAT firewall
> -----------------------------------------------------------------------------------------------------------
>
> Key: WFLY-4769
> URL: https://issues.jboss.org/browse/WFLY-4769
> Project: WildFly
> Issue Type: Bug
> Components: JMS
> Affects Versions: 8.2.0.Final, 9.0.0.CR1, 10.0.0.Final
> Environment: RedHat7
> Reporter: George Turner
> Assignee: Jeff Mesnil
>
> Server is behind NAT firewall. Client code:
> Properties topicProperties = new Properties();
> topicProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
> topicProperties.put(Context.PROVIDER_URL, "http-remoting://" + host + ":" + port);
> InitialContext ctx = new InitialContext(topicProperties);
> ConnectionFactory tmp = (ConnectionFactory) topicCtx.lookup("jms/RemoteConnectionFactory");
> connection = tmp.createConnection();
> Jun 11, 2015 8:26:07 AM org.xnio.Xnio <clinit>
> INFO: XNIO version 3.3.1.Final
> Jun 11, 2015 8:26:07 AM org.xnio.nio.NioXnio <clinit>
> INFO: XNIO NIO Implementation Version 3.3.1.Final
> Jun 11, 2015 8:26:07 AM org.jboss.remoting3.EndpointImpl <clinit>
> INFO: JBoss Remoting version 4.0.9.Final
> javax.jms.JMSException: Failed to create session factory
> at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:673)
> at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:112)
> at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:107)
> at com.lmco.spacefence.netcentric.test.client.TestMessageConsumer.<init>(TestMessageConsumer.java:36)
> at com.lmco.spacefence.netcentric.test.client.TestMessageConsumer.main(TestMessageConsumer.java:24)
> Caused by: HornetQNotConnectedException[errorType=NOT_CONNECTED message=HQ119007: Cannot connect to server(s). Tried with all available servers.]
> at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:905)
> at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:669)
> ... 4 more
> Disconnected from the target VM, address: '127.0.0.1:54275', transport: 'socket'
>
> Client debugger shows the ConnectionFactory instance returned:
> initialConnectors = {org.hornetq.api.core.TransportConfiguration[1]@2183}
> 0 = {org.hornetq.api.core.TransportConfiguration@2196} "TransportConfiguration(name=http-connector, factory=org-hornetq-core-remoting-impl-netty-NettyConnectorFactory) ?port=8080&host=10-10-20-77&http-upgrade-enabled=true&http-upgrade-endpoint=http-acceptor"
> name = {java.lang.String@2198} "http-connector"
> factoryClassName = {java.lang.String@2199} "org.hornetq.core.remoting.impl.netty.NettyConnectorFactory"
> params = {java.util.HashMap@2200} size = 4
> 0 = {java.util.HashMap$Node@2203} "port" -> "8080"
> 1 = {java.util.HashMap$Node@2204} "host" -> "10.10.20.77"
> 2 = {java.util.HashMap$Node@2205} "http-upgrade-enabled" -> "true"
> 3 = {java.util.HashMap$Node@2206} "http-upgrade-endpoint" -> "http-acceptor"
> 10.10.20.77 is IP address of server behind firewall, NOT the IP address used by the client.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 12 months
[JBoss JIRA] (DROOLS-1166) ClassNotFoundException for the drools function when large number of valuations
by Mario Fusco (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1166?page=com.atlassian.jira.plugi... ]
Mario Fusco commented on DROOLS-1166:
-------------------------------------
Using the lambda inside the function works because it uses the java.lang.invoke.LambdaMetafactory instead of looking for the inner class.
This is really a extreme edge case and I'm not sure if we want to support this, but I'll keep investigating a bit more.
> ClassNotFoundException for the drools function when large number of valuations
> ------------------------------------------------------------------------------
>
> Key: DROOLS-1166
> URL: https://issues.jboss.org/browse/DROOLS-1166
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.4.0.Final
> Reporter: Matteo Mortari
> Assignee: Mario Fusco
> Priority: Minor
> Attachments: 20160505.testjitfunction.zip
>
>
> Hello, for a large number of evaluations a {{ClassNotFoundException}} is thrown missing to find appropriate class for the drools function defined.
> In the attached reproducer, a for loop inserts a given number of facts into the session; for a small number of facts, no error is thrown.
> For example given
> {code}
> for (int i=0; i<20; i++) {
> session.insert("Ciao "+i);
> session.fireAllRules();
> }
> {code}
> all is fine.
> When running with say:
> {code}
> for (int i=0; i<150; i++) {
> session.insert("Ciao "+i);
> session.fireAllRules();
> }
> {code}
> then throws, snippet:
> {code}
> java.lang.NoClassDefFoundError: com/acme/testjitfunction/EntryKey$1
> at com.acme.testjitfunction.EntryKey.entryKey(EntryKey.java:51)
> at ConditionEvaluator1fae754676b54e869aa5b558ba2d7991.evaluate(Unknown Source)
> at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:258)
> at org.drools.core.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:214)
> at org.drools.core.phreak.PhreakAccumulateNode.evaluateResultConstraints(PhreakAccumulateNode.java:696)
> at org.drools.core.phreak.PhreakAccumulateNode.doNode(PhreakAccumulateNode.java:114)
> at org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:534)
> [...]
> Caused by: java.lang.ClassNotFoundException: com.acme.testjitfunction.EntryKey$1
> at java.lang.ClassLoader.findClass(ClassLoader.java:530)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> at org.drools.core.common.ProjectClassLoader$DefaultInternalTypesClassLoader.loadType(ProjectClassLoader.java:393)
> at org.drools.core.common.ProjectClassLoader$DefaultInternalTypesClassLoader.loadClass(ProjectClassLoader.java:380)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> ... 44 more
> {code}
> I'm also wondering if maybe this is not the best possible way to "backport" lambdas as a drool function; in case a more proper way to implement them as a drool function is possible, kindly let me know.
> Can you kindly advise, please?
> Thank you very much
> Ciao
> MM
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 12 months
[JBoss JIRA] (DROOLS-1166) ClassNotFoundException for the drools function when large number of valuations
by Mario Fusco (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1166?page=com.atlassian.jira.plugi... ]
Mario Fusco commented on DROOLS-1166:
-------------------------------------
Your test cases is a bit convoluted and I'm not sure why you're attempting this. It seems that you found a ClassLoader problem caused by the anonymous inner class defined in your function. I'm trying to figure out what's happening there. Also consider that if you replace
{code}
function Function<Entry, Object> entryKey() {
return new Function<Entry, Object>() {
@Override
public Object apply(Entry e) {
return e.getKey();
}
};
}
{code}
with
{code}
function Function<Entry, Object> entryKey() {
return (Entry e) -> e.getKey();
}
{code}
it works as expected ... even if at the moment I'm not sure why :)
> ClassNotFoundException for the drools function when large number of valuations
> ------------------------------------------------------------------------------
>
> Key: DROOLS-1166
> URL: https://issues.jboss.org/browse/DROOLS-1166
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.4.0.Final
> Reporter: Matteo Mortari
> Assignee: Mario Fusco
> Priority: Minor
> Attachments: 20160505.testjitfunction.zip
>
>
> Hello, for a large number of evaluations a {{ClassNotFoundException}} is thrown missing to find appropriate class for the drools function defined.
> In the attached reproducer, a for loop inserts a given number of facts into the session; for a small number of facts, no error is thrown.
> For example given
> {code}
> for (int i=0; i<20; i++) {
> session.insert("Ciao "+i);
> session.fireAllRules();
> }
> {code}
> all is fine.
> When running with say:
> {code}
> for (int i=0; i<150; i++) {
> session.insert("Ciao "+i);
> session.fireAllRules();
> }
> {code}
> then throws, snippet:
> {code}
> java.lang.NoClassDefFoundError: com/acme/testjitfunction/EntryKey$1
> at com.acme.testjitfunction.EntryKey.entryKey(EntryKey.java:51)
> at ConditionEvaluator1fae754676b54e869aa5b558ba2d7991.evaluate(Unknown Source)
> at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:258)
> at org.drools.core.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:214)
> at org.drools.core.phreak.PhreakAccumulateNode.evaluateResultConstraints(PhreakAccumulateNode.java:696)
> at org.drools.core.phreak.PhreakAccumulateNode.doNode(PhreakAccumulateNode.java:114)
> at org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:534)
> [...]
> Caused by: java.lang.ClassNotFoundException: com.acme.testjitfunction.EntryKey$1
> at java.lang.ClassLoader.findClass(ClassLoader.java:530)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> at org.drools.core.common.ProjectClassLoader$DefaultInternalTypesClassLoader.loadType(ProjectClassLoader.java:393)
> at org.drools.core.common.ProjectClassLoader$DefaultInternalTypesClassLoader.loadClass(ProjectClassLoader.java:380)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> ... 44 more
> {code}
> I'm also wondering if maybe this is not the best possible way to "backport" lambdas as a drool function; in case a more proper way to implement them as a drool function is possible, kindly let me know.
> Can you kindly advise, please?
> Thank you very much
> Ciao
> MM
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 12 months
[JBoss JIRA] (WFCORE-1526) ageout-history does not report failures
by Bartosz Spyrko-Śmietanko (JIRA)
Bartosz Spyrko-Śmietanko created WFCORE-1526:
------------------------------------------------
Summary: ageout-history does not report failures
Key: WFCORE-1526
URL: https://issues.jboss.org/browse/WFCORE-1526
Project: WildFly Core
Issue Type: Bug
Components: Patching
Affects Versions: 2.1.0.Final
Reporter: Bartosz Spyrko-Śmietanko
Assignee: Bartosz Spyrko-Śmietanko
When ageout-history cannot delete the old CP files, it silently fails and returns "success".
LocalAgeoutHistoryHandler#recursiveDelete does keep track of whether the
delete failed or succeeded, but the return value from this method is ignored
in execute(...).
If recursiveDelete returns false, it should report a failure.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 12 months
[JBoss JIRA] (WFLY-6590) Client thread pool max size parameter should be possible to parametrize in CLI
by Miroslav Novak (JIRA)
[ https://issues.jboss.org/browse/WFLY-6590?page=com.atlassian.jira.plugin.... ]
Miroslav Novak moved JBEAP-4539 to WFLY-6590:
---------------------------------------------
Project: WildFly (was: JBoss Enterprise Application Platform)
Key: WFLY-6590 (was: JBEAP-4539)
Workflow: GIT Pull Request workflow (was: CDW with loose statuses v1)
Component/s: JMS
(was: JMS)
Target Release: (was: 7.backlog.GA)
Affects Version/s: 10.0.0.Final
(was: 7.0.0.ER6)
> Client thread pool max size parameter should be possible to parametrize in CLI
> ------------------------------------------------------------------------------
>
> Key: WFLY-6590
> URL: https://issues.jboss.org/browse/WFLY-6590
> Project: WildFly
> Issue Type: Feature Request
> Components: JMS
> Affects Versions: 10.0.0.Final
> Reporter: Miroslav Novak
> Assignee: Jeff Mesnil
>
> Based on discussion in JBEAP-2947, we should provide CLI parameter to set maximum size of client thread pool.
> Currently {{-Dactivemq.artemis.client.global.thread.pool.max.size=<value>}} must be provided as system property during start of EAP 7 server.
> This thread pool can be injected by Wildfly. This could be the way to limit make its size configurable by Wildfly
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 12 months
[JBoss JIRA] (WFLY-6589) Add attribute to model which will indicate that backup is synchronized with live server
by Miroslav Novak (JIRA)
[ https://issues.jboss.org/browse/WFLY-6589?page=com.atlassian.jira.plugin.... ]
Miroslav Novak moved JBEAP-4538 to WFLY-6589:
---------------------------------------------
Project: WildFly (was: JBoss Enterprise Application Platform)
Key: WFLY-6589 (was: JBEAP-4538)
Workflow: GIT Pull Request workflow (was: CDW with loose statuses v1)
Component/s: JMS
(was: JMS)
(was: ActiveMQ)
Target Release: (was: 7.backlog.GA)
Affects Version/s: 10.0.0.Final
(was: 7.0.0.ER7)
> Add attribute to model which will indicate that backup is synchronized with live server
> ----------------------------------------------------------------------------------------
>
> Key: WFLY-6589
> URL: https://issues.jboss.org/browse/WFLY-6589
> Project: WildFly
> Issue Type: Feature Request
> Components: JMS
> Affects Versions: 10.0.0.Final
> Reporter: Miroslav Novak
> Assignee: Jeff Mesnil
> Priority: Critical
>
> If HA is configured with replicated journal then it takes some time to backup to synchronize with live server. Once backup is in sync with live then following information appears in server.log:
> {code}
> 13:20:00,739 INFO [org.apache.activemq.artemis.core.server] (Thread-3 (ActiveMQ-client-netty-threads-457000966)) AMQ221024: Backup server ActiveMQServerImpl::serverUUID=bc015b34-fd73-11e5-80ca-1b35f669abb8 is synchronized with live-server.
> 13:20:01,500 INFO [org.apache.activemq.artemis.core.server] (Thread-2 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$2@41f992ab-83559664)) AMQ221031: backup announced
> {code}
> Reading server logs to see whether backup is in sync is not convinient and user friendly way. Could we add this information to model so it can be detected through CLI command?
> New attribute with name {{synchronized-with-live}} should be added to {{/subsystem=messaging-activemq/server=default/ha-policy=replication-slave}}
> This information can be gathered by calling: {{SharedNothingBackupActivation.isRemoteBackupUpToDate()}}
> Additionally we should provide this attribute also in replicated live server in: {{/subsystem=messaging-activemq/server=default/ha-policy=replication-master}} as Administrator might want to know whether live can be shutdown.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 12 months