-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Finish query when client has consumed results #14122
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
|
What does "when client has consumed results" mean, concretely (i.e., in terms of protocol interactions with the server). If I recall correctly, following the last link was the way for the client to signal to the server that it had received and seen the results successfully. |
|
I'd argue the clients are buggy and had not been following the protocol as defined - the recent change #13055 only exposed the fact that the clients are buggy. |
|
@martint It means that all the results have been fetched from the exchange client and the client has (potentially) seen the final page of data. Meaning that we returned a response with the final page. @hashhar Yes, they definitely are buggy, no argument there. That’s why the description says “This works around broken clients”. Ideally, all clients would be immediately fixed and users would instantly update to the fixed versions. In practice, this is a serious regression on the server for anyone using such clients, as it results in queries hanging around (for five minutes by default) and tying up the max concurrency slots. Related, we should probably decrease the default client query timeout, since five minutes seems way too long, and no client retires that long anyway. |
if this change is important for users, let's be sure to mention this in release notes. |
|
The fix looks good, though there are many test failures. I wonder if in some cases the query is getting closed prematurely |
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.
I'm afraid that might break the logic. I wonder if this boolean has to be set here or is it sufficient to call queryManager.resultsConsumed to let the query "finish"?
One possible problem to consider is that this will also potentially means the query is marked as finished before the client thinks it's finished -- e.g., if there are any delays in a properly working client to when fetching the final link, or if the client is having problems fetching the final result set and is in the process of retrying. |
This works around broken clients that don't fetch the final link.
7460594 to
fcb7774
Compare
is it a problem? server is executing the query, so it's done when it's done |
Some possible problems:
|
I'm not sure it's incorrect. At that point, the client has requested the final page of data. In extremely rare cases, the client might not receive the response and need to retry, but the query has already finished executing on the server. |
I still don't understand what problem this is solving. How are those clients deciding they don't want to follow the final link? What if they stop two steps from the final link, or three, or N? How do they know there's no more data to be returned? |
This works around broken clients that don't fetch the final link.
Release notes
(x) This is not user-visible and no release notes are required.