[omniORB] client publishes localhost (127.0.0.1) when listening on hostname

Igor Lautar Igor.Lautar at hermes-softlab.com
Mon Jun 9 10:03:39 BST 2008


Hi,

Some background info how we use omniORB.

Client side servant uses hostname as interface on which to listen. In
addition, we add two endpoints. Configuration is as follows:
(replaced actual hostname with <HOSTNAME>)

[01164 06 10:26:12.578] D    4 omniORB: Configuration file
"C:\OMNIORB.CFG" either does not exist or is not a file. No settings
read.
[01164 06 10:26:12.593] D    4 omniORB: Version: 4.1.1
[01164 06 10:26:12.593] D    4 omniORB: Distribution date: Sun Oct  7
16:41:47 BST 2007 dgrisby
[01164 06 10:26:12.609] D    4 omniORB: Warning: unable to create an
IPv6 socket. Unable to obtain the list of IPv6 interface addresses
(10047).
[01164 06 10:26:12.609] D    4 omniORB: My addresses are: 
[01164 06 10:26:12.609] D    4 omniORB: 127.0.0.1
[01164 06 10:26:12.609] D    4 omniORB: Native char code sets: UTF-8
ISO-8859-1.
[01164 06 10:26:12.609] D    4 omniORB: Transmission char code sets:
UTF-8(1.2) UTF-8(1.1) ISO-8859-1(1.2) ISO-8859-1(1.1) ISO-8859-1(1.0).
[01164 06 10:26:12.609] D    4 omniORB: Native wide char code sets:
UTF-16.
[01164 06 10:26:12.609] D    4 omniORB: Transmission wide char code
sets: UTF-16(1.2).
[01164 06 10:26:12.625] D    4 omniORB: Initialising omniDynamic
library.
[01164 06 10:26:12.625] D    4 omniORB: Current configuration is as
follows:
[01164 06 10:26:12.625] D    4 omniORB:   DefaultInitRef (file) = 
[01164 06 10:26:12.625] D    4 omniORB:   DefaultInitRef (args) = 
[01164 06 10:26:12.625] D    4 omniORB:   abortOnInternalError = 0
[01164 06 10:26:12.625] D    4 omniORB:   abortOnNativeException = 0
[01164 06 10:26:12.625] D    4 omniORB:   acceptBiDirectionalGIOP = 0
[01164 06 10:26:12.625] D    4 omniORB:   acceptMisalignedTcIndirections
= 0
[01164 06 10:26:12.625] D    4 omniORB:   bootstrapAgentHostname = 
[01164 06 10:26:12.625] D    4 omniORB:   bootstrapAgentPort = 900
[01164 06 10:26:12.625] D    4 omniORB:   clientCallTimeOutPeriod = 0
[01164 06 10:26:12.625] D    4 omniORB:   clientConnectTimeOutPeriod = 0
[01164 06 10:26:12.625] D    4 omniORB:   clientTransportRule = *
unix,ssl,tcp
[01164 06 10:26:12.625] D    4 omniORB:   configFile = C:\OMNIORB.CFG
[01164 06 10:26:12.625] D    4 omniORB:   connectionWatchImmediate = 0
[01164 06 10:26:12.625] D    4 omniORB:   connectionWatchPeriod = 50000
[01164 06 10:26:12.625] D    4 omniORB:   copyValuesInLocalCalls = 1
[01164 06 10:26:12.625] D    4 omniORB:   diiThrowsSysExceptions = 0
[01164 06 10:26:12.625] D    4 omniORB:   dumpConfiguration = 0
[01164 06 10:26:12.625] D    4 omniORB:   endPoint =
giop:tcp:0.0.0.0:23230
[01164 06 10:26:12.625] D    4 omniORB:   endPoint =
giop:tcp:<HOSTNAME>:23230
[01164 06 10:26:12.625] D    4 omniORB:   endPointPublish = addr
[01164 06 10:26:12.625] D    4 omniORB:   giopMaxMsgSize = 2097152
[01164 06 10:26:12.625] D    4 omniORB:   giopTargetAddressMode =
KeyAddr
[01164 06 10:26:12.625] D    4 omniORB:   id = omniORB4
[01164 06 10:26:12.625] D    4 omniORB:   idleThreadTimeout = 10
[01164 06 10:26:12.625] D    4 omniORB:   inConScanPeriod = 180
[01164 06 10:26:12.625] D    4 omniORB:   lcdMode = 0
[01164 06 10:26:12.625] D    4 omniORB:   maxGIOPConnectionPerServer = 5
[01164 06 10:26:12.625] D    4 omniORB:   maxGIOPVersion = 1.2
[01164 06 10:26:12.625] D    4 omniORB:
maxInterleavedCallsPerConnection = 5
[01164 06 10:26:12.625] D    4 omniORB:   maxServerThreadPerConnection =
100
[01164 06 10:26:12.625] D    4 omniORB:   maxServerThreadPoolSize = 100
[01164 06 10:26:12.625] D    4 omniORB:   maxSocketRecv = 131072
[01164 06 10:26:12.625] D    4 omniORB:   maxSocketSend = 131072
[01164 06 10:26:12.625] D    4 omniORB:   nativeCharCodeSet = UTF-8
[01164 06 10:26:12.625] D    4 omniORB:   nativeWCharCodeSet = UTF-16
[01164 06 10:26:12.625] D    4 omniORB:   objectTableSize = 0
[01164 06 10:26:12.625] D    4 omniORB:   offerBiDirectionalGIOP = 0
[01164 06 10:26:12.625] D    4 omniORB:   oneCallPerConnection = 1
[01164 06 10:26:12.625] D    4 omniORB:   outConScanPeriod = 120
[01164 06 10:26:12.625] D    4 omniORB:   poaHoldRequestTimeout = 0
[01164 06 10:26:12.625] D    4 omniORB:   poaUniquePersistentSystemIds =
1
[01164 06 10:26:12.625] D    4 omniORB:   principal = [Null]
[01164 06 10:26:12.625] D    4 omniORB:   resetTimeOutOnRetries = 0
[01164 06 10:26:12.625] D    4 omniORB:   scanGranularity = 5
[01164 06 10:26:12.625] D    4 omniORB:   serverCallTimeOutPeriod = 0
[01164 06 10:26:12.625] D    4 omniORB:   serverTransportRule = *
unix,ssl,tcp
[01164 06 10:26:12.625] D    4 omniORB:   socketSendBuffer = 16384
[01164 06 10:26:12.625] D    4 omniORB:   strictIIOP = 1
[01164 06 10:26:12.625] D    4 omniORB:   supportBootstrapAgent = 0
[01164 06 10:26:12.625] D    4 omniORB:   supportCurrent = 1
[01164 06 10:26:12.625] D    4 omniORB:   supportPerThreadTimeOut = 0
[01164 06 10:26:12.625] D    4 omniORB:   tcAliasExpand = 0
[01164 06 10:26:12.625] D    4 omniORB:   threadPerConnectionLowerLimit
= 9000
[01164 06 10:26:12.625] D    4 omniORB:   threadPerConnectionPolicy = 1
[01164 06 10:26:12.625] D    4 omniORB:   threadPerConnectionUpperLimit
= 10000
[01164 06 10:26:12.625] D    4 omniORB:   threadPoolWatchConnection = 1
[01164 06 10:26:12.625] D    4 omniORB:   traceExceptions = 0
[01164 06 10:26:12.625] D    4 omniORB:   traceFile = [stderr]
[01164 06 10:26:12.625] D    4 omniORB:   traceInvocationReturns = 0
[01164 06 10:26:12.625] D    4 omniORB:   traceInvocations = 1
[01164 06 10:26:12.625] D    4 omniORB:   traceLevel = 20
[01164 06 10:26:12.625] D    4 omniORB:   traceThreadId = 0
[01164 06 10:26:12.625] D    4 omniORB:   traceTime = 0
[01164 06 10:26:12.625] D    4 omniORB:   unixTransportDirectory =
/tmp/omni-%u
[01164 06 10:26:12.625] D    4 omniORB:   unixTransportPermission =  777
[01164 06 10:26:12.625] D    4 omniORB:   useTypeCodeIndirections = 1
[01164 06 10:26:12.625] D    4 omniORB:   verifyObjectExistsAndType = 1
[01164 06 10:26:12.625] D    4 omniORB: Initialising incoming endpoints.
[01164 06 10:26:12.625] D    4 omniORB: Instantiate endpoint
'giop:tcp:0.0.0.0:23230'
[01164 06 10:26:12.640] D    4 omniORB: Warning: the local loop back
interface (127.0.0.1)
[01164 06 10:26:12.640] D    4 is the only address available for this
server.
[01164 06 10:26:12.640] D    4 omniORB: Instantiate endpoint
'giop:tcp:<HOSTNAME>:23230'
[01164 06 10:26:12.734] D    4 omniORB: Publish specification: 'addr'
[01164 06 10:26:12.734] D    4 omniORB: Publish endpoint
'giop:tcp:127.0.0.1:23230'
[01164 06 10:26:12.734] D    4 omniORB: Publish endpoint
'giop:tcp:<HOSTNAME>:23230'
[01164 06 10:26:12.734] D    4 omniORB: Starting serving incoming
endpoints.



