浏览代码

[impala] Faster check status until 2s of execution

Romain Rigaux 11 年之前
父节点
当前提交
86b23008ac
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 3 1
      apps/beeswax/src/beeswax/api.py
  2. 2 1
      apps/beeswax/static/js/beeswax.vm.js

+ 3 - 1
apps/beeswax/src/beeswax/api.py

@@ -17,6 +17,7 @@
 
 import json
 import logging
+import re
 
 from django.core.urlresolvers import reverse
 from django.http import HttpResponse, Http404
@@ -70,8 +71,9 @@ def error_handler(view_fn):
         'message': message,
       }
 
-      if 'database is locked' in message or 'Invalid query handle' in message or 'not JSON serializable' in message:
+      if re.search('database is locked|Invalid query handle|not JSON serializable', message, re.IGNORECASE):
         response['status'] = 2 # Frontend will not display this type of error
+        LOG.warn('error_handler silencing the exception: %s' % e)
 
       return HttpResponse(json.dumps(response), mimetype="application/json", status=200)
   return decorator

+ 2 - 1
apps/beeswax/static/js/beeswax.vm.js

@@ -596,7 +596,7 @@ function BeeswaxViewModel(server) {
   };
 
   self.watchQueryLoop = function(fn) {
-    var TIMEOUT = 1000;
+    var TIMEOUT = 100;
     var timer = null;
 
     self.design.isRunning(true);
@@ -631,6 +631,7 @@ function BeeswaxViewModel(server) {
             // scroll logs
           }
 
+          TIMEOUT = Math.min(TIMEOUT + 100, 2000);
           timer = setTimeout(_fn, TIMEOUT);
         }
       });