chia7712 commented on code in PR #15838:
URL: https://github.com/apache/kafka/pull/15838#discussion_r1585911858


##########
core/src/test/scala/integration/kafka/server/KRaftClusterTest.scala:
##########
@@ -1541,6 +1541,36 @@ class KRaftClusterTest {
       cluster.close()
     }
   }
+
+  @Test
+  def testReduceNumNetworkThreads(): Unit = {
+    val cluster = new KafkaClusterTestKit.Builder(
+      new TestKitNodes.Builder().
+        setNumBrokerNodes(1).
+        setNumControllerNodes(1).build()).
+      setConfigProp(KafkaConfig.NumNetworkThreadsProp, "4").
+      build()
+    try {
+      cluster.format()
+      cluster.startup()
+      cluster.waitForReadyBrokers()
+      val admin = Admin.create(cluster.clientProperties())
+      try {
+        admin.incrementalAlterConfigs(
+          Collections.singletonMap(new ConfigResource(Type.BROKER, ""),
+            Collections.singletonList(new AlterConfigOp(
+              new ConfigEntry(KafkaConfig.NumNetworkThreadsProp, "2"), 
OpType.SET)))).all().get()
+        val newTopic = Collections.singletonList(new NewTopic("test-topic", 1, 
1.toShort))
+        val createTopicResult = admin.createTopics(newTopic)
+        createTopicResult.all().get()

Review Comment:
   It seems reducing the network threads causes the disconnection and it 
produces the retry of request forward. Hence, that can make this test unstable. 
Maybe we can increase the network threads instead?



##########
core/src/main/scala/kafka/server/DynamicBrokerConfig.scala:
##########
@@ -303,17 +303,17 @@ class DynamicBrokerConfig(private val kafkaConfig: 
KafkaConfig) extends Logging
     addBrokerReconfigurable(controller.socketServer)
   }
 
-  def addReconfigurable(reconfigurable: Reconfigurable): Unit = 
CoreUtils.inWriteLock(lock) {
+  def addReconfigurable(reconfigurable: Reconfigurable): Unit = {
     verifyReconfigurableConfigs(reconfigurable.reconfigurableConfigs.asScala)

Review Comment:
   It seems `verifyReconfigurableConfigs` does not need lock also, since it 
just check the input strings.



##########
core/src/test/scala/integration/kafka/server/KRaftClusterTest.scala:
##########
@@ -1541,6 +1541,36 @@ class KRaftClusterTest {
       cluster.close()
     }
   }
+
+  @Test
+  def testReduceNumNetworkThreads(): Unit = {

Review Comment:
   Pardon me, is this test case related to deadlock?



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to