hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hair...@apache.org
Subject svn commit: r736430 - in /hadoop/core/branches/branch-0.19: ./ CHANGES.txt src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java
Date Wed, 21 Jan 2009 21:59:24 GMT
Author: hairong
Date: Wed Jan 21 13:59:24 2009
New Revision: 736430

URL: http://svn.apache.org/viewvc?rev=736430&view=rev
Log:
Merge -r 736425:736426  to move the change of HADOOP-5009 from main t0 branch 0.19

Modified:
    hadoop/core/branches/branch-0.19/   (props changed)
    hadoop/core/branches/branch-0.19/CHANGES.txt   (contents, props changed)
    hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java
    hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java

Propchange: hadoop/core/branches/branch-0.19/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 21 13:59:24 2009
@@ -1 +1 @@
-/hadoop/core/trunk:697306,698176,699056,699098,699415,699424,699444,699490,699517,700163,700628,700923,701273,701398,703923,704203,704261,704701,704703,704707,704712,704732,704748,704989,705391,705420,705430,705762,706350,706707,706719,706796,706802,707258,707262,708623,708641,708710,709040,709303,712881,713888,720602,723013,723460,723831,723918,724883,727117,727212,727217,727228,727869,732572,732777,733887,734870
+/hadoop/core/trunk:697306,698176,699056,699098,699415,699424,699444,699490,699517,700163,700628,700923,701273,701398,703923,704203,704261,704701,704703,704707,704712,704732,704748,704989,705391,705420,705430,705762,706350,706707,706719,706796,706802,707258,707262,708623,708641,708710,709040,709303,712881,713888,720602,723013,723460,723831,723918,724883,727117,727212,727217,727228,727869,732572,732777,733887,734870,736426

Modified: hadoop/core/branches/branch-0.19/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/CHANGES.txt?rev=736430&r1=736429&r2=736430&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.19/CHANGES.txt Wed Jan 21 13:59:24 2009
@@ -66,6 +66,9 @@
     reduce task and instantiating the reducer class. 
     (Amareshwari Sriramadasu via ddas)
 
+    HADOOP-5009. DataNode#shutdown sometimes leaves data block scanner
+    verification log unclosed. (hairong)
+
 Release 0.19.0 - 2008-11-18
 
   INCOMPATIBLE CHANGES

Propchange: hadoop/core/branches/branch-0.19/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 21 13:59:24 2009
@@ -1,2 +1,2 @@
 /hadoop/core/branches/branch-0.18/CHANGES.txt:727226
-/hadoop/core/trunk/CHANGES.txt:697306,698176,699056,699098,699415,699424,699444,699490,699517,700163,700628,700923,701273,701398,703923,704203,704261,704701,704703,704707,704712,704732,704748,704989,705391,705420,705430,705762,706350,706707,706719,706796,706802,707258,707262,708623,708641,708710,708723,709040,709303,711717,712881,713888,720602,723013,723460,723831,723918,724883,727117,727212,727217,727228,727869,732572,732777,733887,734870,735082
+/hadoop/core/trunk/CHANGES.txt:697306,698176,699056,699098,699415,699424,699444,699490,699517,700163,700628,700923,701273,701398,703923,704203,704261,704701,704703,704707,704712,704732,704748,704989,705391,705420,705430,705762,706350,706707,706719,706796,706802,707258,707262,708623,708641,708710,708723,709040,709303,711717,712881,713888,720602,723013,723460,723831,723918,724883,727117,727212,727217,727228,727869,732572,732777,733887,734870,735082,736426

Modified: hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java?rev=736430&r1=736429&r2=736430&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java
(original)
+++ hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataBlockScanner.java
Wed Jan 21 13:59:24 2009
@@ -517,6 +517,7 @@
       verificationLog.updateCurNumLines();
     }
     
+    try {
     // update verification times from the verificationLog.
     while (logReader != null && logReader.hasNext()) {
       if (!datanode.shouldRun || Thread.interrupted()) {
@@ -527,6 +528,9 @@
         updateBlockInfo(entry);
       }
     }
+    } finally {
+      IOUtils.closeStream(logReader);
+    }
     
     /* Initially spread the block reads over half of 
      * MIN_SCAN_PERIOD so that we don't keep scanning the 
@@ -590,12 +594,12 @@
           } catch (InterruptedException ignored) {}
         }
       }
-      shutdown();
     } catch (RuntimeException e) {
       LOG.warn("RuntimeException during DataBlockScanner.run() : " +
                StringUtils.stringifyException(e));
       throw e;
     } finally {
+      shutdown();
       LOG.info("Exiting DataBlockScanner thread.");
     }
   }
@@ -783,8 +787,9 @@
     //This reads the current file and updates the count.
     void updateCurNumLines() {
       int count = 0;
+      Reader it = null;
       try {
-        for(Reader it = new Reader(true); it.hasNext(); count++) {
+        for(it = new Reader(true); it.hasNext(); count++) {
           it.next();
         }
       } catch (IOException e) {
@@ -793,6 +798,7 @@
         synchronized (this) {
           curNumLines = count;
         }
+        IOUtils.closeStream(it);
       }
     }
     

Modified: hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java?rev=736430&r1=736429&r2=736430&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java
(original)
+++ hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java
Wed Jan 21 13:59:24 2009
@@ -578,10 +578,13 @@
     
     if(upgradeManager != null)
       upgradeManager.shutdownUpgrade();
-    if (blockScanner != null)
-      blockScanner.shutdown();
-    if (blockScannerThread != null) 
+    if (blockScannerThread != null) { 
       blockScannerThread.interrupt();
+      try {
+        blockScannerThread.join(3600000L); // wait for at most 1 hour
+      } catch (InterruptedException ie) {
+      }
+    }
     if (storage != null) {
       try {
         this.storage.unlockAll();



Mime
View raw message