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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]