Skip to content
Permalink
Browse files

WFLY-11897 Fix memory leak caused by SFSB expiration failures due to …

…lock timeouts.
  • Loading branch information
pferraro committed Mar 25, 2019
1 parent ababc29 commit f29ce49029261d3a860bba6b7d6aa7ef7554ca99
@@ -114,16 +114,23 @@ public void close() {
@Override
public void run() {
InfinispanEjbLogger.ROOT_LOGGER.tracef("Expiring stateful session bean %s", this.id);
boolean complete = false;
try (Batch batch = BeanExpirationScheduler.this.batcher.createBatch()) {
try {
BeanExpirationScheduler.this.remover.remove(this.id, BeanExpirationScheduler.this.expiration.getRemoveListener());
complete = true;
} catch (Throwable e) {
InfinispanEjbLogger.ROOT_LOGGER.failedToExpireBean(e, this.id);
batch.discard();
}
} finally {
synchronized (this) {
BeanExpirationScheduler.this.expirationFutures.remove(this.id);
if (complete) {
BeanExpirationScheduler.this.expirationFutures.remove(this.id);
} else {
// If bean failed to expire, likely due to a lock timeout, just reschedule it
BeanExpirationScheduler.this.schedule(this.id);
}
}
}
}

0 comments on commit f29ce49

Please sign in to comment.
You can’t perform that action at this time.