Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion core/src/main/java/io/snappydata/impl/SnappyHiveCatalog.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ private HMSQuery getHMSQuery() {

private <T> T handleFutureResult(Future<T> f) {
try {
return f.get();
// Time out if it takes more than 30 seconds
return f.get(30, TimeUnit.SECONDS);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't it be best to shutdown "hmsQueriesExecutorService" in case of shutdown, which calls catalog.close();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. anyway, that is called. So why was the queries waiting?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The query waits for the result on a future. A different thread runs the query and gets the result. The hive query kept on retrying ( from hive code ) and the future was indefinite wait. It looks like the hive thingy retries for a very very long time...
So thought of timing this out after 30 seconds. Please mind, this is the query on the metastore.

} catch (ExecutionException e) {
throw new RuntimeException(e.getCause());
} catch (Exception e) {
Expand Down