gnodet commented on code in PR #2939:
URL: https://github.com/apache/cxf/pull/2939#discussion_r2913554368


##########
core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java:
##########
@@ -511,11 +511,13 @@ public void onMessage(Message message) {
                             if (message.getContent(Exception.class) == null) {
                                 // handle the right response
                                 Message inMsg = 
message.getExchange().getInMessage();
-                                Map<String, Object> ctx = 
responseContext.get(Thread.currentThread());
-                                List<Object> resList = 
CastUtils.cast(inMsg.getContent(List.class));
-                                Object[] result = resList == null ? null : 
resList.toArray();
-                                callback.handleResponse(ctx, result);
-                                return;
+                                if (inMsg != null) {

Review Comment:
   You're right, the primary fix is in 
`FailoverTargetSelector.performFailover()` — the catch block was conditionally 
restoring the exceptions, but they had already been unconditionally cleared 
before the retry (lines 198 and 202), so the conditions were always false.
   
   The fix makes the restoration unconditional. The `inMsg` null check in 
`ClientImpl` is just a defensive guard since `exchange.clear()` is called 
during failover — happy to drop it if you'd prefer to keep it clean.



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