allthingssecurity commented on code in PR #30820:
URL: https://github.com/apache/camel/pull/30820#discussion_r4703707233


##########
components/camel-disruptor/src/main/java/org/apache/camel/component/disruptor/DisruptorReference.java:
##########
@@ -171,8 +171,29 @@ public void reconfigure() throws Exception {
 
     private void start() throws Exception {
         LOGGER.debug("Starting disruptor {}", this);
-        Disruptor<ExchangeEvent> newDisruptor = createDisruptor();
+        Disruptor<ExchangeEvent> newDisruptor = null;
+        try {
+            newDisruptor = createDisruptor();
+            startDisruptor(newDisruptor);
+        } catch (Exception | Error e) {
+            // the reference was cleared and marked as being reconfigured, so 
producers wait for the new Disruptor: mark
+            // it as not started instead, so they fail (as when no Disruptor 
was started) instead of waiting forever
+            disruptor.set(null, false);
+            // and do not run the event processors of this Disruptor later on 
the executor (the next start would
+            // hand them over with its own), nor keep running the ones already 
handed over
+            delayedExecutor.clear();
+            if (newDisruptor != null) {
+                newDisruptor.halt();
+            }
+            handlers = new LifecycleAwareExchangeEventHandler[0];
+            LOGGER.warn("Failed to start disruptor {}, producers fail until it 
is started again ({} buffered exchanges are"
+                        + " kept until then): {}",

Review Comment:
   Done in 71f6a53cbf42, using your wording. Log message only.



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