You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Peter Klotz <pe...@blue-elephant-systems.com> on 2006/08/18 20:21:40 UTC

hangs in sendSync()

Hi,

we use servicemix snapshot from 10.8.

we I understand that correctly when one does e.g. in a DefaultServiceMixClient
or ComponentSupport class a sendSync one of the components in the configured
pipeline of components has to either do a send() or fail().

We had the case that a EIPEndpoint subclass (own impl) threw a exception and
that leaded to the sendSync to hang forever. Could it be that SM does not handle
a exception in a endpoint such that the ME is rolled back and a sendSync would
return? Is it the complete responsibility of the component to ensure that no
exception is thrown before a send or fail is done or in the case of the
EIPEndpoint that a target is determined?

We have the strange behaviour that we can get the complete servicemix to hang in
a sendSync, not only one thread or so. After such a hand one cannot send any
request to a http EP anymore.

We get a message in the logfile like this

DEBUG - 2006-08-18 20:12:38,177 | DeliveryChannelImpl.waitForExchange(704) |
Waiting for exchange ID:sequoia-35369-1155918239431-56:24 (679e87) to be
answered in DeliveryChannel{ID:sequoia-35367-1155918238528-0:24} from sendSync

the client that sent the ME and all new clients that use the same pipeline are
now hanging. If we use a sendSync with 2nd param timeout it times out after that
time.

We have checked that all our components catch all exceptions and first do a fail
 then throw a MessagingException or do the send() if no problem occurs.
How does SM handle a MessagingException in a component, a EIP endpoint etc.
regarding finishing a ME that was initiated from sendSync()?


Thanks, Peter


Re: hangs in sendSync()

Posted by Guillaume Nodet <gn...@gmail.com>.
All JBI exchanges have to be terminated by either a DONE or an ERROR,
even InOnly exchanges.

On 8/21/06, Peter Klotz <pe...@blue-elephant-systems.com> wrote:
> Hi Guillaume,
>
> when I have a sendSync() with a InOut ME to some component and in the pipepeline
> there is a WireTap. We have looked in the source code and saw that sometimes it
> seems that WT does do a sendSync to the listener?
>
>
> sendSync() -----> W T ----->
>                    |
>                    |
>                    v
>               listener
>            onMessageExchange()
>
>
> Does the listener have to answer anything to the InOnly exchange that it
> receives from WT such as a done()? My assumption would be no?
> According to my understanding it would not work to make a sendSync() with a
> InOnly exchange because normally no response would be send back?
>
>
> Peter
>
>


-- 
Cheers,
Guillaume Nodet

Re: hangs in sendSync()

Posted by Peter Klotz <pe...@blue-elephant-systems.com>.
Hi Guillaume,

when I have a sendSync() with a InOut ME to some component and in the pipepeline
there is a WireTap. We have looked in the source code and saw that sometimes it
seems that WT does do a sendSync to the listener?


sendSync() -----> W T ----->
                   |
                   |
                   v
              listener
           onMessageExchange()


Does the listener have to answer anything to the InOnly exchange that it
receives from WT such as a done()? My assumption would be no?
According to my understanding it would not work to make a sendSync() with a
InOnly exchange because normally no response would be send back?


Peter

Re: hangs in sendSync()

Posted by Guillaume Nodet <gn...@gmail.com>.
The short answer is that the component is responsible for catching
any exceptions and setting the exchange status to ERROR.

When the component implements MessageExchangeListener and throws
an exception, the behavior depends on the flow used, but only the ST
flow will be able to send it back to the consumer.

I do not exclude bugs in components on exception handling.
Especially if the exception thrown is an Error (and not an Exception)
or if you use transactions.  In any cases, the exception should be logged.

I think there is room for improvement on exception handling, so if you
have any suggestion ...

Also, for your particular case, do you have a reproducible test case
I could use to debug the problem ?

The only reason i can think about for the whole ServiceMix to hang is
a thread pool exhaustion.

On 8/18/06, Peter Klotz <pe...@blue-elephant-systems.com> wrote:
> Hi,
>
> we use servicemix snapshot from 10.8.
>
> we I understand that correctly when one does e.g. in a DefaultServiceMixClient
> or ComponentSupport class a sendSync one of the components in the configured
> pipeline of components has to either do a send() or fail().
>
> We had the case that a EIPEndpoint subclass (own impl) threw a exception and
> that leaded to the sendSync to hang forever. Could it be that SM does not handle
> a exception in a endpoint such that the ME is rolled back and a sendSync would
> return? Is it the complete responsibility of the component to ensure that no
> exception is thrown before a send or fail is done or in the case of the
> EIPEndpoint that a target is determined?
>
> We have the strange behaviour that we can get the complete servicemix to hang in
> a sendSync, not only one thread or so. After such a hand one cannot send any
> request to a http EP anymore.
>
> We get a message in the logfile like this
>
> DEBUG - 2006-08-18 20:12:38,177 | DeliveryChannelImpl.waitForExchange(704) |
> Waiting for exchange ID:sequoia-35369-1155918239431-56:24 (679e87) to be
> answered in DeliveryChannel{ID:sequoia-35367-1155918238528-0:24} from sendSync
>
> the client that sent the ME and all new clients that use the same pipeline are
> now hanging. If we use a sendSync with 2nd param timeout it times out after that
> time.
>
> We have checked that all our components catch all exceptions and first do a fail
>  then throw a MessagingException or do the send() if no problem occurs.
> How does SM handle a MessagingException in a component, a EIP endpoint etc.
> regarding finishing a ME that was initiated from sendSync()?
>
>
> Thanks, Peter
>
>
>


-- 
Cheers,
Guillaume Nodet