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

Increase query cancellation timeout in the router #16656

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

findingrish
Copy link
Contributor

Currently the timeout duration is hardcoded to 500 ms, this leads to frequent query cancellation failures when the Brokers are under load.

Increasing this value to 1 second.

@@ -104,7 +104,7 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet implements Qu
private static final String PROPERTY_SQL_ENABLE = "druid.router.sql.enable";
private static final String PROPERTY_SQL_ENABLE_DEFAULT = "false";

private static final int CANCELLATION_TIMEOUT_MILLIS = 500;
private static final int CANCELLATION_TIMEOUT_MILLIS = 1000;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we bump it up to 5 seconds ?
The reason is for a cluster that is fully loaded, a cancel call would help ease the pressure on the broker.
cc @abhishekagarwal87?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How did you arrive at the 5 second number?

Copy link
Contributor

Choose a reason for hiding this comment

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

Guesstimate mostly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to 5 seconds.

@@ -104,7 +104,7 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet implements Qu
private static final String PROPERTY_SQL_ENABLE = "druid.router.sql.enable";
private static final String PROPERTY_SQL_ENABLE_DEFAULT = "false";

private static final int CANCELLATION_TIMEOUT_MILLIS = 500;
private static final int CANCELLATION_TIMEOUT_MILLIS = 1000;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: let's avoid magic number 😄

Suggested change
private static final int CANCELLATION_TIMEOUT_MILLIS = 1000;
private static final int CANCELLATION_TIMEOUT_MILLIS = TimeUnit.SECONDS.toMillis(1);;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants