Discussion:
[omniORB] Asymmetrical Comm_failure
Aida Fátima Cano
2007-02-20 18:51:37 UTC
Permalink
Hello

I have two proccess working each one as server of the other one.

Normally, both of them can access each other, but if I start process A when
its TCP connection is not working (I dissconnect it on porpouse to probe its
behaivour) Process A gets the services of proccess B, but Process B doesn't
get the services of A.

If I disconnect the TCP connection of the PC in which proccess B runs, both
of them can get the services of the other.

Is there some way to know if proccess A is not offering its services or if
process B is not getting the reference? I have estructure the code in both
of them in the same way, so I don't know why the result is different if I
disconnect one or the other.

In omninames log, it is the process B the one who gets a COMM_FAILURE when
calling an A service, and A its getting B services at the same time without
exceptions.


Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070220/6be60f90/attachment.htm
JHJE (Jan Holst Jensen)
2007-02-20 19:20:50 UTC
Permalink
Post by Aida Fátima Cano
I have two proccess working each one as server of the other one.
Normally, both of them can access each other, but if I start
process A when its TCP connection is not working (I
dissconnect it on porpouse to probe its behaivour) Process A
gets the services of proccess B, but Process B doesn't get
the services of A.
If I disconnect the TCP connection of the PC in which
proccess B runs, both of them can get the services of the other.
Sorry, I don't get this. You have process A running on one PC and process B running on a second PC, right ?
Post by Aida Fátima Cano
In omninames log, it is the process B the one who gets a
COMM_FAILURE when calling an A service, and A its getting B
services at the same time without exceptions.
How can that be possible ? If you don't have a network connection between A and B, how can A access B's services ? Are you sure that A is connected to B and not to itself ? Perhaps you provided the same service reference/IOR (namely A's) to both process A and B ?

Cheers
-- Jan Holst Jensen, Novo Nordisk A/S, Denmark
Carlos
2007-02-20 21:25:25 UTC
Permalink
Post by Aida Fátima Cano
Hello
I have two proccess working each one as server of the other one.
Normally, both of them can access each other, but if I start process A
when its TCP connection is not working (I dissconnect it on porpouse
to probe its behaivour) Process A gets the services of proccess B, but
Process B doesn't get the services of A.
If I disconnect the TCP connection of the PC in which proccess B runs,
both of them can get the services of the other.
Is there some way to know if proccess A is not offering its services
or if process B is not getting the reference? I have estructure the
code in both of them in the same way, so I don't know why the result
is different if I disconnect one or the other.
In omninames log, it is the process B the one who gets a COMM_FAILURE
when calling an A service, and A its getting B services at the same
time without exceptions.
Can you explain us what is "disconnect the TCP connection", i.e. if you
shutdown the card or if you put off the wire...?

And can you send us the output of ifconfig and route?

Cheers.

Carlos.
Post by Aida Fátima Cano
Thanks
_______________________________________________
omniORB-list mailing list
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
Aida Fátima Cano
2007-02-21 01:46:21 UTC
Permalink
Sorry, I'll explain it better:

Each process is running in one PC, and each one have a different name in
omninames.

To disconnect TCP connection I use the windows acces to "network
connection", and the "deactivate" option.

So, the process is the following:

I start omninames service and process B (in the same PC normally, but I have
prove running omninames in a third PC too). (In this PC, TCP communications
are available).

Then, discconect the network card of PC A, and start process A. This
process, every 3 seconds test its TCP conection trying to ping the IP where
omninames is running. If the test success (when I reconnect the network
card), creates a thread that goes into orb->run(), and (in another thread)
poll the process B.

If the poll reachs process B, in the GUI of process B a green image is
shown. Else, the image is red.

Process B, when the image turns green, send a message to process A. The
methos are different, so I know neither A nor B are connectet to itself.

The case is, the image in B turns green, but when trying to send the request
message, process B goes into the catch statement

And what is incomprehensible to me is that if I run process A with its
network card active from the beginning, and process B with it disconnect and
some time later I connect it (this process checks TCP connections in the
same way B does, and also create the thread which attends client incoming
request), the image turn to green and the message gets B

Finally, if the two PC have their network cards active, everything works.

And about outputthe output of ifconfig and route, how can I get it?

Thank you so much.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070220/8b615590/attachment.htm
Jeffrey Coffman
2007-02-21 03:31:21 UTC
Permalink
Hello,

I'm working on an implementation of trading service using omniorb. I'm at the point where i want to start-up my trading service and use the corbaloc mechanism in the omniorb config file to resolve the initial reference.

I've never used corbaloc before this before so I'm hoping someone can give me some pointers.

I assume that if I want to use the corbaloc for my trading service I can set the orb end point when i start my service up to be whatever port I choose to listen to. I'm a little confused on the object key, is there a way to start my server so that it uses the same object key every time? I know some other orbs allow you to pass a key parameter to them, how do i go about doing this using omniorb.

Thanks,

Jeff Coffman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070220/d2435008/attachment.htm
BaileyK at schneider.com ()
2007-02-21 03:49:09 UTC
Permalink
See the section 6.5 in the user guide.

http://omniorb.sourceforge.net/omni41/omniORB/omniORB006.html#toc34

You need to use the omniINSPOA for the initial reference.

---
Kendall Bailey
Engineering & Research
Schneider National, Inc.




Jeffrey Coffman
<***@yahoo
.com> To
Sent by: omniorb-***@omniorb-support.com
omniorb-list-boun cc
***@omniorb-suppo
rt.com Subject
[omniORB] corbaloc and trading
service
02/20/2007 03:30
PM


Please respond to
***@yahoo.
com






Hello,

I'm working on an implementation of trading service using omniorb. I'm at
the point where i want to start-up my trading service and use the corbaloc
mechanism in the omniorb config file to resolve the initial reference.

I've never used corbaloc before this before so I'm hoping someone can give
me some pointers.

I assume that if I want to use the corbaloc for my trading service I can
set the orb end point when i start my service up to be whatever port I
choose to listen to. I'm a little confused on the object key, is there a
way to start my server so that it uses the same object key every time? I
know some other orbs allow you to pass a key parameter to them, how do i go
about doing this using omniorb.

Thanks,

Jeff Coffman_______________________________________________
JHJE (Jan Holst Jensen)
2007-02-21 15:55:32 UTC
Permalink
Post by Aida Fátima Cano
I start omninames service and process B (in the same PC
normally, but I have prove running omninames in a third PC
too). (In this PC, TCP communications are available).
Then, discconect the network card of PC A, and start process
A. This process, every 3 seconds test its TCP conection
trying to ping the IP where omninames is running. If the test
success (when I reconnect the network card), creates a thread
that goes into orb->run(), and (in another thread) poll the process B.
If the poll reachs process B, in the GUI of process B a green
image is shown. Else, the image is red.
Process B, when the image turns green, send a message to
process A. The methos are different, so I know neither A nor
B are connectet to itself.
OK. As I have understood it:

omniNames and process B are running constantly on a PC where the network is always up.

Process A is started on another PC where the network is initially down; process A initializes the orb; waits for the network to come up; looks up B's service in the naming service; invokes a method in B's service; when B receives request from A it calls a service in A.
Post by Aida Fátima Cano
The case is, the image in B turns green, but when trying to
send the request message, process B goes into the catch statement
I assume that when process A calls the service in B, it passses in an object reference to a servant in process A, right ? Have a look at that object reference - I think that you will see that the object reference contains an IP address which is localhost.

This is because when you started up process A I assume that you initialized the orb before you begin checking for the presence of the network (I am just guessing here, since I haven't seen your code). To the best of my knowledge the orb uses the localhost loopback address as default endpoint when there is no network. Thus all object references to services in process A will contain localhost as the machine IP address. When process B tries to call the service running in process A the call will fail since the object reference points to something running on localhost.
Post by Aida Fátima Cano
And what is incomprehensible to me is that if I run process A
with its network card active from the beginning, and process
B with it disconnect and some time later I connect it (this
process checks TCP connections in the same way B does, and
also create the thread which attends client incoming
request), the image turn to green and the message gets B
The orb initializes with an endpoint visible to others when the network is up. Thus the reference you pass to B (or registers in the naming service) correctly points to the machine where process A is running.

Either have a look at the object reference passed to B or take a look the trace file of process A (run process A with -ORBtraceLevel 20 or so). You should see that the endpoint of the orb differs in the two cases: no network on startup, and network active on startup. Look for the lines in the start of the trace where omniORB lists the addresses that it has:

omniORB: My addresses are:

If my guesses are correct the problem should be avoidable by either setting a static IP address of the machine containing process A (the machine address is then visible to the orb even when the network is down) or defer initializing the orb until you have made sure that the network is up.

Cheers
-- Jan Holst Jensen, Novo Nordisk A/S, Denmark
Aida Fátima Cano
2007-02-21 16:33:48 UTC
Permalink
Post by JHJE (Jan Holst Jensen)
Post by Aida Fátima Cano
Then, discconect the network card of PC A, and start process
A. This process, every 3 seconds test its TCP conection
trying to ping the IP where omninames is running. If the test
success (when I reconnect the network card), creates a thread
that goes into orb->run(), and (in another thread) poll the process B.
I assume that when process A calls the service in B, it passses in an
object reference to a servant in process A, right ? Have a look at that
object reference - I think that you will see that the object reference
contains an IP address which is localhost.
This is because when you started up process A I assume that you initialized
Post by JHJE (Jan Holst Jensen)
the orb before you begin checking for the presence of the network
Firstly I did what you said, but then I saw the local reference so I change
it. I've only start the thread that goes into orb-run() if I have TCP
connection and if the PC in which omninames are running is reachable. It is
what I meant when I said "if the test success".
Post by JHJE (Jan Holst Jensen)
If my guesses are correct the problem should be avoidable by either setting
a static IP address of the machine >containing process A (the machine
address is then visible to the orb even when the network is down)

Every PC I use have static IP (only one network card, and only one IP).

Each time I discconect and connect the network while the process are running
the port used is different, but I think this have no importance, right

Is there some way to me of seeing what's happening since proccess A invoques
a method of process B until it reachs the code implementation in proccess B?
I have look the ORB traces, but I don't really understand it.

The code to do this is:
For process A
if(ping.Ping("192.168.2.114"))
{
hThreadCorba = CreateThread (NULL, NULL, ServerResponse, NULL, 0,
NULL);
}
else
SetTimer(TIMER_CORBA,3003,NULL);

For process B
if(ping.Ping("192.168.2.114"))
{
hThreadCorba = CreateThread (NULL, NULL, HiloCorba, NULL, 0, );
}
else
SetTimer(TIMER_CORBA,3003,NULL);

192.168.2.114 is the static IP of the PC where omninames are running.

Each time a process want something of the other creates a variable:

try
{
ProcessA m_corbaCallOb;
m_corbaCallOb.methodB();
}
catch(CORBA::TRANSIENT& ex)
{
}
catch(...)
{
}



And finally, the constructor of ProcessA (is the same to proccess B,
changing the name of the class and the name used by the CORBA server
when binding to the name server)

CProcessA::CProcessA ()
{
try {

//------------------------------------------------------------------------
// Initialize ORB object.

//------------------------------------------------------------------------
int argc=0; // Dummy variables to support following call.
char** argv=0;
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);



//------------------------------------------------------------------------
// Bind ORB object to name service object.
// (Reference to Name service root context.)

//------------------------------------------------------------------------
CORBA::Object_var obj = orb->resolve_initial_references("NameService");
assert (!CORBA::is_nil(obj.in()));




//------------------------------------------------------------------------
// Narrow this to the naming context (Narrowed reference to root
context.)

//------------------------------------------------------------------------
CosNaming::NamingContext_var nc = CosNaming::NamingContext::_narrow(
obj.in());
assert (!CORBA::is_nil(nc.in()));



//------------------------------------------------------------------------
// The "name text" put forth by CORBA server in name service.
// This same name ("DataServiceName1") is used by the CORBA server when
// binding to the name server (CosNaming::Name).

//------------------------------------------------------------------------
CosNaming::Name _corbaCosName;
_corbaCosName.length(1);

char str[100] = "DispatcherService";
_corbaCosName[0].id=CORBA::string_dup((const char*)str);



//------------------------------------------------------------------------
// Resolve "name text" identifier to an object reference.

//------------------------------------------------------------------------
CORBA::Object_var obj1 = nc->resolve(_corbaCosName);
assert(!CORBA::is_nil(obj1.in()));


m_ObjCall = ProcessA ::_narrow(obj1.in());
if (CORBA::is_nil(m_ObjCall.in()))
{
cerr << "IOR is not an SA object reference." << endl;
}
}

catch(CORBA::COMM_FAILURE& ex) {
cerr << "Caught system exception COMM_FAILURE -- unable to contact the "
<< "object." << endl;
throw DS_ServerConnectionException();
return;
}
catch(CORBA::SystemException& ) {
cerr << "Caught a CORBA::SystemException." << endl;
throw DS_SystemException();
return;
}
catch(CORBA::Exception& ) {
cerr << "Caught CORBA::Exception." << endl;
throw DS_Exception();
return;
}
catch(omniORB::fatalException& fe) {
cerr << "Caught omniORB::fatalException:" << endl;
cerr << " file: " << fe.file() << endl;
cerr << " line: " << fe.line() << endl;
cerr << " mesg: " << fe.errmsg() << endl;
throw DS_FatalException();
return;
}
catch(...) {
cerr << "Caught unknown exception." << endl;
throw DS_Exception();
return;
}



Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070221/ca0eb854/attachment.htm
Aida Fátima Cano
2007-02-21 17:32:46 UTC
Permalink
I think I have find my bug. I had two different threads in proccess A
calling methods of B. One of them request a Poll to proccess B every 3
seconds while the other sent the rest of the requests to proccess B. (I
separated the thread of the poll because I needeed to know if proccess A
where available regardless of wath happened with the rest of the messages,
because I need this messages to block until the server response, and can not
push a finite time response).

I don't understand why it fails with this two threads and not if there is
just one. Is there something you know that I'm doing wrong?

Thank you so much
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070221/820bcaee/attachment.htm
JHJE (Jan Holst Jensen)
2007-02-21 18:02:33 UTC
Permalink
Post by Aida Fátima Cano
Each time I discconect and connect the network while the
process are running the port used is different, but I think
this have no importance, right
Every time you startup omniORB it chooses a new (essentially a random) port for its endpoint unless you lock it with -ORBendPoint. Have a look at that option.

I don't know what the behavior of omniORB is when you initialize the orb repeatedly from several threads (does it allow it or is it ignored ?). I wouldn't do that since you risk changing the endpoint each time you initialize the orb and thus invalidate all existing object references - if it initializes the orb, that is.
Post by Aida Fátima Cano
Is there some way to me of seeing what's happening since
proccess A invoques a method of process B until it reachs the
code implementation in proccess B? I have look the ORB
traces, but I don't really understand it.
You need to understand the traces - it's your only chance, especially when you are running multithreaded.

Cheers
-- Jan Holst Jensen, Novo Nordisk A/S, Denmark
Duncan Grisby
2007-02-21 22:28:54 UTC
Permalink
On Wednesday 21 February, "=?ISO-8859-1?Q?Aida_F=E1tima_Cano?=" wrote:

[...]
Post by Aida Fátima Cano
Firstly I did what you said, but then I saw the local reference so I change
it. I've only start the thread that goes into orb-run() if I have TCP
connection and if the PC in which omninames are running is reachable. It is
what I meant when I said "if the test success".
omniORB only looks at what network interfaces you have when you call
ORB_init(). It does not look again when you call orb->run(). In fact,
orb->run() doesn't do anything at all. It just blocks waiting for
shutdown.

If you want to defer looking at network interfaces until you have
detected that networking is working, you have to wait to call ORB_init()
until that time.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Aida Fátima Cano
2007-02-21 22:40:34 UTC
Permalink
Thanks for the aclaration.

But then, what happens if after execute ORB_init() something in the code
below throws an exception? Is there someway to stop omniORB, or it stops
automatically?

In my case, if I execute the thread without network connection, the
following sentence goes into the catch statment

// Narrow this to the naming context (Narrowed reference to root
context.)

//------------------------------------------------------------------------
CosNaming::NamingContext_var nc = CosNaming::NamingContext::_narrow(
obj.in());
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070221/53464f84/attachment.htm
JHJE (Jan Holst Jensen)
2007-02-22 02:47:06 UTC
Permalink
Post by Aida Fátima Cano
But then, what happens if after execute ORB_init() something
in the code below throws an exception? Is there someway to
stop omniORB, or it stops automatically?
omniORB never stops once started, unless you explicitly call orb->shutdown().
Post by Aida Fátima Cano
In my case, if I execute the thread without network
connection, the following sentence goes into the catch statment
[...]
Post by Aida Fátima Cano
CosNaming::NamingContext_var nc =
CosNaming::NamingContext::_narrow(obj.in());
And after that, processing continues. The orb continues to run using its own worker threads, listening for requests, sending requests, receiving results and so on.

Cheers
-- Jan

Loading...