Skip to content

Fix defaultQueryTimeout#5807

Merged
jihoonson merged 4 commits intoapache:masterfrom
awelsh93:fix-for-defaultQueryTimeout
Jun 8, 2018
Merged

Fix defaultQueryTimeout#5807
jihoonson merged 4 commits intoapache:masterfrom
awelsh93:fix-for-defaultQueryTimeout

Conversation

@awelsh93
Copy link
Copy Markdown
Contributor

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.

awelsh93 added 2 commits May 29, 2018 11:01
- set default timeout in query context before query fail time is evaluated

Remove unused import
@gianm
Copy link
Copy Markdown
Contributor

gianm commented May 30, 2018

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(
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.

What is going to add QUERY_TOTAL_BYTES_GATHERED now?

{
this.serverConfig = serverConfig;
this.baseRunner = baseRunner;
this.startTimeMillis = startTimeMillis;
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.

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(
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.

newQuery is more Druid-like spelling.

@awelsh93
Copy link
Copy Markdown
Contributor Author

Hi @gianm, thank you for taking at look at this and leaving comments. I've addressed these comments and I have signed the CLA.

Copy link
Copy Markdown
Member

@nishantmonu51 nishantmonu51 left a comment

Choose a reason for hiding this comment

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

👍, LGTM

*/
public static void removeMagicResponseContextFields(Map<String, Object> responseContext)
{
responseContext.remove(DirectDruidClient.QUERY_FAIL_TIME);
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.

This line should also be removed.

@jihoonson
Copy link
Copy Markdown
Contributor

It would be great if we can add a unit test for this bug, but not sure how to do it yet.

@jihoonson jihoonson merged commit 6f0aedd into apache:master Jun 8, 2018
@awelsh93 awelsh93 deleted the fix-for-defaultQueryTimeout branch June 11, 2018 08:20
leventov pushed a commit to metamx/druid that referenced this pull request Jun 15, 2018
* 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
@jihoonson jihoonson added this to the 0.12.2 milestone Jul 3, 2018
jihoonson pushed a commit to jihoonson/druid that referenced this pull request Jul 5, 2018
* 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
fjy pushed a commit that referenced this pull request Jul 5, 2018
* 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
jihoonson pushed a commit to implydata/druid-public that referenced this pull request Jul 6, 2018
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants