-
Notifications
You must be signed in to change notification settings - Fork 200
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
base: master
Are you sure you want to change the base?
Conversation
and return if there is inordinate delay.
@@ -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); |
There was a problem hiding this comment.
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();
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
8b43301
to
2b254d9
Compare
2c254f0
to
0f2888f
Compare
a466d26
to
ea127bd
Compare
99ec79c
to
c7b84fa
Compare
This causes delay in shutdown etc. also even if hive query is failing due to cluster being down.
Changes proposed in this pull request
Do not wait for more than 30 seconds for any hive query. Added a timeout.
Patch testing
(Fill in the details about how this patch was tested)
ReleaseNotes.txt changes
(Does this change require an entry in ReleaseNotes.txt? If yes, has it been added to it?)
Other PRs
(Does this change require changes in other projects- store, spark, spark-jobserver, aqp? Add the links of PR of the other subprojects that are related to this change)