[
https://issues.jboss.org/browse/WFLY-6591?page=com.atlassian.jira.plugin....
]
Mathieu Lachance edited comment on WFLY-6591 at 5/5/16 12:05 PM:
-----------------------------------------------------------------
I'd like also to point out to a comment in the top of the class
https://github.com/wildfly/wildfly/blob/master/clustering/web/infinispan/...:
{code}
/**
* Session expiration scheduler that eagerly expires sessions as soon as they are
eligible.
* If/When Infinispan implements expiration notifications (ISPN-694), this will be
obsolete.
* @author Paul Ferraro
*/
public class SessionExpirationScheduler implements Scheduler {
{code}
ISPN-694 has been resolved in Infinispan 8 which is now part of WF10.
Is there some remaining TODO's that were 'forgotten' ? Just in case...
was (Author: matlach):
I'd like also to pointout a comment in the top of the class
https://github.com/wildfly/wildfly/blob/master/clustering/web/infinispan/...:
{code}
/**
* Session expiration scheduler that eagerly expires sessions as soon as they are
eligible.
* If/When Infinispan implements expiration notifications (ISPN-694), this will be
obsolete.
* @author Paul Ferraro
*/
public class SessionExpirationScheduler implements Scheduler {
{code}
ISPN-694 has been resolved in Infinispan 8 which is now part of WF10.
Is there some remaining TODO's that were 'forgotten' ? Just in case...
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)