You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "abhishekagarwal87 (via GitHub)" <gi...@apache.org> on 2023/08/17 09:28:10 UTC
[PR] Fix a bug in QosFilter when enableRequestQueuing is enabled (druid)
abhishekagarwal87 opened a new pull request, #14859:
URL: https://github.com/apache/druid/pull/14859
QoSFilter class is trying to parse the timeout as an integer. We need to round a value of query timeout that is higher than INT.MAX to INT.MAX.
This PR has:
- [ ] been self-reviewed.
- [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.)
- [ ] added documentation for new or modified features or behaviors.
- [ ] a release note entry in the PR description.
- [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
- [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
- [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
- [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
- [ ] added integration tests.
- [ ] been tested in a test Druid cluster.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Fix a bug in QosFilter when enableRequestQueuing is enabled (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #14859:
URL: https://github.com/apache/druid/pull/14859#discussion_r1297080450
##########
server/src/main/java/org/apache/druid/server/initialization/jetty/JettyBindings.java:
##########
@@ -94,10 +94,15 @@ public Class<? extends Filter> getFilterClass()
@Override
public Map<String, String> getInitParameters()
{
- if (timeoutMs >= 0) {
- return ImmutableMap.of("maxRequests", String.valueOf(maxRequests), "suspendMs", String.valueOf(timeoutMs));
+ if (timeoutMs < 0) {
+ return ImmutableMap.of("maxRequests", String.valueOf(maxRequests));
}
- return ImmutableMap.of("maxRequests", String.valueOf(maxRequests));
+ if (timeoutMs > Integer.MAX_VALUE) {
+ // QoSFilter tries to parse the suspendMs parameter as an int, so we can't set it to more than Integer
Review Comment:
Since the only use of `timeoutMs` is in this method, maybe we should do the rounding off in the constructor itself and log a warn message if it is set higher than that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Fix a bug in QosFilter when enableRequestQueuing is enabled (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #14859:
URL: https://github.com/apache/druid/pull/14859#discussion_r1297080450
##########
server/src/main/java/org/apache/druid/server/initialization/jetty/JettyBindings.java:
##########
@@ -94,10 +94,15 @@ public Class<? extends Filter> getFilterClass()
@Override
public Map<String, String> getInitParameters()
{
- if (timeoutMs >= 0) {
- return ImmutableMap.of("maxRequests", String.valueOf(maxRequests), "suspendMs", String.valueOf(timeoutMs));
+ if (timeoutMs < 0) {
+ return ImmutableMap.of("maxRequests", String.valueOf(maxRequests));
}
- return ImmutableMap.of("maxRequests", String.valueOf(maxRequests));
+ if (timeoutMs > Integer.MAX_VALUE) {
+ // QoSFilter tries to parse the suspendMs parameter as an int, so we can't set it to more than Integer
Review Comment:
Since the only use of `timeoutMs` is in this method, maybe we should do the rounding off in the constructor itself.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Fix a bug in QosFilter when enableRequestQueuing is enabled (druid)
Posted by "abhishekagarwal87 (via GitHub)" <gi...@apache.org>.
abhishekagarwal87 commented on code in PR #14859:
URL: https://github.com/apache/druid/pull/14859#discussion_r1297093261
##########
server/src/main/java/org/apache/druid/server/initialization/jetty/JettyBindings.java:
##########
@@ -94,10 +94,15 @@ public Class<? extends Filter> getFilterClass()
@Override
public Map<String, String> getInitParameters()
{
- if (timeoutMs >= 0) {
- return ImmutableMap.of("maxRequests", String.valueOf(maxRequests), "suspendMs", String.valueOf(timeoutMs));
+ if (timeoutMs < 0) {
+ return ImmutableMap.of("maxRequests", String.valueOf(maxRequests));
}
- return ImmutableMap.of("maxRequests", String.valueOf(maxRequests));
+ if (timeoutMs > Integer.MAX_VALUE) {
+ // QoSFilter tries to parse the suspendMs parameter as an int, so we can't set it to more than Integer
Review Comment:
you will still need to execute timeout specific logic. So with the approach you suggested the logic will be scattered across as opposed to being all in one place.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Fix a bug in QosFilter when enableRequestQueuing is enabled (druid)
Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #14859:
URL: https://github.com/apache/druid/pull/14859#discussion_r1297119770
##########
server/src/main/java/org/apache/druid/server/initialization/jetty/JettyBindings.java:
##########
@@ -94,10 +94,15 @@ public Class<? extends Filter> getFilterClass()
@Override
public Map<String, String> getInitParameters()
{
- if (timeoutMs >= 0) {
- return ImmutableMap.of("maxRequests", String.valueOf(maxRequests), "suspendMs", String.valueOf(timeoutMs));
+ if (timeoutMs < 0) {
+ return ImmutableMap.of("maxRequests", String.valueOf(maxRequests));
}
- return ImmutableMap.of("maxRequests", String.valueOf(maxRequests));
+ if (timeoutMs > Integer.MAX_VALUE) {
+ // QoSFilter tries to parse the suspendMs parameter as an int, so we can't set it to more than Integer
Review Comment:
Well, it kind of is two separate pieces of logic. One is the max allowed value of `timeoutMs` and the other is construction of the map. I am okay either way though. It is just that the current flow is doing something silently without ever giving any feedback to the user.
I would even suggest just making the `timeoutMs` an `int` instead of a `long`. But if you feel strongly, we can proceed with it as is for now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Fix a bug in QosFilter when enableRequestQueuing is enabled (druid)
Posted by "abhishekagarwal87 (via GitHub)" <gi...@apache.org>.
abhishekagarwal87 merged PR #14859:
URL: https://github.com/apache/druid/pull/14859
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org