This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 7f577550e71 CAMEL-19497: prevent unhandled exceptions from blocking 
indefinitely
7f577550e71 is described below

commit 7f577550e71f9365f8c87badfc32d37eea9ef097
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Tue Jun 27 12:19:50 2023 +0200

    CAMEL-19497: prevent unhandled exceptions from blocking indefinitely
    
    This ensures that the done callback will be called (or, at least, tried to 
be called) in the case of unhandled exceptions (a few rare cases involving 
Throwables)
---
 .../java/org/apache/camel/component/bean/AbstractBeanProcessor.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-bean/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java
 
b/components/camel-bean/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java
index 70a0fc24bb7..f681f96c960 100644
--- 
a/components/camel-bean/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java
+++ 
b/components/camel-bean/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java
@@ -108,8 +108,10 @@ public abstract class AbstractBeanProcessor extends 
AsyncProcessorSupport {
                     target.process(exchange);
                 } catch (AssertionError | Exception e) {
                     exchange.setException(e);
+                } finally {
+                    callback.done(true);
                 }
-                callback.done(true);
+
                 return true;
             }
         }

Reply via email to