Author: paristote
Date: 2011-05-24 00:33:12 -0400 (Tue, 24 May 2011)
New Revision: 4415
Added:
jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1622/readme.txt
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockRemoverHolder.java
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleanerHolder.java
Log:
JCR-1622
What is the problem to fix?
* Threads are not ended when the application is stopped/restarted
so after restart we have multiple instances of these threads (
org.exoplatform.container.StandaloneContainer-db1_cmis1_cacheWorker,
and the one for db1_system too and also HSQL Timer thread)
* test case to reproduce:
start tomcat with xcmis
go to Tomcat Manager
Stop xCMIS Application
Start xCMIS Application
With a jconsole you can see that you have several times the same threads.
How is the problem fixed?
* Make components to be Startable and on stop method shutdown working threads.
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockRemoverHolder.java
===================================================================
---
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockRemoverHolder.java 2011-05-24
04:12:51 UTC (rev 4414)
+++
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockRemoverHolder.java 2011-05-24
04:33:12 UTC (rev 4415)
@@ -20,6 +20,7 @@
import org.exoplatform.services.jcr.config.RepositoryEntry;
import org.exoplatform.services.jcr.impl.proccess.WorkerService;
+import org.picocontainer.Startable;
/**
* LockRemoverHolder holds is a single per-repository LockRemover container.
@@ -27,7 +28,7 @@
* @author <a href="mailto:karpenko.sergiy@gmail.com">Karpenko
Sergiy</a>
* @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z aheritier $
*/
-public class LockRemoverHolder
+public class LockRemoverHolder implements Startable
{
/**
@@ -80,4 +81,19 @@
return new LockRemover(workerService, lockManager, timeout);
}
+ /**
+ * @see org.picocontainer.Startable#start()
+ */
+ public void start()
+ {
+ }
+
+ /**
+ * @see org.picocontainer.Startable#stop()
+ */
+ public void stop()
+ {
+ workerService.stop();
+ }
+
}
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java
===================================================================
---
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java 2011-05-24
04:12:51 UTC (rev 4414)
+++
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java 2011-05-24
04:33:12 UTC (rev 4415)
@@ -33,6 +33,7 @@
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import org.picocontainer.Startable;
import java.util.ArrayList;
import java.util.Calendar;
@@ -59,7 +60,7 @@
* @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter
Nedonosko</a>
* @version $Id: LinkedWorkspaceStorageCacheImpl.java 34801 2009-07-31 15:44:50Z dkatayev
$
*/
-public class LinkedWorkspaceStorageCacheImpl implements WorkspaceStorageCache
+public class LinkedWorkspaceStorageCacheImpl implements WorkspaceStorageCache, Startable
{
/**
@@ -763,28 +764,6 @@
}
}
- /**
- * {@inheritDoc}
- */
- @Override
- protected void finalize() throws Throwable
- {
- try
- {
- workerTimer.cancel();
- }
- catch (Throwable e)
- {
- System.err.println(this.name + " cache, finalyze error " + e);
- }
-
- nodesCache.clear();
- propertiesCache.clear();
- cache.clear();
-
- super.finalize();
- }
-
private void scheduleTask(TimerTask task, int start, long period)
{
Calendar firstTime = Calendar.getInstance();
@@ -2000,4 +1979,33 @@
{
return true;
}
+
+ /**
+ * {@inheritDoc}
+ */
+ public void start()
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void stop()
+ {
+ if (workerTimer != null)
+ {
+ try
+ {
+ workerTimer.cancel();
+ }
+ catch (Throwable e)
+ {
+ LOG.warn(this.name + " cache, stop error " + e);
+ }
+ }
+
+ nodesCache.clear();
+ propertiesCache.clear();
+ cache.clear();
+ }
}
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleanerHolder.java
===================================================================
---
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleanerHolder.java 2011-05-24
04:12:51 UTC (rev 4414)
+++
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleanerHolder.java 2011-05-24
04:33:12 UTC (rev 4415)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.services.jcr.impl.util.io;
+import org.picocontainer.Startable;
+
/**
* Created by The eXo Platform SAS. <br/> per workspace container file cleaner
holder object
*
@@ -25,7 +27,7 @@
* @version $Id: WorkspaceFileCleanerHolder.java 11907 2008-03-13 15:36:21Z ksm $
*/
-public class FileCleanerHolder
+public class FileCleanerHolder implements Startable
{
private final FileCleaner fileCleaner;
@@ -40,4 +42,19 @@
return fileCleaner;
}
+ /**
+ * @see org.picocontainer.Startable#start()
+ */
+ public void start()
+ {
+ }
+
+ /**
+ * @see org.picocontainer.Startable#stop()
+ */
+ public void stop()
+ {
+ fileCleaner.halt();
+ }
+
}
Added: jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1622/readme.txt
===================================================================
--- jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1622/readme.txt (rev
0)
+++ jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1622/readme.txt 2011-05-24 04:33:12 UTC (rev
4415)
@@ -0,0 +1,76 @@
+Summary
+
+ Status: Thread not stopped when the application is stopped
+ CCP Issue: N/A, Product Jira Issue: JCR-1622.
+ Complexity: Medium
+
+The Proposal
+Problem description
+
+What is the problem to fix?
+Threads are not ended when the application is stopped/restarted
+so after restart we have multiple instances of these threads (
org.exoplatform.container.StandaloneContainer-db1_cmis1_cacheWorker, and the one for
db1_system too and also HSQL Timer thread)
+
+test case to reproduce:
+
+ start tomcat with xcmis
+ go to Tomcat Manager
+ Stop xCMIS Application
+ Start xCMIS Application
+ With a jconsole you can see that you have several times the same threads.
+
+Fix description
+
+How is the problem fixed?
+
+* Make components to be Startable and on stop method shutdown working threads.
+
+Patch information:
+JCR-1622.patch
+
+Tests to perform
+
+Reproduction test
+* Steps to reproduce:
+
+Tests performed at DevLevel
+ cf above
+
+Tests performed at QA/Support Level
+ cf above
+
+Documentation changes
+
+Documentation changes:
+ No
+
+Configuration changes
+
+Configuration changes:
+ No
+
+Will previous configuration continue to work?
+ Yes
+
+Risks and impacts
+
+Can this bug fix have any side effects on current client projects?
+ N/A
+
+Function or ClassName change
+
core/webui-explorer/src/main/java/org/exoplatform/ecm/webui/component/explorer/control/UIAddressBar.java
+
+Is there a performance risk/cost?
+ No
+
+Validation (PM/Support/QA)
+
+PM Comment
+* PL review: patch validated
+
+Support Comment
+* Support review: patch validated
+
+QA Feedbacks
+*
+
Show replies by date