-
Notifications
You must be signed in to change notification settings - Fork 820
Ensure queries are cancelled correctly via the frontend. #1508
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
Conversation
And test it works. Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
1c96c7e
to
089c384
Compare
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
Fixes #1313 ? |
Yes! Sorry didn't know we had an issue for that. |
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.
Curious what you think about the DOS probability.
case err := <-errChan: | ||
request.err <- err | ||
// If the upstream reqeust is cancelled, we need to cancel the | ||
// downstream req. Only way we can do that is to close the stream. |
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.
This means if 5 requests are being handled on this stream, all of them will error out?
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.
This means a user can DOS the service by just sending requests and immediately cancelling them.
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.
There should only ever be one concurrent request per stream, so I don't think this is a problem.
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.
Right!
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.
LGTM!
case err := <-errChan: | ||
request.err <- err | ||
// If the upstream reqeust is cancelled, we need to cancel the | ||
// downstream req. Only way we can do that is to close the stream. |
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.
Right!
As far as I can see this isn't working. |
Signed-off-by: Tom Wilkie tom.wilkie@gmail.com
Should mostly be a simplification of the frontend.Process method's concurrency. And an extra goroutine in the client for this (worker.go).
And a unit test to show it works now.