hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1393051 - /hive/trunk/service/src/java/org/apache/hadoop/hive/service/HiveServer.java
Date Tue, 02 Oct 2012 17:25:55 GMT
Author: hashutosh
Date: Tue Oct  2 17:25:55 2012
New Revision: 1393051

URL: http://svn.apache.org/viewvc?rev=1393051&view=rev
Log:
HIVE-3481: <Resource leak>: Hiveserver is not closing the existing driver handle before
executing the next command. It results in to file handle leaks. (Kanna Karanam via Ashutosh
Chauhan) 

Modified:
    hive/trunk/service/src/java/org/apache/hadoop/hive/service/HiveServer.java

Modified: hive/trunk/service/src/java/org/apache/hadoop/hive/service/HiveServer.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hadoop/hive/service/HiveServer.java?rev=1393051&r1=1393050&r2=1393051&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hadoop/hive/service/HiveServer.java (original)
+++ hive/trunk/service/src/java/org/apache/hadoop/hive/service/HiveServer.java Tue Oct  2
17:25:55 2012
@@ -179,6 +179,12 @@ public class HiveServer extends ThriftHi
       String SQLState = null;
 
       try {
+        // Close the existing driver object (CommandProcessor) before creating
+        // the new driver (CommandProcessor) object to clean-up the resources
+        if (driver != null) {
+          driver.close();
+          driver = null;
+        }
         CommandProcessor proc = CommandProcessorFactory.get(tokens[0]);
         if (proc != null) {
           if (proc instanceof Driver) {



Mime
View raw message