-
Notifications
You must be signed in to change notification settings - Fork 903
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
Issue #1664 Cancel Scheduled SpeculativeReads #1665
Conversation
If configured every read request schedules a Future task to send speculative reads on speculativeReadTimeout. When the read is completed successfully, this task must be canceled otherwise it leads to memory consumption and under heavy load the tasks get accumulated which forces lengthy GC cycles. These lengthy GC cycles may cause ZK lease expiry and all other sorts of problems eventually resulting in application errors. This fix makes sure that the scheduled Futures are cancelled at the end of read task. Signed-off-by: Venkateswararao Jujjuri (JV) <vjujjuri@salesforce.com> (@ref Andrey@)
@@ -353,7 +373,7 @@ public void testSpeculativeReadScheduling() throws Exception { | |||
} | |||
Thread.sleep(1000); | |||
} | |||
assertTrue("Request should be done", req0.isComplete()); | |||
assertTrue("Request should be done", req.isComplete()); |
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.
good catch
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.
+1 lgtm
@jvrao please fix spotbugs, then I will be happy to merge and cherry pick
|
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
Java9 failure is on Twitter stats; Is that flaky or something I should look into? can we merge this? @sijie ? |
rerun java9 tests |
retest this please |
Descriptions of the changes in this PR: If configured every read request schedules a Future task to send speculative reads on speculativeReadTimeout. When the read is completed successfully, this task must be canceled otherwise it leads to memory consumption and under heavy load the tasks get accumulated which forces lengthy GC cycles. These lengthy GC cycles may cause ZK lease expiry and all other sorts of problems eventually resulting in application errors. This fix makes sure that the scheduled Futures are cancelled at the end of read task. Signed-off-by: Venkateswararao Jujjuri (JV) <vjujjurisalesforce.com> (ref Andrey) Author: JV Jujjuri <vjujjuri@salesforce.com> Author: Sijie Guo <sijie@apache.org> Reviewers: Andrey Yegorov <None>, Enrico Olivelli <eolivelli@gmail.com>, Sijie Guo <sijie@apache.org> This closes #1665 from jvrao/ups_speculative_cancel, closes #1664 (cherry picked from commit cdd6594) Signed-off-by: Sijie Guo <sijie@apache.org>
Descriptions of the changes in this PR: If configured every read request schedules a Future task to send speculative reads on speculativeReadTimeout. When the read is completed successfully, this task must be canceled otherwise it leads to memory consumption and under heavy load the tasks get accumulated which forces lengthy GC cycles. These lengthy GC cycles may cause ZK lease expiry and all other sorts of problems eventually resulting in application errors. This fix makes sure that the scheduled Futures are cancelled at the end of read task. Signed-off-by: Venkateswararao Jujjuri (JV) <vjujjurisalesforce.com> (ref Andrey) Author: JV Jujjuri <vjujjuri@salesforce.com> Author: Sijie Guo <sijie@apache.org> Reviewers: Andrey Yegorov <None>, Enrico Olivelli <eolivelli@gmail.com>, Sijie Guo <sijie@apache.org> This closes #1665 from jvrao/ups_speculative_cancel, closes #1664 (cherry picked from commit cdd6594) Signed-off-by: Sijie Guo <sijie@apache.org>
If configured every read request schedules a Future task
to send speculative reads on speculativeReadTimeout.
When the read is completed successfully, this task must be
canceled otherwise it leads to memory consumption and under
heavy load the tasks get accumulated which forces lengthy
GC cycles. These lengthy GC cycles may cause ZK lease expiry
and all other sorts of problems eventually resulting in application
errors.
This fix makes sure that the scheduled Futures are cancelled
at the end of read task.
Signed-off-by: Venkateswararao Jujjuri (JV) vjujjuri@salesforce.com
(@ref Andrey@)
Descriptions of the changes in this PR:
Motivation
(Explain: why you're making that change, what is the problem you're trying to solve)
Changes
(Describe: what changes you have made)
Master Issue: #