[infinispan-commits] Infinispan SVN: r1954 - in trunk: server/core/src/main/scala/org/infinispan/server/core and 1 other directories.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Thu Jul 1 16:39:27 EDT 2010


Author: galder.zamarreno at jboss.com
Date: 2010-07-01 16:39:26 -0400 (Thu, 01 Jul 2010)
New Revision: 1954

Modified:
   trunk/pom.xml
   trunk/server/core/src/main/scala/org/infinispan/server/core/Main.scala
   trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/HotRodServer.scala
Log:
[ISPN-496] (TimeoutException sometimes thrown when clustered Hot Rod server is stopped) Fixed by making sure Infinispan does not use its shutdown hook when Infinispan servers are in use. Added a minimal distribution profile as well to speed up testing.

Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml	2010-07-01 17:40:14 UTC (rev 1953)
+++ trunk/pom.xml	2010-07-01 20:39:26 UTC (rev 1954)
@@ -185,6 +185,54 @@
          </build>
       </profile>
 
+      <!-- This profile is an scaled down version of the distribution profile which should only be used to speed up
+      testing of distribution zip files. It doesn't generate any documentation and only generates the -all.zip distribution -->
+      <profile>
+         <id>minimal-distribution</id>
+         <activation>
+            <activeByDefault>false</activeByDefault>
+         </activation>
+         <properties>
+            <maven.test.skip.exec>true</maven.test.skip.exec>
+         </properties>
+         <build>
+            <plugins>
+               <plugin>
+                  <groupId>org.apache.maven.plugins</groupId>
+                  <artifactId>maven-jar-plugin</artifactId>
+                  <executions>
+                     <execution>
+                        <id>build-test-jar</id>
+                        <phase>none</phase>
+                     </execution>
+                  </executions>
+               </plugin>
+               <plugin>
+                  <groupId>org.apache.maven.plugins</groupId>
+                  <artifactId>maven-assembly-plugin</artifactId>
+                  <version>2.2-beta-3</version>
+                  <executions>
+                     <execution>
+                        <id>assemble</id>
+                        <phase>package</phase>
+                        <goals>
+                           <goal>single</goal>
+                        </goals>
+                     </execution>
+                  </executions>
+                  <configuration>
+                     <descriptors>
+                        <descriptor>src/main/resources/assemblies/all.xml</descriptor>
+                     </descriptors>
+                     <finalName>${artifactId}-${project.version}</finalName>
+                     <outputDirectory>target/distribution</outputDirectory>
+                     <workDirectory>target/assembly/work</workDirectory>
+                  </configuration>
+               </plugin>
+            </plugins>
+         </build>
+      </profile>
+
       <!-- TODO somehow combine this with the 'distribution' profile so all docs are built together -->
       <profile>
          <id>jmxdoc</id>

Modified: trunk/server/core/src/main/scala/org/infinispan/server/core/Main.scala
===================================================================
--- trunk/server/core/src/main/scala/org/infinispan/server/core/Main.scala	2010-07-01 17:40:14 UTC (rev 1953)
+++ trunk/server/core/src/main/scala/org/infinispan/server/core/Main.scala	2010-07-01 20:39:26 UTC (rev 1954)
@@ -11,7 +11,7 @@
 import org.infinispan.Version
 import org.infinispan.manager.{CacheContainer, DefaultCacheManager}
 import java.util.Properties
-import java.util.Properties
+import org.infinispan.config.GlobalConfiguration.ShutdownHookBehavior
 
 /**
  * Main class for server startup.
@@ -278,11 +278,15 @@
    }
 }
 
-private class ShutdownHook(server: ProtocolServer, cacheManager: CacheContainer) extends Thread {
+private class ShutdownHook(server: ProtocolServer, cacheManager: CacheContainer) extends Thread with Logging {
    override def run {
       if (server != null) {
-         System.out.println("Posting Shutdown Request to the server...")
-         var f = Executors.newSingleThreadExecutor.submit(new Callable[Void] {
+         info("Posting Shutdown Request to the server...")
+         val tf = new ThreadFactory {
+            override def newThread(r: Runnable): Thread = new Thread(r, "StopThread")
+         }
+
+         var f = Executors.newSingleThreadExecutor(tf).submit(new Callable[Void] {
             override def call = {
                server.stop
                cacheManager.stop

Modified: trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/HotRodServer.scala
===================================================================
--- trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/HotRodServer.scala	2010-07-01 17:40:14 UTC (rev 1953)
+++ trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/HotRodServer.scala	2010-07-01 20:39:26 UTC (rev 1954)
@@ -112,6 +112,7 @@
          if (isDebug) debug("Cluster member {0} was not filtered out of the current view {1}", address, currentView)
       } else {
          val newView = TopologyView(currentView.topologyId + 1, newMembers)
+         // TODO: Consider replace with 0 lock timeout and fail silently to avoid hold ups. Crash member detector can deal with any failures.
          val replaced = topologyCache.replace("view", currentView, newView)
          if (isDebug && !replaced) {
             debug("Attempt to update topology view failed due to a concurrent modification. " +



More information about the infinispan-commits mailing list