You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Hubert, Eric" <Er...@foxmobile.com> on 2009/03/12 23:18:56 UTC

Problem with empty load balance groups

Hi all,

Today I stumbled over an issue with a misconfiguration in synapse.xml.

A loadbalancing group did not contain any endpoints.

Currently this case is not handled in the code very nicely.
If the send mediator is used with the load balancing group, the client
does not get a response and blocks until the client-side timeout is
reached.

What happens inside Synapse? At startup the empty loadbalance group is
not detected, but as a consequence the loadbalancing algorithm is not
set inside the LoadbalancingEndpoint. During the execution of the send
method getNextChild() unconditionally accesses the uninitialized
algorithm member which causes an NPE which is flying through the layers
and breaks the mediation chain.

Obviously this is not the correct behaviour. I could work on a patch
fixing the problem, but would like to discuss the correct behaviour in
advance. 

Two solutions would be acceptable to me:
a) The ESB does not start if a load balancing group is empty and output
the name(s) of the empty laodbalance groups. This approach might cause
compatibility issues with existing (mis)configurations. Also unused
configuration parts would cause Synapse not to start. On the other hand
this is "fail fast" and if we would have a schema, this configuration
would probably be disallowed.

b) At runtime the problem is detected and a fault is sent to the client
indicating that no member of a loadbalancing group are available.

Do you have other solutions in mind? What solution do you prefer?

Regards,
  Eric


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


RE: Problem with empty load balance groups

Posted by "Hubert, Eric" <Er...@foxmobile.com>.
> > Two solutions would be acceptable to me:
> > a) The ESB does not start if a load balancing group is empty and output
> > the name(s) of the empty laodbalance groups. This approach might cause
> > compatibility issues with existing (mis)configurations. Also unused
> > configuration parts would cause Synapse not to start. On the other hand
> > this is "fail fast" and if we would have a schema, this configuration
> > would probably be disallowed.
> >
> > b) At runtime the problem is detected and a fault is sent to the client
> > indicating that no member of a loadbalancing group are available.
> >
> > Do you have other solutions in mind? What solution do you prefer?
> >
> I would certainly prefer option "A".. it would be easier to implement
> and also better in dealing with the issue than at runtime.


Ok, I will go this road. If you currently set log4j level to debug for synapse core, you already have this behaviour - even though surely not intended. ;-) NPE during debug output in LoadbalanceEndpoint.setAlgorithm()

Regards,
   Eric

Re: Problem with empty load balance groups

Posted by "Asankha C. Perera" <as...@apache.org>.
Hi Eric
> Today I stumbled over an issue with a misconfiguration in synapse.xml.
> A loadbalancing group did not contain any endpoints.
> .....
> Two solutions would be acceptable to me:
> a) The ESB does not start if a load balancing group is empty and output
> the name(s) of the empty laodbalance groups. This approach might cause
> compatibility issues with existing (mis)configurations. Also unused
> configuration parts would cause Synapse not to start. On the other hand
> this is "fail fast" and if we would have a schema, this configuration
> would probably be disallowed.
>
> b) At runtime the problem is detected and a fault is sent to the client
> indicating that no member of a loadbalancing group are available.
>
> Do you have other solutions in mind? What solution do you prefer?
>   
I would certainly prefer option "A".. it would be easier to implement 
and also better in dealing with the issue than at runtime.

cheers
asankha

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org