Hi,
I am currently trying to get practical experience regarding Load Balancing (LB) and Fault Tolerance (FT) in Ice. There are some problems/questions I have got and would appreciate if somebody could provide some help or suggestions.
The first problem is related to FT: I have three instances of the simple server (just one interface with one method) running simultaneously with endpoints configured for local host and three different ports (10000 – 10003). Here is one of three configuration file records:
TEST.Endpoints=tcp -p 10000
There is also client application which creates proxy with multiple endpoints configured as following:
TESTProcessor.Proxy=TESTProcessor:tcp -p 10000:tcp -p 10001:tcp -p 10002
What I want to test is the case where client periodically calls the server and then server is “crashed” (simply press Ctrl-C) and the communication should continue with the next available server. If I am doing it with twoway proxy everything works exactly as expected. But if I am using oneway calls instead, when server is gone, the client breaks also giving the following error message:
ConnectionI.cpp:1993: Ice::CloseConnectionException:
protocol error: connection closed
instead of switching to the next server as in twoway case.
The following is the code fragment which illustrates the way I am creating corresponding proxies (actually copy/pasted from one of the examples):
Ice::ObjectPrx base = communicator->stringToProxy(proxy);
TEST::TestProcessorPrx twoway =
TEST::TestProcessorPrx::checkedCast(base->ice_twoway()->ice_timeout(-1)->ice_secure(false));
TEST::TestProcessorPrx oneway =
TEST::TestProcessorPrx::uncheckedCast(twoway->ice_oneway());
Am I doing something wrong or there is a bug related to oneways? Or is it expected behavior? If yes, what is the motivation behind it?
The second problem with this scenario is regarding LB. I’ve read in this forum that if there are multiple endpoints specified, Ice will pick up randomly one and try to use it for communication with server. However in the scenario I described above, the client(s) always pick the second one. It is also the case if I am trying to run multiple clients simultaneously – they all start talking with the second server. As a result, there is no LB functionality. So my questions is whether I misunderstand something here or is it a bug?
Thank you,
Andrey.

Reply With Quote
