You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2020/08/28 12:03:00 UTC
[wicket] branch wicket-8.x updated: WICKET-6822
AsynchronousPageStore Potential Memory Leak
This is an automated email from the ASF dual-hosted git repository.
mgrigorov pushed a commit to branch wicket-8.x
in repository https://gitbox.apache.org/repos/asf/wicket.git
The following commit(s) were added to refs/heads/wicket-8.x by this push:
new 0d1130b WICKET-6822 AsynchronousPageStore Potential Memory Leak
0d1130b is described below
commit 0d1130b33be77e411200409870e8c238c594aeef
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Fri Aug 28 15:02:31 2020 +0300
WICKET-6822 AsynchronousPageStore Potential Memory Leak
---
.../wicket/pageStore/AsynchronousPageStore.java | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/wicket-core/src/main/java/org/apache/wicket/pageStore/AsynchronousPageStore.java b/wicket-core/src/main/java/org/apache/wicket/pageStore/AsynchronousPageStore.java
index 182b9d9..c3e5ba6 100644
--- a/wicket-core/src/main/java/org/apache/wicket/pageStore/AsynchronousPageStore.java
+++ b/wicket-core/src/main/java/org/apache/wicket/pageStore/AsynchronousPageStore.java
@@ -25,6 +25,7 @@ import java.util.concurrent.TimeUnit;
import org.apache.wicket.page.IManageablePage;
import org.apache.wicket.util.lang.Args;
+import org.apache.wicket.util.lang.Classes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -176,7 +177,7 @@ public class AsynchronousPageStore implements IPageStore
@Override
public String toString()
{
- return "Entry [sessionId=" + sessionId + ", pageId=" + page.getPageId() + "]";
+ return "Entry [sessionId=" + sessionId + ", pageId=" + page.getPageId() + ", pageClass=" + Classes.name(page.getClass())+ "]";
}
}
@@ -199,13 +200,24 @@ public class AsynchronousPageStore implements IPageStore
catch (InterruptedException e)
{
log.debug("PageSavingRunnable:: Interrupted...");
+ Thread.currentThread().interrupt();
}
if (entry != null && pageSavingThread != null)
{
- log.debug("PageSavingRunnable:: Saving asynchronously: {}...", entry);
- delegate.storePage(entry.sessionId, entry.page);
- entryMap.remove(entry.getKey());
+ try
+ {
+ log.debug("PageSavingRunnable:: Saving asynchronously: {}...", entry);
+ delegate.storePage(entry.sessionId, entry.page);
+ }
+ catch (Exception x)
+ {
+ log.error("An error occurred while saving asynchronously '{}'", entry, x);
+ }
+ finally
+ {
+ entryMap.remove(entry.getKey());
+ }
}
}
}