Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a timeout for hive queries wait so that we can fail fast #1079

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
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
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
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