So it seams like servant is listening only on 127.0.0.1.

But some time later, server _can_ connect to it using external
interface:

[00000 06 10:29:50.921] D    0 omniORB: Server accepted connection from
giop:tcp:192.168.0.39:4220
[00000 06 10:29:50.921] D    0 omniORB: AsyncInvoker: thread id = 5 has
started. Total threads = 4
[00000 06 10:29:50.921] D    0 omniORB: Accepted connection from
giop:tcp:192.168.0.39:4220 because of this rule: "* unix,ssl,tcp"
[00000 06 10:29:50.921] D    0 omniORB: Dispatching remote call '_is_a'
to: key<clientService> (active)
[00000 06 10:29:50.921] D    0 omniORB: Dispatching remote call 'GetIOR'
to: key<clientService> (active)
[01544 06 10:29:50.921] -->  1 cas_Corba::Instance()$Rev: 18110 $
[01544 06 10:29:50.921] <--  1 cas_Corba::Instance()
[01544 06 10:29:50.921] D    0 omniORB: Creating ref to local:
key<clientService>
[01544 06 10:29:50.921] D    0  target id      :
IDL:omg.org/CORBA/Object:1.0
[01544 06 10:29:50.921] D    0  most derived id:
IDL:HSL/i_CSVC/i_ClientSvc:1.0
[01544 06 10:29:50.921] D    0 omniORB:
ObjRef(IDL:HSL/i_CSVC/i_ClientSvc:1.0) -- deleted.
[01544 06 10:29:58.390] D    0 omniORB: Dispatching remote call '_is_a'
to: key<clientService> (active)
[01544 06 10:29:58.390] D    0 omniORB: Dispatching remote call 'GetIOR'
to: key<clientService> (active)

