Fix defaultQueryTimeout#5807
Conversation
- set default timeout in query context before query fail time is evaluated Remove unused import
|
Hi @awelsh93, could you please fill out the project CLA so we can accept this contribution? It's at: http://druid.io/community/cla.html |
| DirectDruidClient.QUERY_FAIL_TIME, | ||
| startTimeMillis + QueryContexts.getTimeout(query) | ||
| ); | ||
| responseContext.put( |
There was a problem hiding this comment.
What is going to add QUERY_TOTAL_BYTES_GATHERED now?
| { | ||
| this.serverConfig = serverConfig; | ||
| this.baseRunner = baseRunner; | ||
| this.startTimeMillis = startTimeMillis; |
There was a problem hiding this comment.
This is always set to System.currentTimeMillis(), might as well set it in the constructor so callers don't have to pass that in. Unless you are intending to use the flexibility to write some unit tests -- in which case go for it.
| public Query<T> withTimeoutAndMaxScatterGatherBytes(Query<T> query, ServerConfig serverConfig) | ||
| { | ||
| return QueryContexts.verifyMaxQueryTimeout( | ||
| Query<T> new_query = QueryContexts.verifyMaxQueryTimeout( |
There was a problem hiding this comment.
newQuery is more Druid-like spelling.
|
Hi @gianm, thank you for taking at look at this and leaving comments. I've addressed these comments and I have signed the CLA. |
| */ | ||
| public static void removeMagicResponseContextFields(Map<String, Object> responseContext) | ||
| { | ||
| responseContext.remove(DirectDruidClient.QUERY_FAIL_TIME); |
There was a problem hiding this comment.
This line should also be removed.
|
It would be great if we can add a unit test for this bug, but not sure how to do it yet. |
* Fix defaultQueryTimeout - set default timeout in query context before query fail time is evaluated Remove unused import * Address failing checks * Addressing code review comments * Removed line that was no longer used
* Fix defaultQueryTimeout - set default timeout in query context before query fail time is evaluated Remove unused import * Address failing checks * Addressing code review comments * Removed line that was no longer used
* Fix defaultQueryTimeout - set default timeout in query context before query fail time is evaluated Remove unused import * Address failing checks * Addressing code review comments * Removed line that was no longer used
Fix for #5731
Made a change so that SetAndVerifyContextQueryRunner will set query fail time after the default query timeout is set in the query context.