-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
base: master
Are you sure you want to change the base?
Increase query cancellation timeout in the router #16656
Conversation
@@ -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; |
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.
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?
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.
How did you arrive at the 5 second number?
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.
Guesstimate mostly.
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.
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; |
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.
Nit: let's avoid magic number 😄
private static final int CANCELLATION_TIMEOUT_MILLIS = 1000; | |
private static final int CANCELLATION_TIMEOUT_MILLIS = TimeUnit.SECONDS.toMillis(1);; |
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.
Done.
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.