Переглянути джерело

HADOOP-408. Adjust some timeouts and remove some others so that unit tests run faster.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@440864 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 19 роки тому
батько
коміт
c20d1bb50f

+ 3 - 0
CHANGES.txt

@@ -123,6 +123,9 @@ Trunk (unreleased changes)
 30. HADOOP-424.  Fix MapReduce so that jobs which generate zero splits
     do not fail.  (Frédéric Bertin via cutting)
 
+31. HADOOP-408.  Adjust some timeouts and remove some others so that
+    unit tests run faster.  (cutting)
+
 
 Release 0.5.0 - 2006-08-04
 

+ 0 - 3
src/java/org/apache/hadoop/ipc/Client.java

@@ -280,9 +280,6 @@ public class Client {
    * using this client. */
   public void stop() {
     LOG.info("Stopping client");
-    try {
-      Thread.sleep(timeout);                        // let all calls complete
-    } catch (InterruptedException e) {}
     running = false;
   }
 

+ 1 - 1
src/java/org/apache/hadoop/ipc/RPC.java

@@ -229,7 +229,7 @@ public class RPC {
         LOG.info("Problem connecting to server: " + addr);
       }
       try {
-        Thread.sleep(10*1000);
+        Thread.sleep(1000);
       } catch (InterruptedException ie) {
         // IGNORE
       }

+ 1 - 6
src/java/org/apache/hadoop/ipc/Server.java

@@ -541,16 +541,11 @@ public abstract class Server {
     }
   }
 
-  /** Stops the service.  No new calls will be handled after this is called.  All
-   * subthreads will likely be finished after this returns.
-   */
+  /** Stops the service.  No new calls will be handled after this is called. */
   public synchronized void stop() {
     LOG.info("Stopping server on " + port);
     running = false;
     listener.doStop();
-    try {
-      Thread.sleep(timeout);     //  inexactly wait for pending requests to finish
-    } catch (InterruptedException e) {}
     notifyAll();
   }
 

+ 1 - 15
src/java/org/apache/hadoop/mapred/TaskTracker.java

@@ -59,7 +59,6 @@ public class TaskTracker
     int taskReportPort;
 
     Server taskReportServer = null;
-    Server mapOutputServer = null;
     InterTrackerProtocol jobClient;
 
     StatusHttpServer server = null;
@@ -209,7 +208,7 @@ public class TaskTracker
           close();
           if (this.server != null) {
             try {
-                LOG.info("Shttting down StatusHttpServer");
+                LOG.info("Shutting down StatusHttpServer");
                 this.server.stop();
             } catch (InterruptedException ex) {
                 ex.printStackTrace();
@@ -234,18 +233,10 @@ public class TaskTracker
             tip.jobHasFinished();
         }
 
-        // Wait for them to die and report in
-        try {
-            Thread.sleep(5000);
-        } catch (InterruptedException ie) {
-        }
-
-        //
         // Shutdown local RPC servers.  Do them
         // in parallel, as RPC servers can take a long
         // time to shutdown.  (They need to wait a full
         // RPC timeout, which might be 10-30 seconds.)
-        //
         new Thread() {
             public void run() {
                 if (taskReportServer != null) {
@@ -255,11 +246,6 @@ public class TaskTracker
             }
         }.start();
 
-        if (mapOutputServer != null) {
-            mapOutputServer.stop();
-            mapOutputServer = null;
-        }
-
         this.running = false;
         
         // Clear local storage

+ 2 - 2
src/test/org/apache/hadoop/dfs/MiniDFSCluster.java

@@ -113,7 +113,7 @@ public class MiniDFSCluster {
     conf.setInt("dfs.replication", 1);
     // this timeout seems to control the minimum time for the test, so
     // decrease it considerably.
-    conf.setInt("ipc.client.timeout", 2000);
+    conf.setInt("ipc.client.timeout", 1000);
     NameNode.format(conf);
     nameNode = new NameNodeRunner();
     nameNodeThread = new Thread(nameNode);
@@ -129,7 +129,7 @@ public class MiniDFSCluster {
     while (!nameNode.isUp()) {
       try {                                     // let daemons get started
         System.out.println("waiting for dfs minicluster to start");
-        Thread.sleep(2000);
+        Thread.sleep(1000);
       } catch(InterruptedException e) {
       }
     }