We use corbaloc to connect to servant and GetIOR is our helper call that
returns properly defined IOR (with UTF encoding) to support unicode.

What happens is that IP encoded in string returned by GetIOR is
127.0.0.1. Problem is that the same servant is also running on the host
which acts as a client, so next call ends up on same host. Why is
127.0.0.1 published if it is also listening on external interface (or
better question, why is it first on list of published IPs).

GetIOR call is simply:

    CORBA::Object_var obj = a_servant->_this();
    CORBA::String_var sior = m_orb->object_to_string(obj);
    return std::string((char*)sior);

Where a_servant == this from calling servant.

We have observed this behaviour during network drops, but it is not
consistent. For example, during hibernation, network cable pluged out
etc.

omniORB version is 4.1.1, platform is Windows, both XP/Vista etc. are
affected.

Endpoints:
[01164 06 10:26:12.625] D    4 omniORB:   endPoint =
giop:tcp:0.0.0.0:23230
[01164 06 10:26:12.625] D    4 omniORB:   endPoint =
giop:tcp:<HOSTNAME>:23230

Are used to overcome IPv6 problem we encountered (listening only on
IPv6, but not on IPv4 - only affected Vista).

Now my question, is this behaviour known, is it expected and how can it
be prevented :) ?

Ideally, client should not publish 127.0.0.1, if it the only address
(and we are listening on 0.0.0.0). If it is not the only address (as it
was the case here), it should publish it as last IP on list.

Can this be achieved by altering omniORB configuration?

Thank you,
Igor



More information about the omniORB-list mailing list