nandorKollar commented on code in PR #4616:
URL: https://github.com/apache/polaris/pull/4616#discussion_r3373588095


##########
runtime/service/src/main/java/org/apache/polaris/service/events/PolarisEventListeners.java:
##########
@@ -81,7 +86,23 @@ private void deliverEvent(
       PolarisEvent event, String listenerName, PolarisEventListener listener) {
     LOGGER.debug("Delivering {} event to listener '{}' ({})", event.type(), 
listenerName, listener);
     try {
-      listener.onEvent(event);
+      executor.execute(
+          () -> {
+            LOGGER.debug(
+                "Delivering {} event to listener '{}' ({})", event.type(), 
listenerName, listener);
+            try {
+              listener.onEvent(event);
+            } catch (Exception e) {
+              LOGGER.error(
+                  "Error while delivering {} event to listener '{}' ({})",
+                  event.type(),
+                  listenerName,
+                  listener,
+                  e);
+            }
+            LOGGER.debug(
+                "Delivered {} event to listener '{}' ({})", event.type(), 
listenerName, listener);
+          });

Review Comment:
   This is an interesting question: do we strictly require ordered delivery? In 
principle, the timestamps on the events should determine their order. However, 
it is possible for an AFTER event to be persisted in the database before the 
corresponding BEFORE event has been delivered. In such cases, the BEFORE event 
may still arrive and be processed at a later time.



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

Reply via email to