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
HBASE-23744 - FastPathBalancedQueueRpcExecutor should enforce queue l… #1094
Conversation
🎊 +1 overall
This message was automatically generated. |
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.
Left some comments in JIRA.
LTGM +1
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
I have the same question as @xcangCRM . |
Any updates here? Should we merge the PR? Thanks. |
Looks like the discussion was going on Jira. The conclusion seems pending? |
Questions pending on Jira appear to await response from the author. |
@ndimiduk Questions pending on JIRA from the author are waiting for response from reviewers. :-) TestSimpleRpcScehduler.testSoftAndHardQueueLimits asserts that a call queue length of 0 means that the executor should refuse writes. There is one code path in FastPathBalancedQueueRpcExecutor that doesn't (the "fast" one); it just so happens to pass the test because that code path never gets used in the test. There are two potential solutions. In this patch, I've assumed the test is right, and fixed the FastPathBalancedQueueRpcExecutor to conform to it. Multiple reviewers wondered if this undocumented behavior should really exist as-is. If the test is wrong, the correct fix would be to change the test to not assert it. On a tangent, I mentioned that a write kill-switch is a useful feature (however achieved), and it was suggested that I file it as a JIRA, which I meant to do but never got around to doing. But this patch is still waiting on a judgment from the reviewers whether the test or the code is wrong. I'm happy to fix either 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.
TestSimpleRpcScehduler.testSoftAndHardQueueLimits asserts that a call queue length of 0 means that the executor should refuse writes. There is one code path in FastPathBalancedQueueRpcExecutor that doesn't (the "fast" one); it just so happens to pass the test because that code path never gets used in the test.
There are two potential solutions. In this patch, I've assumed the test is right, and fixed the FastPathBalancedQueueRpcExecutor to conform to it. Multiple reviewers wondered if this undocumented behavior should really exist as-is. If the test is wrong, the correct fix would be to change the test to not assert it.
This test seems to have been introduced via HBASE-15306. Reading over that ticket, behavior around currentQueueLimit
seems to be a convenient side-effect for test validation, not an intentional feature. But that's just my read.
On a tangent, I mentioned that a write kill-switch is a useful feature (however achieved), and it was suggested that I file it as a JIRA, which I meant to do but never got around to doing.
But this patch is still waiting on a judgment from the reviewers whether the test or the code is wrong. I'm happy to fix either one.
I think the implementations should be consistent wherever possible, so I'm good with your approach.
I have one comment for cleanup, otherwise, +1
@@ -559,6 +561,25 @@ public void testCoDelScheduling() throws Exception { | |||
} | |||
} | |||
|
|||
@Test | |||
public void testFastPathBalancedQueueRpcExecutorWithQueueLength0() throws Exception { | |||
String name = "testFastPathBalancedQueueRpcExecutorWithQueueLength0"; |
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.
Use the TestName
junit rule instead.
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.
@ndimiduk - thanks for the suggestion. I've replaced the constant with a TestName rule.
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
Test failures are not relevant. |
…ength of 0 Closes #1094 Signed-off-by: Xu Cang <xucang@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
…ength of 0 Closes #1094 Co-authored-by: Viraj Jasani <vjasani@apache.org> Signed-off-by: Xu Cang <xucang@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
…ength of 0 Closes apache#1094 Signed-off-by: Xu Cang <xucang@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
…ength of 0 Closes apache#1094 Signed-off-by: Xu Cang <xucang@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
…ength of 0