mgao0 commented on code in PR #2219:
URL: https://github.com/apache/helix/pull/2219#discussion_r975900454


##########
zookeeper-api/src/test/java/org/apache/helix/zookeeper/impl/client/TestRawZkClient.java:
##########
@@ -1063,23 +1063,29 @@ public void testAsyncWriteByExpectedSession() throws 
Exception {
    * Tests getChildren() when there are an excessive number of children and 
connection loss happens,
    * the operation should terminate and exit retry loop.
    */
-  @Test(timeOut = 30 * 1000L)
+  @Test
   public void testGetChildrenOnLargeNumChildren() throws Exception {
     final String methodName = TestHelper.getTestMethodName();
     System.out.println("Start test: " + methodName);
     // Create 110K children to make packet length of children exceed 4 MB
     // and cause connection loss for getChildren() operation
     String path = "/" + methodName;
+    int numOps = 110;
+    int numOpInOps = 1000;
+    // All the paths that are going to be created as children nodes, plus one 
parent node
+    // Record paths so can be deleted at the end of the test
+    String[] nodePaths = new String[numOps * numOpInOps + 1];
+    nodePaths[numOps * numOpInOps] = path;
 
     _zkClient.createPersistent(path);
 
-    for (int i = 0; i < 110; i++) {
-      List<Op> ops = new ArrayList<>(1000);
-      for (int j = 0; j < 1000; j++) {
+    for (int i = 0; i < numOps; i++) {
+      List<Op> ops = new ArrayList<>(numOpInOps);
+      for (int j = 0; j < numOpInOps; j++) {
         String childPath = path + "/" + UUID.randomUUID().toString();
-        // Create ephemeral nodes so closing zkClient deletes them for cleanup
+        nodePaths[numOpInOps * i + j] = childPath;
         ops.add(
-            Op.create(childPath, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, 
CreateMode.EPHEMERAL));
+            Op.create(childPath, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, 
CreateMode.PERSISTENT));

Review Comment:
   Thanks for the questions. Bottom line is that we should limit the number of 
ephemeral nodes that someone can create in one session. You were working with 
ephemeral nodes throttling before so you might also have some context.
   1. It worked before because the before bump up, it doesn't need to read 
transaction log. Please see my 2nd point. It is not necessarily about jute max 
buffer. But if jute max buffer is large enough (>9MB) this test will pass 
without changing the test because it won't fail when reading transaction log.
   2. I updated the description with a more specific commit. You can see that 
in 3.6.0 it added a zookeeper server shutdown mode which is non-fullyshutdown. 
And it will require a fastForwardDataBase in order to do this kind of shutdown. 
The error occurred when reading the transaction log during fastForwardDataBase. 
Before 3.6.0, zookeeper shutdown is just clear the zk database.



-- 
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]

Reply via email to