You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by "junkaixue (via GitHub)" <gi...@apache.org> on 2023/07/27 19:50:32 UTC
[GitHub] [helix] junkaixue commented on a diff in pull request #2579: Lattice Puppy Stress Test Race Condition Fix and Code Cleanup
junkaixue commented on code in PR #2579:
URL: https://github.com/apache/helix/pull/2579#discussion_r1276755115
##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/AbstractPuppy.java:
##########
@@ -55,30 +55,23 @@ public AbstractPuppy(MetaClientInterface<String> metaclient, PuppySpec puppySpec
@Override
public void run() {
try {
- while (true) {
+ while (!Thread.currentThread().isInterrupted()) {
Review Comment:
Was this main thread set daemon? If yes, we don't have check the interrupted here.
##########
meta-client/src/test/java/org/apache/helix/metaclient/impl/zk/TestMultiThreadStressTest/TestMultiThreadStressZKClient.java:
##########
@@ -217,13 +225,13 @@ public void testComplexParentListenerPuppy() {
AtomicInteger globalChildChangeCounter = new AtomicInteger();
ChildChangeListener childChangeListener = (changedPath, changeType) -> {
globalChildChangeCounter.addAndGet(1);
- System.out.println("-------------- Child change detected: " + changeType + " at path: " + changedPath + " number of changes: " + globalChildChangeCounter.get());
+ System.out.println("-------------- Child change detected: " + changeType
+ + " at path: " + changedPath + " number of changes: " + globalChildChangeCounter.get());
};
-
-
_zkMetaClient.subscribeChildChanges(zkParentKey, childChangeListener, false);
- PuppySpec puppySpec = new PuppySpec(PuppyMode.REPEAT, 0.2f, new ExecDelay(5000, 0.1f), 5);
+ PuppySpec puppySpec = new PuppySpec(PuppyMode.REPEAT, 0.2f,
+ new ExecDelay(5000, 0.1f), 5);
Review Comment:
NIT: would suggest to have style, refactor based PR a separate one. It can distract the review from core logic.
--
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