-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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-25837 TestRollingRestart is flaky #3220
Conversation
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@@ -230,6 +230,8 @@ private void waitForRSShutdownToStartAndFinish(MasterThread activeMaster, | |||
} | |||
log("Server [" + serverName + "] marked as dead, waiting for it to " + | |||
"finish dead processing"); | |||
// wait SCP be executed | |||
Thread.sleep(100); |
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.
We'd better not add unconditional sleeps in code. Is it possible to test whether SCP has been executed?
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 not agree more
🎊 +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. |
* Checks if the SCP of specific dead server has been executed. | ||
* @return true if the SCP of specific serverName has been executed, false if not | ||
*/ | ||
boolean isDeadServerSCPExecuted(ServerName serverName) throws IOException { |
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 we move this method to test code? I think it is only used for testing.
@@ -230,6 +230,10 @@ private void waitForRSShutdownToStartAndFinish(MasterThread activeMaster, | |||
} | |||
log("Server [" + serverName + "] marked as dead, waiting for it to " + | |||
"finish dead processing"); | |||
while (!sm.isDeadServerSCPExecuted(serverName)) { | |||
log("Wait [" + serverName + "] SCP be executed"); | |||
Thread.sleep(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.
Please use UTIL.waitFor if possible. And Thread.sleep(1) will cause a lot of log messages?
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
Let's try it. |
🎊 +1 overall
This message was automatically generated. |
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
No description provided.