From de2f7650c4580f84ce5b9024ec796e92d7e8bfdf Mon Sep 17 00:00:00 2001 From: Neeraj Kumar Date: Wed, 11 Jul 2018 19:01:08 +0530 Subject: [PATCH] Added a timeout for hive queries wait so that we can fail fast and return if there is inordinate delay. --- core/src/main/java/io/snappydata/impl/SnappyHiveCatalog.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/io/snappydata/impl/SnappyHiveCatalog.java b/core/src/main/java/io/snappydata/impl/SnappyHiveCatalog.java index 1a443860b3..cace6e99cd 100644 --- a/core/src/main/java/io/snappydata/impl/SnappyHiveCatalog.java +++ b/core/src/main/java/io/snappydata/impl/SnappyHiveCatalog.java @@ -269,7 +269,8 @@ private HMSQuery getHMSQuery() { private T handleFutureResult(Future f) { try { - return f.get(); + // Time out if it takes more than 30 seconds + return f.get(30, TimeUnit.SECONDS); } catch (ExecutionException e) { throw new RuntimeException(e.getCause()); } catch (Exception e) {