-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Send query heartbeat while spooled data is downloaded #25267
base: master
Are you sure you want to change the base?
Conversation
This prevents a situation when long list of segments is returned and client slowly progresses over it which could take longer than a query abandoned timeout. This change allows to send a heartbeat while client is progressing over data.
070346a
to
7b599b7
Compare
@@ -388,6 +397,50 @@ public boolean advance() | |||
return executeRequest(request, "fetching next", (e) -> true); | |||
} | |||
|
|||
public void heartbeat() |
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.
Maybe rename to heartbeatIfNeeded
private final boolean isNull; | ||
private final Runnable heartbeat; | ||
|
||
public HeartbeatingResultRows(ResultRows delegate, Runnable heartbeat) |
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.
Can you add unit test for this one?
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 can try but I need to think how to do it. The default keep-alive interval is 30s
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.
You would need some parametrization; at least @VisibleForTests
. And possibly some mockings. See if that is not too much of spaghetti
This prevents a situation when long list of segments is returned and client slowly progresses over it which could take longer than a query abandoned timeout.
This change allows to send a heartbeat while client is progressing over data.
Description
Additional context and related issues
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: