Review Board 1.7.22


TestHiveHistory::testQueryloglocParentDirNotExist Test fails on Windows because of some resource leaks in ZK

Review Request #7835 - Created Nov. 2, 2012 and updated

Kanna Karanam
hive
HIVE_3659
Reviewers
hive
ashutoshc, carl
hive
Hive uses ZK for locking. In some test cases, ZK is not behaving well. In thread dumps, I saw it is waiting for locks to be released but they were not getting released. Hive tries to release locks but keeps failing, it eventually times out for its release attempts, which in default settings takes 10 mins. This is also the cause of why some queries take extra-ordinarily long to run. I suggest to disable ZK locking till ZK is certified for windows.In this test case, I don’t see a requirement to use ZK so I am disabling the HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY to work around the issue.

 
trunk/ql/src/test/org/apache/hadoop/hive/ql/history/TestHiveHistory.java
Revision 1405070 New Change
[20] 48 lines
[+20]
49
 */
49
 */
50
public class TestHiveHistory extends TestCase {
50
public class TestHiveHistory extends TestCase {
51

    
   
51

   
52
  static HiveConf conf;
52
  static HiveConf conf;
53

    
   
53

   
54
  private static String tmpdir = "/tmp/" + System.getProperty("user.name")
54
  private static String tmpdir = System.getProperty("test.tmp.dir");
55
      + "/";

   
56
  private static Path tmppath = new Path(tmpdir);
55
  private static Path tmppath = new Path(tmpdir);
57
  private static Hive db;
56
  private static Hive db;
58
  private static FileSystem fs;
57
  private static FileSystem fs;
59
  private QTestSetup setup;

   
60

    
   

   
61
  /*
58
  /*
62
   * intialize the tables
59
   * intialize the tables
63
   */
60
   */
64

    
   
61

   
65
  @Override
62
  @Override
[+20] [20] 10 lines
[+20] [+] protected void setUp() {
76
        if (!fs.mkdirs(tmppath)) {
73
        if (!fs.mkdirs(tmppath)) {
77
          throw new RuntimeException("Could not make scratch directory "
74
          throw new RuntimeException("Could not make scratch directory "
78
              + tmpdir);
75
              + tmpdir);
79
        }
76
        }
80
      }
77
      }

    
   
78
      

    
   
79
      conf.setBoolVar(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY, false);
81

    
   
80

   
82
      setup = new QTestSetup();

   
83
      setup.preTest(conf);

   
84

    
   

   
85
      // copy the test files into hadoop if required.
81
      // copy the test files into hadoop if required.
86
      int i = 0;
82
      int i = 0;
87
      Path[] hadoopDataFile = new Path[2];
83
      Path[] hadoopDataFile = new Path[2];
88
      String[] testFiles = {"kv1.txt", "kv2.txt"};
84
      String[] testFiles = {"kv1.txt", "kv2.txt"};
89
      String testFileDir = new Path(conf.get("test.data.files")).toUri().getPath();
85
      String testFileDir = new Path(conf.get("test.data.files")).toUri().getPath();
[+20] [20] 23 lines
[+20] protected void setUp() {
113
      e.printStackTrace();
109
      e.printStackTrace();
114
      throw new RuntimeException("Encountered throwable");
110
      throw new RuntimeException("Encountered throwable");
115
    }
111
    }
116
  }
112
  }
117

    
   
113

   
118
  @Override

   
119
  protected void tearDown() {

   
120
    try {

   
121
      setup.tearDown();

   
122
    }

   
123
    catch (Exception e) {

   
124
      System.out.println("Exception: " + e.getMessage());

   
125
      e.printStackTrace();

   
126
      System.out.flush();

   
127
      fail("Unexpected exception in tearDown");

   
128
    }

   
129
  }

   
130

    
   

   
131
  /**
114
  /**
132
   * Check history file output for this query.
115
   * Check history file output for this query.
133
   */
116
   */
134
  public void testSimpleQuery() {
117
  public void testSimpleQuery() {
135
    new LineageInfo();
118
    new LineageInfo();
[+20] [20] 79 lines
  1. trunk/ql/src/test/org/apache/hadoop/hive/ql/history/TestHiveHistory.java: Loading...