-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat(flags): Add query timeout as a limit config #7599
feat(flags): Add query timeout as a limit config #7599
Conversation
…lue as 500ms. JIRA: [DGRAPH-3184]
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.
Looks good.
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.
Actually, setting 500ms as timeout is causing various tests to fail.
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.
Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @jarifibrahim and @rohanprasad)
dgraph/cmd/alpha/http.go, line 137 at r1 (raw file):
// parses it into time.Duration, empty string is converted into zero value func parseDuration(r *http.Request, name string, defaultVal time.Duration) (time.Duration, error) { value := r.URL.Query().Get(name)
I think we want to over-ride the query timeout set by the user if it is greater than the default value in a multi-tenant setup. @rohanprasad can you confirm this please?
dgraph/cmd/alpha/http.go, line 162 at r1 (raw file):
return } queryTimeout, err := parseDuration(r, "timeout", x.Config.QueryTimeout)
This will timeout the query made via HTTP endpoint /query
. But the queries made via GRPC (see Server.Query
) will not timeout.
I think in a multi-tenant system it will be useful to have a timeout there as well.
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.
Default set to 0
Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @jarifibrahim, @NamanJain8, and @rohanprasad)
dgraph/cmd/alpha/http.go, line 137 at r1 (raw file):
Previously, NamanJain8 (Naman Jain) wrote…
I think we want to over-ride the query timeout set by the user if it is greater than the default value in a multi-tenant setup. @rohanprasad can you confirm this please?
Confirmed, we don't want to override if the timeout is set by the user
dgraph/cmd/alpha/http.go, line 162 at r1 (raw file):
Previously, NamanJain8 (Naman Jain) wrote…
This will timeout the query made via HTTP endpoint
/query
. But the queries made via GRPC (seeServer.Query
) will not timeout.
I think in a multi-tenant system it will be useful to have a timeout there as well.
Will do
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.
Looks good to me.
In the case of a multi-tenant environment, long-running queries by tenants can consume all the resources, starving the request from other tenants. The change adds query-timeout as a config which will be applied to all the query requests sent without timeout param.
Fixes DGRAPH-3184
This change is