Permalink
Browse files
WFLY-11897 Fix memory leak caused by SFSB expiration failures due to …
- Loading branch information
|
|
@@ -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); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|