You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "bowenliang123 (via GitHub)" <gi...@apache.org> on 2023/04/27 06:25:59 UTC

[GitHub] [kyuubi] bowenliang123 commented on a diff in pull request #4777: Make EventHandler auto-closeable and de-register all event handlers when stopping server

bowenliang123 commented on code in PR #4777:
URL: https://github.com/apache/kyuubi/pull/4777#discussion_r1178678022


##########
kyuubi-events/src/main/scala/org/apache/kyuubi/events/EventBus.scala:
##########
@@ -68,6 +70,10 @@ object EventBus extends Logging {
   def registerAsync[T <: KyuubiEvent: ClassTag](et: EventHandler[T]): EventBus =
     defaultEventBus.registerAsync[T](et)
 
+  def deregisterAll(): Unit = {
+    defaultEventBus.deregisterAll()

Review Comment:
   Which one are you suggesting? Synchronized on the object of EventBus instance or on the defaultEventBus instance?
   
   ```
   def deregisterAll(): Unit = synchronized {
   ```
   or
   ```
   def deregisterAll(): Unit = defaultEventBus.synchronized {
   ```



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org