You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/09/14 08:28:42 UTC

[GitHub] [pulsar] lhotari commented on a diff in pull request #17638: [fix][metadata] Handle session events in a separate thread

lhotari commented on code in PR #17638:
URL: https://github.com/apache/pulsar/pull/17638#discussion_r970490001


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/AbstractMetadataStore.java:
##########
@@ -409,14 +409,19 @@ public void registerSessionListener(Consumer<SessionEvent> listener) {
 
     protected void receivedSessionEvent(SessionEvent event) {
         isConnected = event.isConnected();
-
-        sessionListeners.forEach(l -> {
-            try {
-                l.accept(event);
-            } catch (Throwable t) {
-                log.warn("Error in processing session event", t);
-            }
-        });
+        try {
+            executor.execute(() -> {

Review Comment:
   Good point. However, in AbstractMetadataStore, the other notifications are delivered using a separate thread pool: https://github.com/apache/pulsar/blob/d8c39bcb5becd15944978755c0b02fc52182fa69/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/AbstractMetadataStore.java#L273-L289
   This PR makes AbstractMetadataStore more consistent by also delivering session events using this same thread pool.



-- 
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: commits-unsubscribe@pulsar.apache.org

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