oscerd opened a new pull request, #28865:
URL: https://github.com/apache/camel/pull/28865

   ### Problem
   
   A synchronous `camel-mina` producer (`sync=true`) keeps a single response 
handler and a single
   response latch per producer, and a synchronous producer is non-singleton, so 
it is returned to the
   producer pool and reused by later exchanges. When a request timed out while 
waiting for a reply, the
   producer closed its session only if `disconnectOnNoReply=true` (the 
default). With
   `disconnectOnNoReply=false`, the timed-out session stayed open and was 
reused by the next exchange on
   the same producer. A reply that the remote peer sent late for the timed-out 
exchange could then arrive
   on that reused session and be handed to the next exchange as its own result.
   
   ### Change
   
   `MinaProducer.maybeDisconnectOnTimeout()` now always closes the producer 
session on a timeout,
   regardless of `disconnectOnNoReply`. A session whose peer still owes a reply 
is therefore never
   reused: the next exchange opens a fresh session and receives only its own 
reply. The default behaviour
   is unchanged, because the default already closed the session on a timeout. 
`disconnectOnNoReply`
   governs the consumer and is no longer consulted by the producer.
   
   An upgrade note is added to `camel-4x-upgrade-guide-4_24.adoc`, because a 
route that sets
   `disconnectOnNoReply=false` will now see the producer session closed on a 
timeout where it previously
   stayed open.
   
   ### Tests
   
   `MinaDisconnectOnTimeOutTest` is updated: the case that previously asserted 
the second request received
   the first request's reply now asserts the second request receives its own 
reply, even with
   `disconnectOnNoReply=false`. The test fails on the code before this change 
(the second request returns
   the first request's reply) and passes after it. The full `camel-mina` test 
suite passes.
   
   _Claude Code on behalf of oscerd_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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