You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by "desaikomal (via GitHub)" <gi...@apache.org> on 2023/07/27 14:09:42 UTC
[GitHub] [helix] desaikomal commented on a diff in pull request #2579: Lattice Puppy Stress Test Race Condition Fix and Code Cleanup
desaikomal commented on code in PR #2579:
URL: https://github.com/apache/helix/pull/2579#discussion_r1276338468
##########
meta-client/src/test/java/org/apache/helix/metaclient/impl/zk/TestMultiThreadStressTest/UpdatePuppy.java:
##########
@@ -64,7 +64,6 @@ protected void bark() throws Exception {
@Override
protected void cleanup() {
Review Comment:
just wondering, where will you be deleting recurively? as I don't see that in this change being called.
##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/AbstractPuppy.java:
##########
@@ -55,27 +55,18 @@ public AbstractPuppy(MetaClientInterface<String> metaclient, PuppySpec puppySpec
@Override
public void run() {
try {
- while (true) {
+ while (!Thread.currentThread().isInterrupted()) {
try {
+ Thread.sleep(getPuppySpec().getExecDelay().getNextDelay());
bark();
+ } catch (InterruptedException e) {
+ break;
} catch (Exception e) {
incrementUnhandledErrorCounter();
e.printStackTrace();
}
-
- if (getPuppySpec().getMode() == PuppyMode.ONE_OFF) {
- cleanup();
- break;
- } else {
- try {
- Thread.sleep(getPuppySpec().getExecDelay().getNextDelay());
- } catch (InterruptedException e) {
- cleanup();
- break;
- // Handle interruption if necessary
- }
- }
}
+ cleanup();
Review Comment:
just wondering, do you want to add 'finally' and make sure that cleanup() is executed in every code path properly?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org