Arsnael commented on code in PR #2903:
URL: https://github.com/apache/james-project/pull/2903#discussion_r2670685678


##########
event-bus/distributed/src/main/java/org/apache/james/events/GroupRegistration.java:
##########
@@ -186,19 +186,15 @@ Mono<Void> reDeliver(Event event) {
     }
 
     private Mono<Void> runListener(Event event) {
-        return listenerExecutor.execute(
-            listener,
-            MDCBuilder.create()
-                .addToContext(EventBus.StructuredLoggingFields.GROUP, 
group.asString()),
-            event);
+        MDCBuilder mdc = 
MDCBuilder.create().addToContext(EventBus.StructuredLoggingFields.GROUP, 
group.asString());
+        Mono<Void> result = listenerExecutor.execute(listener, mdc, event);
+        return 
configurations.eventBusConfiguration().executionTimeout().map(result::timeout).orElse(result);
     }
 
     private Mono<Void> runListener(List<Event> events) {
-        return listenerExecutor.execute(
-            listener,
-            MDCBuilder.create()
-                .addToContext(EventBus.StructuredLoggingFields.GROUP, 
group.asString()),
-            events);
+        MDCBuilder mdc = 
MDCBuilder.create().addToContext(EventBus.StructuredLoggingFields.GROUP, 
group.asString());
+        Mono<Void> result = listenerExecutor.execute(listener, mdc, events);
+        return 
configurations.eventBusConfiguration().executionTimeout().map(result::timeout).orElse(result);

Review Comment:
   There is default timeout actually defined in the Mono returned by 
listenerExecutor.execute
   
   So is this overriding the existing timeout? 



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to