You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/06/14 07:35:43 UTC

[GitHub] [kafka] chia7712 opened a new pull request #10868: MINOR: make sure alterAclsPurgatory is closed when controller server …

chia7712 opened a new pull request #10868:
URL: https://github.com/apache/kafka/pull/10868


   The `alterAclsPurgatory` can get closed by kafka broker so Kraft should close it as well.
   
   related to #10550
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


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

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



[GitHub] [kafka] chia7712 commented on pull request #10868: MINOR: make sure alterAclsPurgatory is closed when controller server …

Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #10868:
URL: https://github.com/apache/kafka/pull/10868#issuecomment-873176227


   @ijuma I had added the unit test. Could you take a look?


-- 
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-unsubscribe@kafka.apache.org

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



[GitHub] [kafka] chia7712 commented on a change in pull request #10868: MINOR: make sure alterAclsPurgatory is closed when controller server …

Posted by GitBox <gi...@apache.org>.
chia7712 commented on a change in pull request #10868:
URL: https://github.com/apache/kafka/pull/10868#discussion_r663183197



##########
File path: core/src/main/scala/kafka/server/ControllerApis.scala
##########
@@ -74,7 +75,15 @@ class ControllerApis(val requestChannel: RequestChannel,
 
   val authHelper = new AuthHelper(authorizer)
   val requestHelper = new RequestHandlerHelper(requestChannel, quotas, time)
-  private val aclApis = new AclApis(authHelper, authorizer, requestHelper, "controller", config)
+  private[server] val aclApis = new AclApis(authHelper, authorizer, requestHelper, "controller", config)
+  private val _isClosed = new AtomicBoolean(false)
+
+  def isClosed: Boolean = _isClosed.get()
+
+  def close(): Unit = if (_isClosed.compareAndSet(false, true)) {

Review comment:
       make sure it gets closed only once. I'm fine to remove it if it is overkill :)




-- 
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-unsubscribe@kafka.apache.org

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



[GitHub] [kafka] ijuma commented on pull request #10868: MINOR: make sure alterAclsPurgatory is closed when controller server …

Posted by GitBox <gi...@apache.org>.
ijuma commented on pull request #10868:
URL: https://github.com/apache/kafka/pull/10868#issuecomment-881828358


   We should cherry-pick this to 3.0 please.


-- 
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-unsubscribe@kafka.apache.org

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



[GitHub] [kafka] chia7712 commented on pull request #10868: MINOR: make sure alterAclsPurgatory is closed when controller server …

Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #10868:
URL: https://github.com/apache/kafka/pull/10868#issuecomment-881828511


   > We should cherry-pick this to 3.0 please.
   
   will copy that


-- 
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-unsubscribe@kafka.apache.org

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



[GitHub] [kafka] chia7712 merged pull request #10868: MINOR: make sure alterAclsPurgatory is closed when controller server …

Posted by GitBox <gi...@apache.org>.
chia7712 merged pull request #10868:
URL: https://github.com/apache/kafka/pull/10868


   


-- 
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-unsubscribe@kafka.apache.org

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



[GitHub] [kafka] chia7712 commented on pull request #10868: MINOR: make sure alterAclsPurgatory is closed when controller server …

Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #10868:
URL: https://github.com/apache/kafka/pull/10868#issuecomment-881845530


   push to trunk and 3.0


-- 
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-unsubscribe@kafka.apache.org

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



[GitHub] [kafka] ijuma commented on a change in pull request #10868: MINOR: make sure alterAclsPurgatory is closed when controller server …

Posted by GitBox <gi...@apache.org>.
ijuma commented on a change in pull request #10868:
URL: https://github.com/apache/kafka/pull/10868#discussion_r663181788



##########
File path: core/src/main/scala/kafka/server/ControllerApis.scala
##########
@@ -74,7 +75,15 @@ class ControllerApis(val requestChannel: RequestChannel,
 
   val authHelper = new AuthHelper(authorizer)
   val requestHelper = new RequestHandlerHelper(requestChannel, quotas, time)
-  private val aclApis = new AclApis(authHelper, authorizer, requestHelper, "controller", config)
+  private[server] val aclApis = new AclApis(authHelper, authorizer, requestHelper, "controller", config)
+  private val _isClosed = new AtomicBoolean(false)
+
+  def isClosed: Boolean = _isClosed.get()
+
+  def close(): Unit = if (_isClosed.compareAndSet(false, true)) {

Review comment:
       Why do we need the compare and set here and the other class?




-- 
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-unsubscribe@kafka.apache.org

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



[GitHub] [kafka] chia7712 commented on pull request #10868: MINOR: make sure alterAclsPurgatory is closed when controller server …

Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #10868:
URL: https://github.com/apache/kafka/pull/10868#issuecomment-881814393


   `ConsumerBounceTest.testCloseDuringRebalance` is flaky on trunk so it is unrelated to this PR.


-- 
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-unsubscribe@kafka.apache.org

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



[GitHub] [kafka] chia7712 commented on a change in pull request #10868: MINOR: make sure alterAclsPurgatory is closed when controller server …

Posted by GitBox <gi...@apache.org>.
chia7712 commented on a change in pull request #10868:
URL: https://github.com/apache/kafka/pull/10868#discussion_r652311129



##########
File path: core/src/main/scala/kafka/server/ControllerServer.scala
##########
@@ -200,6 +200,8 @@ class ControllerServer(
         CoreUtils.swallow(controllerApisHandlerPool.shutdown(), this)
       if (quotaManagers != null)
         CoreUtils.swallow(quotaManagers.shutdown(), this)
+      if (controllerApis != null)
+        CoreUtils.swallow(controllerApis.close(), this)

Review comment:
       copy that.




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

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



[GitHub] [kafka] ijuma commented on a change in pull request #10868: MINOR: make sure alterAclsPurgatory is closed when controller server …

Posted by GitBox <gi...@apache.org>.
ijuma commented on a change in pull request #10868:
URL: https://github.com/apache/kafka/pull/10868#discussion_r667022227



##########
File path: core/src/main/scala/kafka/server/ControllerApis.scala
##########
@@ -74,7 +74,15 @@ class ControllerApis(val requestChannel: RequestChannel,
 
   val authHelper = new AuthHelper(authorizer)
   val requestHelper = new RequestHandlerHelper(requestChannel, quotas, time)
-  private val aclApis = new AclApis(authHelper, authorizer, requestHelper, "controller", config)
+  private[server] val aclApis = new AclApis(authHelper, authorizer, requestHelper, "controller", config)
+  private var _isClosed = false
+
+  def isClosed: Boolean = _isClosed

Review comment:
       Can this just return whether aclApis is closed?

##########
File path: core/src/main/scala/kafka/server/AclApis.scala
##########
@@ -48,10 +48,11 @@ class AclApis(authHelper: AuthHelper,
   this.logIdent = "[AclApis-%s-%s] ".format(name, config.nodeId)
   private val alterAclsPurgatory =
       new DelayedFuturePurgatory(purgatoryName = "AlterAcls", brokerId = config.nodeId)
+  private var _isClosed = false
 
-  def close(): Unit = {
-    alterAclsPurgatory.shutdown()
-  }
+  def isClosed: Boolean = _isClosed

Review comment:
       Can this just return whether `alterAclsPurgatory` is closed?




-- 
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-unsubscribe@kafka.apache.org

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



[GitHub] [kafka] ijuma commented on a change in pull request #10868: MINOR: make sure alterAclsPurgatory is closed when controller server …

Posted by GitBox <gi...@apache.org>.
ijuma commented on a change in pull request #10868:
URL: https://github.com/apache/kafka/pull/10868#discussion_r651011902



##########
File path: core/src/main/scala/kafka/server/ControllerServer.scala
##########
@@ -200,6 +200,8 @@ class ControllerServer(
         CoreUtils.swallow(controllerApisHandlerPool.shutdown(), this)
       if (quotaManagers != null)
         CoreUtils.swallow(quotaManagers.shutdown(), this)
+      if (controllerApis != null)
+        CoreUtils.swallow(controllerApis.close(), this)

Review comment:
       Shouldn't this be closed right after the controllerApisHandlerPool?




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

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



[GitHub] [kafka] chia7712 commented on pull request #10868: MINOR: make sure alterAclsPurgatory is closed when controller server …

Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #10868:
URL: https://github.com/apache/kafka/pull/10868#issuecomment-860194115


   @rondagostino FYI


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

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