Discussion:
[omniORB] Issues with persistent objects
anirudh nair
2011-01-28 16:27:06 UTC
Permalink
Hi,

I created a persistent object using omniINSPOA and setting the endPoint
parameter suitably.
The object is persistent as I get the same IOR when the server restarts.

Now, when the client calls a method after a server restart, a COMM_FAILURE
exception
is raised. The interesting thing here is that when the client catches the
exception and issues
another call to server, the server method is executed.

So, basically only the first call after the server restart raises an
exception. All calls henceforth
works fine.


if the below code is executed after server restarts.

try {
return obj_ref->send_book(the_book, key); // this raises an exception
}
catch(...) {
cerr << "Exception Caught" << endl;
return obj_ref->send_book(the_book, key); // this call works fine
}

In the above code send_book is the server method called by the client.


client trace:
omniORB: (0) 2011-01-27 20:52:17.319000: Version: 4.1.2
omniORB: (0) 2011-01-27 20:52:17.321000: Distribution date: Thu Feb 14
14:19:08
GMT 2008 dgrisby
omniORB: (0) 2011-01-27 20:52:17.383000: My addresses are:
omniORB: 192.168.198.1
omniORB: 192.168.68.1
omniORB: 10.9.19.20
omniORB: 127.0.0.1
omniORB: (0) 2011-01-27 20:52:17.383000: Maximum supported GIOP version is
1.2
omniORB: (0) 2011-01-27 20:52:17.384000: Native char code sets: UTF-8
ISO-8859-1
.
omniORB: (0) 2011-01-27 20:52:17.384000: 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).
omniORB: (0) 2011-01-27 20:52:17.384000: Native wide char code sets: UTF-16.
omniORB: (0) 2011-01-27 20:52:17.384000: Transmission wide char code sets:
UTF-1
6(1.2).
omniORB: (0) 2011-01-27 20:52:17.385000: Initialising omniDynamic library.
omniORB: (0) 2011-01-27 20:52:17.386000: Current configuration is as
follows:
omniORB: DefaultInitRef (file) =
omniORB: DefaultInitRef (args) =
omniORB: abortOnInternalError = 0
omniORB: abortOnNativeException = 0
omniORB: acceptBiDirectionalGIOP = 0
omniORB: acceptMisalignedTcIndirections = 0
omniORB: bootstrapAgentHostname =
omniORB: bootstrapAgentPort = 900
omniORB: clientCallTimeOutPeriod = 0
omniORB: clientConnectTimeOutPeriod = 0
omniORB: clientTransportRule = * unix,ssl,tcp
omniORB: configFile = C:\OMNIORB.CFG
omniORB: connectionWatchImmediate = 0
omniORB: connectionWatchPeriod = 50000
omniORB: copyValuesInLocalCalls = 1
omniORB: diiThrowsSysExceptions = 0
omniORB: dumpConfiguration = 0
omniORB: endPoint = giop:tcp::
omniORB: endPointPublish = addr
omniORB: giopMaxMsgSize = 2097152
omniORB: giopTargetAddressMode = KeyAddr
omniORB: id = omniORB4
omniORB: idleThreadTimeout = 10
omniORB: immediateAddressSwitch = 0
omniORB: inConScanPeriod = 180
omniORB: lcdMode = 0
omniORB: maxGIOPConnectionPerServer = 5
omniORB: maxGIOPVersion = 1.2
omniORB: maxInterleavedCallsPerConnection = 5
omniORB: maxServerThreadPerConnection = 100
omniORB: maxServerThreadPoolSize = 100
omniORB: maxSocketRecv = 131072
omniORB: maxSocketSend = 131072
omniORB: nativeCharCodeSet = ISO-8859-1
omniORB: nativeWCharCodeSet = UTF-16
omniORB: objectTableSize = 0
omniORB: offerBiDirectionalGIOP = 0
omniORB: oneCallPerConnection = 1
omniORB: outConScanPeriod = 120
omniORB: poaHoldRequestTimeout = 0
omniORB: poaUniquePersistentSystemIds = 1
omniORB: principal = [Null]
omniORB: resetTimeOutOnRetries = 0
omniORB: scanGranularity = 5
omniORB: serverCallTimeOutPeriod = 0
omniORB: serverTransportRule = * unix,ssl,tcp
omniORB: socketSendBuffer = 16384
omniORB: strictIIOP = 1
omniORB: supportBootstrapAgent = 0
omniORB: supportCurrent = 1
omniORB: supportPerThreadTimeOut = 0
omniORB: tcAliasExpand = 0
omniORB: threadPerConnectionLowerLimit = 9000
omniORB: threadPerConnectionPolicy = 1
omniORB: threadPerConnectionUpperLimit = 10000
omniORB: threadPoolWatchConnection = 1
omniORB: traceExceptions = 0
omniORB: traceFile = [stderr]
omniORB: traceInvocationReturns = 1
omniORB: traceInvocations = 1
omniORB: traceLevel = 25
omniORB: traceThreadId = 1
omniORB: traceTime = 1
omniORB: unixTransportDirectory = /tmp/omni-%u
omniORB: unixTransportPermission = 777
omniORB: useTypeCodeIndirections = 1
omniORB: verifyObjectExistsAndType = 1
omniORB: (0) 2011-01-27 20:52:17.392000: Creating ref to remote: key<Param>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id:
omniORB: (0) 2011-01-27 20:52:17.407000: Invoke '_is_a' on remote:
key<Param>
omniORB: (0) 2011-01-27 20:52:17.411000: Client attempt to connect to
giop:tcp:1
0.9.18.193:4001
omniORB: (1) 2011-01-27 20:52:17.412000: AsyncInvoker: thread id = 1 has
started
. Total threads = 1
omniORB: (1) 2011-01-27 20:52:17.414000: Scavenger task execute.
omniORB: (0) 2011-01-27 20:52:17.425000: Client opened connection to
giop:tcp:10
.9.18.193:4001
omniORB: (0) 2011-01-27 20:52:17.425000: sendChunk: to giop:tcp:
10.9.18.193:4001
80 bytes
omniORB: (0) 2011-01-27 20:52:17.426000: inputMessage: from
giop:tcp:10.9.18.193
:4001 25 bytes
omniORB: (0) 2011-01-27 20:52:17.426000: Return '_is_a' on remote:
key<Param>
omniORB: (0) 2011-01-27 20:52:17.427000: Creating ref to remote: key<Param>
target id : IDL:Param/ParamBook:1.0
most derived id:
omniORB: (0) 2011-01-27 20:52:17.428000: ObjRef() -- deleted.
omniORB: (0) 2011-01-27 20:52:33.431000: Invoke 'send_book' on remote:
key<Param
omniORB: (0) 2011-01-27 20:52:33.432000: sendChunk: to giop:tcp:
10.9.18.193:4001
1374 bytes
omniORB: (0) 2011-01-27 20:52:33.434000: inputMessage: from
giop:tcp:10.9.18.193
:4001 25 bytes
omniORB: (0) 2011-01-27 20:52:33.435000: Return 'send_book' on remote:
key<Param
//The below invoke of send_book fails
omniORB: (0) 2011-01-27 20:55:33.811000: Invoke 'send_book' on remote:
key<Param
omniORB: (0) 2011-01-27 20:55:33.812000: sendChunk: to giop:tcp:
10.9.18.193:4001
1374 bytes
omniORB: (0) 2011-01-27 20:55:33.815000: Client connection refcount = 0
omniORB: (0) 2011-01-27 20:55:33.815000: Client close connection to
giop:tcp:10.
9.18.193:4001

Exception Caught

// the below call executes
omniORB: (0) 2011-01-27 20:55:33.824000: Invoke 'send_book' on remote:
key<Param
omniORB: (0) 2011-01-27 20:55:33.825000: Client attempt to connect to
giop:tcp:1
0.9.18.193:4001
omniORB: (0) 2011-01-27 20:55:33.827000: Client opened connection to
giop:tcp:10
.9.18.193:4001
omniORB: (0) 2011-01-27 20:55:33.828000: sendChunk: to giop:tcp:
10.9.18.193:4001
1374 bytes
omniORB: (0) 2011-01-27 20:55:33.830000: inputMessage: from
giop:tcp:10.9.18.193
:4001 25 bytes
omniORB: (0) 2011-01-27 20:55:33.831000: Return 'send_book' on remote:
key<Param
omniORB: (0) 2011-01-27 20:55:41.861000: Invoke 'send_book' on remote:
key<Param
omniORB: (0) 2011-01-27 20:55:41.862000: sendChunk: to giop:tcp:
10.9.18.193:4001
1374 bytes
omniORB: (0) 2011-01-27 20:55:41.864000: inputMessage: from
giop:tcp:10.9.18.193
:4001 25 bytes
omniORB: (0) 2011-01-27 20:55:41.865000: Return 'send_book' on remote:
key<Param
Server trace:

omniORB: Version: 4.1.5
omniORB: Distribution date: Wed Dec 22 15:59:17 GMT 2010 dgrisby
omniORB: Skip link local address fe80::213:72ff:fe90:6d4b on interface eth0.
omniORB: Skip link local address fe80::213:72ff:fe90:6d4b on interface br0.
omniORB: My addresses are:
omniORB: 127.0.0.1
omniORB: 127.0.0.2
omniORB: 10.9.18.193
omniORB: ::1
omniORB: Maximum supported GIOP version is 1.2
omniORB: Native char code sets: ISO-8859-1 UTF-8.
omniORB: Transmission char code sets: ISO-8859-1(1.2) ISO-8859-1(1.1)
ISO-8859-1(1.0) UTF-8(1.2) UTF-8(1.1).
omniORB: Native wide char code sets: UTF-16.
omniORB: Transmission wide char code sets: UTF-16(1.2).
omniORB: Initialising omniDynamic library.
omniORB: Current configuration is as follows:
omniORB: DefaultInitRef (file) =
omniORB: DefaultInitRef (args) =
omniORB: InitRef = NameService=corbaname::localhost
omniORB: abortOnInternalError = 0
omniORB: abortOnNativeException = 0
omniORB: acceptBiDirectionalGIOP = 1
omniORB: acceptMisalignedTcIndirections = 0
omniORB: bootstrapAgentHostname =
omniORB: bootstrapAgentPort = 900
omniORB: clientCallTimeOutPeriod = 0
omniORB: clientConnectTimeOutPeriod = 0
omniORB: clientTransportRule = * unix,ssl,tcp
omniORB: configFile = /etc/omniORB.cfg
omniORB: connectionWatchImmediate = 0
omniORB: connectionWatchPeriod = 50000
omniORB: copyValuesInLocalCalls = 1
omniORB: diiThrowsSysExceptions = 0
omniORB: dumpConfiguration = 0
omniORB: endPoint = giop:tcp::4001
omniORB: endPointPublish = addr
omniORB: giopMaxMsgSize = 536870912
omniORB: giopTargetAddressMode = KeyAddr
omniORB: id = omniORB4
omniORB: idleThreadTimeout = 10
omniORB: immediateAddressSwitch = 0
omniORB: inConScanPeriod = 0
omniORB: lcdMode = 0
omniORB: maxGIOPConnectionPerServer = 100
omniORB: maxGIOPVersion = 1.2
omniORB: maxInterleavedCallsPerConnection = 5
omniORB: maxServerThreadPerConnection = 100
omniORB: maxServerThreadPoolSize = 100
omniORB: maxSocketRecv = 2147483647
omniORB: maxSocketSend = 2147483647
omniORB: nativeCharCodeSet = ISO-8859-1
omniORB: nativeWCharCodeSet = UTF-16
omniORB: objectTableSize = 0
omniORB: offerBiDirectionalGIOP = 1
omniORB: oneCallPerConnection = 1
omniORB: outConScanPeriod = 0
omniORB: poaHoldRequestTimeout = 0
omniORB: poaUniquePersistentSystemIds = 1
omniORB: principal = [Null]
omniORB: resetTimeOutOnRetries = 0
omniORB: scanGranularity = 5
omniORB: serverCallTimeOutPeriod = 0
omniORB: serverTransportRule = * unix,ssl,tcp
omniORB: socketSendBuffer = -1
omniORB: strictIIOP = 1
omniORB: supportBootstrapAgent = 0
omniORB: supportCurrent = 1
omniORB: supportPerThreadTimeOut = 0
omniORB: tcAliasExpand = 0
omniORB: threadPerConnectionLowerLimit = 9000
omniORB: threadPerConnectionPolicy = 1
omniORB: threadPerConnectionUpperLimit = 10000
omniORB: threadPoolWatchConnection = 1
omniORB: traceExceptions = 1
omniORB: traceFile = [stderr]
omniORB: traceInvocationReturns = 0
omniORB: traceInvocations = 0
omniORB: traceLevel = 25
omniORB: traceThreadId = 0
omniORB: traceTime = 0
omniORB: unixTransportDirectory = /tmp/omni-%u
omniORB: unixTransportPermission = 777
omniORB: useTypeCodeIndirections = 1
omniORB: validateUTF8 = 0
omniORB: verifyObjectExistsAndType = 1
omniORB: Initialising incoming endpoints.
omniORB: Instantiate endpoint 'giop:tcp::4001'
omniORB: Bind to address :: port 4001.
omniORB: Publish specification: 'addr'
omniORB: Try to publish 'addr' for endpoint giop:tcp:10.9.18.193:4001
omniORB: Publish endpoint 'giop:tcp:10.9.18.193:4001'
omniORB: Starting serving incoming endpoints.
omniORB: AsyncInvoker: thread id = 1 has started. Total threads = 1
omniORB: giopRendezvouser task execute for giop:tcp:10.9.18.193:4001
omniORB: Adding key<Param> (activating) to object table.
omniORB: State key<Param> (activating) -> active
omniORB: Creating ref to local: key<Param>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id: IDL:Param/ParamBook:1.0
IOR:010000001800000049444c3a506172616d2f506172616d426f6f6b3a312e300001000000000000005c000000010102000c00000031302e392e31382e31393300a10f000005000000506172616d0000000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100
omniORB: SocketCollection idle. Sleeping.
omniORB: Version: 4.1.5
omniORB: Distribution date: Wed Dec 22 15:59:17 GMT 2010 dgrisby
omniORB: Skip link local address fe80::213:72ff:fe90:6d4b on interface eth0.
omniORB: Skip link local address fe80::213:72ff:fe90:6d4b on interface br0.
omniORB: My addresses are:
omniORB: 127.0.0.1
omniORB: 127.0.0.2
omniORB: 10.9.18.193
omniORB: ::1
omniORB: Maximum supported GIOP version is 1.2
omniORB: Native char code sets: ISO-8859-1 UTF-8.
omniORB: Transmission char code sets: ISO-8859-1(1.2) ISO-8859-1(1.1)
ISO-8859-1(1.0) UTF-8(1.2) UTF-8(1.1).
omniORB: Native wide char code sets: UTF-16.
omniORB: Transmission wide char code sets: UTF-16(1.2).
omniORB: Initialising omniDynamic library.
omniORB: Current configuration is as follows:
omniORB: DefaultInitRef (file) =
omniORB: DefaultInitRef (args) =
omniORB: InitRef = NameService=corbaname::localhost
omniORB: abortOnInternalError = 0
omniORB: abortOnNativeException = 0
omniORB: acceptBiDirectionalGIOP = 1
omniORB: acceptMisalignedTcIndirections = 0
omniORB: bootstrapAgentHostname =
omniORB: bootstrapAgentPort = 900
omniORB: clientCallTimeOutPeriod = 0
omniORB: clientConnectTimeOutPeriod = 0
omniORB: clientTransportRule = * unix,ssl,tcp
omniORB: configFile = /etc/omniORB.cfg
omniORB: connectionWatchImmediate = 0
omniORB: connectionWatchPeriod = 50000
omniORB: copyValuesInLocalCalls = 1
omniORB: diiThrowsSysExceptions = 0
omniORB: dumpConfiguration = 0
omniORB: endPoint = giop:tcp::4001
omniORB: endPointPublish = addr
omniORB: giopMaxMsgSize = 536870912
omniORB: giopTargetAddressMode = KeyAddr
omniORB: id = omniORB4
omniORB: idleThreadTimeout = 10
omniORB: immediateAddressSwitch = 0
omniORB: inConScanPeriod = 0
omniORB: lcdMode = 0
omniORB: maxGIOPConnectionPerServer = 100
omniORB: maxGIOPVersion = 1.2
omniORB: maxInterleavedCallsPerConnection = 5
omniORB: maxServerThreadPerConnection = 100
omniORB: maxServerThreadPoolSize = 100
omniORB: maxSocketRecv = 2147483647
omniORB: maxSocketSend = 2147483647
omniORB: nativeCharCodeSet = ISO-8859-1
omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 2
omniORB: Scavenger task execute.
omniORB: Server accepted connection from giop:tcp:[::ffff:10.9.19.20]:54325
omniORB: AsyncInvoker: thread id = 3 has started. Total threads = 3
omniORB: giopWorker task execute.
omniORB: Accepted connection from giop:tcp:[::ffff:10.9.19.20]:54325 because
of this rule: "* unix,ssl,tcp"
omniORB: inputMessage: from giop:tcp:[::ffff:10.9.19.20]:54325 80 bytes
omniORB: sendChunk: to giop:tcp:[::ffff:10.9.19.20]:54325 25 bytes
omniORB: SocketCollection idle. Sleeping.
omniORB: inputMessage: from giop:tcp:[::ffff:10.9.19.20]:54325 1374 bytes
length of book: 1
Exclusion Region Data Received
omniORB: sendChunk: to giop:tcp:[::ffff:10.9.19.20]:54325 25 bytes
omniORB: SocketCollection idle. Sleeping.

// After server restart
IOR:010000001800000049444c3a506172616d2f506172616d426f6f6b3a312e300001000000000000005c000000010102000c00000031302e392e31382e31393300a10f000005000000506172616d0000000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100
omniORB: SocketCollection idle. Sleeping.
omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 2
omniORB: Scavenger task execute.
omniORB: Server accepted connection from giop:tcp:[::ffff:10.9.19.20]:54333
omniORB: AsyncInvoker: thread id = 3 has started. Total threads = 3
omniORB: giopWorker task execute.
omniORB: Accepted connection from giop:tcp:[::ffff:10.9.19.20]:54333 because
of this rule: "* unix,ssl,tcp"
omniORB: inputMessage: from giop:tcp:[::ffff:10.9.19.20]:54333 1374 bytes
length of book: 1
Exclusion Region Data Received
omniORB: sendChunk: to giop:tcp:[::ffff:10.9.19.20]:54333 25 bytes
omniORB: SocketCollection idle. Sleeping.
omniORB: inputMessage: from giop:tcp:[::ffff:10.9.19.20]:54333 1374 bytes
length of book: 1
Exclusion Region Data Received
omniORB: sendChunk: to giop:tcp:[::ffff:10.9.19.20]:54333 25 bytes
omniORB: SocketCollection idle. Sleeping.


Thanks
Anirudh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20110128/574fd51c/attachment-0001.htm
Martin B.
2011-01-28 16:59:36 UTC
Permalink
Analysis will be easier when you add traceException=1 (The minor codes
of the exceptions should be apparent then.) and when you use the same
extensive tracing parameters for the server side as you already use for
the client side.

cheers,
Martin
Post by anirudh nair
Hi,
I created a persistent object using omniINSPOA and setting the endPoint
parameter suitably.
The object is persistent as I get the same IOR when the server restarts.
Now, when the client calls a method after a server restart, a
COMM_FAILURE exception
is raised. The interesting thing here is that when the client catches
the exception and issues
another call to server, the server method is executed.
So, basically only the first call after the server restart raises an
exception. All calls henceforth
works fine.
if the below code is executed after server restarts.
try {
return obj_ref->send_book(the_book, key); // this raises an exception
}
catch(...) {
cerr << "Exception Caught" << endl;
return obj_ref->send_book(the_book, key); // this call works fine
}
In the above code send_book is the server method called by the client.
omniORB: (0) 2011-01-27 20:52:17.319000: Version: 4.1.2
omniORB: (0) 2011-01-27 20:52:17.321000: Distribution date: Thu Feb 14
14:19:08
GMT 2008 dgrisby
omniORB: 192.168.198.1
omniORB: 192.168.68.1
omniORB: 10.9.19.20
omniORB: 127.0.0.1
omniORB: (0) 2011-01-27 20:52:17.383000: Maximum supported GIOP version
is 1.2
omniORB: (0) 2011-01-27 20:52:17.384000: Native char code sets: UTF-8
ISO-8859-1
.
UTF-8(1.2)
UTF-8(1.1) ISO-8859-1(1.2) ISO-8859-1(1.1) ISO-8859-1(1.0).
omniORB: (0) 2011-01-27 20:52:17.384000: Native wide char code sets: UTF-16.
omniORB: (0) 2011-01-27 20:52:17.384000: Transmission wide char code
sets: UTF-1
6(1.2).
omniORB: (0) 2011-01-27 20:52:17.385000: Initialising omniDynamic library.
omniORB: (0) 2011-01-27 20:52:17.386000: Current configuration is as
omniORB: DefaultInitRef (file) =
omniORB: DefaultInitRef (args) =
omniORB: abortOnInternalError = 0
omniORB: abortOnNativeException = 0
omniORB: acceptBiDirectionalGIOP = 0
omniORB: acceptMisalignedTcIndirections = 0
omniORB: bootstrapAgentHostname =
omniORB: bootstrapAgentPort = 900
omniORB: clientCallTimeOutPeriod = 0
omniORB: clientConnectTimeOutPeriod = 0
omniORB: clientTransportRule = * unix,ssl,tcp
omniORB: configFile = C:\OMNIORB.CFG
omniORB: connectionWatchImmediate = 0
omniORB: connectionWatchPeriod = 50000
omniORB: copyValuesInLocalCalls = 1
omniORB: diiThrowsSysExceptions = 0
omniORB: dumpConfiguration = 0
omniORB: endPointPublish = addr
omniORB: giopMaxMsgSize = 2097152
omniORB: giopTargetAddressMode = KeyAddr
omniORB: id = omniORB4
omniORB: idleThreadTimeout = 10
omniORB: immediateAddressSwitch = 0
omniORB: inConScanPeriod = 180
omniORB: lcdMode = 0
omniORB: maxGIOPConnectionPerServer = 5
omniORB: maxGIOPVersion = 1.2
omniORB: maxInterleavedCallsPerConnection = 5
omniORB: maxServerThreadPerConnection = 100
omniORB: maxServerThreadPoolSize = 100
omniORB: maxSocketRecv = 131072
omniORB: maxSocketSend = 131072
omniORB: nativeCharCodeSet = ISO-8859-1
omniORB: nativeWCharCodeSet = UTF-16
omniORB: objectTableSize = 0
omniORB: offerBiDirectionalGIOP = 0
omniORB: oneCallPerConnection = 1
omniORB: outConScanPeriod = 120
omniORB: poaHoldRequestTimeout = 0
omniORB: poaUniquePersistentSystemIds = 1
omniORB: principal = [Null]
omniORB: resetTimeOutOnRetries = 0
omniORB: scanGranularity = 5
omniORB: serverCallTimeOutPeriod = 0
omniORB: serverTransportRule = * unix,ssl,tcp
omniORB: socketSendBuffer = 16384
omniORB: strictIIOP = 1
omniORB: supportBootstrapAgent = 0
omniORB: supportCurrent = 1
omniORB: supportPerThreadTimeOut = 0
omniORB: tcAliasExpand = 0
omniORB: threadPerConnectionLowerLimit = 9000
omniORB: threadPerConnectionPolicy = 1
omniORB: threadPerConnectionUpperLimit = 10000
omniORB: threadPoolWatchConnection = 1
omniORB: traceExceptions = 0
omniORB: traceFile = [stderr]
omniORB: traceInvocationReturns = 1
omniORB: traceInvocations = 1
omniORB: traceLevel = 25
omniORB: traceThreadId = 1
omniORB: traceTime = 1
omniORB: unixTransportDirectory = /tmp/omni-%u
omniORB: unixTransportPermission = 777
omniORB: useTypeCodeIndirections = 1
omniORB: verifyObjectExistsAndType = 1
omniORB: (0) 2011-01-27 20:52:17.392000: Creating ref to remote: key<Param>
target id : IDL:omg.org/CORBA/Object:1.0
<http://omg.org/CORBA/Object:1.0>
key<Param>
omniORB: (0) 2011-01-27 20:52:17.411000: Client attempt to connect to
giop:tcp:1
0.9.18.193:4001 <http://0.9.18.193:4001>
omniORB: (1) 2011-01-27 20:52:17.412000: AsyncInvoker: thread id = 1 has
started
. Total threads = 1
omniORB: (1) 2011-01-27 20:52:17.414000: Scavenger task execute.
omniORB: (0) 2011-01-27 20:52:17.425000: Client opened connection to
giop:tcp:10
.9.18.193:4001
omniORB: (0) 2011-01-27 20:52:17.425000: sendChunk: to
giop:tcp:10.9.18.193:4001 <http://10.9.18.193:4001>
80 bytes
omniORB: (0) 2011-01-27 20:52:17.426000: inputMessage: from
giop:tcp:10.9.18.193
:4001 25 bytes
key<Param>
omniORB: (0) 2011-01-27 20:52:17.427000: Creating ref to remote: key<Param>
target id : IDL:Param/ParamBook:1.0
omniORB: (0) 2011-01-27 20:52:17.428000: ObjRef() -- deleted.
key<Param
omniORB: (0) 2011-01-27 20:52:33.432000: sendChunk: to
giop:tcp:10.9.18.193:4001 <http://10.9.18.193:4001>
1374 bytes
omniORB: (0) 2011-01-27 20:52:33.434000: inputMessage: from
giop:tcp:10.9.18.193
:4001 25 bytes
key<Param
//The below invoke of send_book fails
key<Param
omniORB: (0) 2011-01-27 20:55:33.812000: sendChunk: to
giop:tcp:10.9.18.193:4001 <http://10.9.18.193:4001>
1374 bytes
omniORB: (0) 2011-01-27 20:55:33.815000: Client connection refcount = 0
omniORB: (0) 2011-01-27 20:55:33.815000: Client close connection to
giop:tcp:10.
9.18.193:4001
Exception Caught
// the below call executes
key<Param
omniORB: (0) 2011-01-27 20:55:33.825000: Client attempt to connect to
giop:tcp:1
0.9.18.193:4001 <http://0.9.18.193:4001>
omniORB: (0) 2011-01-27 20:55:33.827000: Client opened connection to
giop:tcp:10
.9.18.193:4001
omniORB: (0) 2011-01-27 20:55:33.828000: sendChunk: to
giop:tcp:10.9.18.193:4001 <http://10.9.18.193:4001>
1374 bytes
omniORB: (0) 2011-01-27 20:55:33.830000: inputMessage: from
giop:tcp:10.9.18.193
:4001 25 bytes
key<Param
key<Param
omniORB: (0) 2011-01-27 20:55:41.862000: sendChunk: to
giop:tcp:10.9.18.193:4001 <http://10.9.18.193:4001>
1374 bytes
omniORB: (0) 2011-01-27 20:55:41.864000: inputMessage: from
giop:tcp:10.9.18.193
:4001 25 bytes
key<Param
omniORB: Version: 4.1.5
omniORB: Distribution date: Wed Dec 22 15:59:17 GMT 2010 dgrisby
omniORB: Skip link local address fe80::213:72ff:fe90:6d4b on interface eth0.
omniORB: Skip link local address fe80::213:72ff:fe90:6d4b on interface br0.
omniORB: 127.0.0.1
omniORB: 127.0.0.2
omniORB: 10.9.18.193
omniORB: ::1
omniORB: Maximum supported GIOP version is 1.2
omniORB: Native char code sets: ISO-8859-1 UTF-8.
omniORB: Transmission char code sets: ISO-8859-1(1.2) ISO-8859-1(1.1)
ISO-8859-1(1.0) UTF-8(1.2) UTF-8(1.1).
omniORB: Native wide char code sets: UTF-16.
omniORB: Transmission wide char code sets: UTF-16(1.2).
omniORB: Initialising omniDynamic library.
omniORB: DefaultInitRef (file) =
omniORB: DefaultInitRef (args) =
omniORB: InitRef = NameService=corbaname::localhost
omniORB: abortOnInternalError = 0
omniORB: abortOnNativeException = 0
omniORB: acceptBiDirectionalGIOP = 1
omniORB: acceptMisalignedTcIndirections = 0
omniORB: bootstrapAgentHostname =
omniORB: bootstrapAgentPort = 900
omniORB: clientCallTimeOutPeriod = 0
omniORB: clientConnectTimeOutPeriod = 0
omniORB: clientTransportRule = * unix,ssl,tcp
omniORB: configFile = /etc/omniORB.cfg
omniORB: connectionWatchImmediate = 0
omniORB: connectionWatchPeriod = 50000
omniORB: copyValuesInLocalCalls = 1
omniORB: diiThrowsSysExceptions = 0
omniORB: dumpConfiguration = 0
omniORB: endPoint = giop:tcp::4001
omniORB: endPointPublish = addr
omniORB: giopMaxMsgSize = 536870912
omniORB: giopTargetAddressMode = KeyAddr
omniORB: id = omniORB4
omniORB: idleThreadTimeout = 10
omniORB: immediateAddressSwitch = 0
omniORB: inConScanPeriod = 0
omniORB: lcdMode = 0
omniORB: maxGIOPConnectionPerServer = 100
omniORB: maxGIOPVersion = 1.2
omniORB: maxInterleavedCallsPerConnection = 5
omniORB: maxServerThreadPerConnection = 100
omniORB: maxServerThreadPoolSize = 100
omniORB: maxSocketRecv = 2147483647
omniORB: maxSocketSend = 2147483647
omniORB: nativeCharCodeSet = ISO-8859-1
omniORB: nativeWCharCodeSet = UTF-16
omniORB: objectTableSize = 0
omniORB: offerBiDirectionalGIOP = 1
omniORB: oneCallPerConnection = 1
omniORB: outConScanPeriod = 0
omniORB: poaHoldRequestTimeout = 0
omniORB: poaUniquePersistentSystemIds = 1
omniORB: principal = [Null]
omniORB: resetTimeOutOnRetries = 0
omniORB: scanGranularity = 5
omniORB: serverCallTimeOutPeriod = 0
omniORB: serverTransportRule = * unix,ssl,tcp
omniORB: socketSendBuffer = -1
omniORB: strictIIOP = 1
omniORB: supportBootstrapAgent = 0
omniORB: supportCurrent = 1
omniORB: supportPerThreadTimeOut = 0
omniORB: tcAliasExpand = 0
omniORB: threadPerConnectionLowerLimit = 9000
omniORB: threadPerConnectionPolicy = 1
omniORB: threadPerConnectionUpperLimit = 10000
omniORB: threadPoolWatchConnection = 1
omniORB: traceExceptions = 1
omniORB: traceFile = [stderr]
omniORB: traceInvocationReturns = 0
omniORB: traceInvocations = 0
omniORB: traceLevel = 25
omniORB: traceThreadId = 0
omniORB: traceTime = 0
omniORB: unixTransportDirectory = /tmp/omni-%u
omniORB: unixTransportPermission = 777
omniORB: useTypeCodeIndirections = 1
omniORB: validateUTF8 = 0
omniORB: verifyObjectExistsAndType = 1
omniORB: Initialising incoming endpoints.
omniORB: Instantiate endpoint 'giop:tcp::4001'
omniORB: Bind to address :: port 4001.
omniORB: Publish specification: 'addr'
omniORB: Try to publish 'addr' for endpoint giop:tcp:10.9.18.193:4001
<http://10.9.18.193:4001>
omniORB: Publish endpoint 'giop:tcp:10.9.18.193:4001
<http://10.9.18.193:4001>'
omniORB: Starting serving incoming endpoints.
omniORB: AsyncInvoker: thread id = 1 has started. Total threads = 1
omniORB: giopRendezvouser task execute for giop:tcp:10.9.18.193:4001
<http://10.9.18.193:4001>
omniORB: Adding key<Param> (activating) to object table.
omniORB: State key<Param> (activating) -> active
omniORB: Creating ref to local: key<Param>
target id : IDL:omg.org/CORBA/Object:1.0
<http://omg.org/CORBA/Object:1.0>
most derived id: IDL:Param/ParamBook:1.0
IOR:010000001800000049444c3a506172616d2f506172616d426f6f6b3a312e300001000000000000005c000000010102000c00000031302e392e31382e31393300a10f000005000000506172616d0000000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100
omniORB: SocketCollection idle. Sleeping.
omniORB: Version: 4.1.5
omniORB: Distribution date: Wed Dec 22 15:59:17 GMT 2010 dgrisby
omniORB: Skip link local address fe80::213:72ff:fe90:6d4b on interface eth0.
omniORB: Skip link local address fe80::213:72ff:fe90:6d4b on interface br0.
omniORB: 127.0.0.1
omniORB: 127.0.0.2
omniORB: 10.9.18.193
omniORB: ::1
omniORB: Maximum supported GIOP version is 1.2
omniORB: Native char code sets: ISO-8859-1 UTF-8.
omniORB: Transmission char code sets: ISO-8859-1(1.2) ISO-8859-1(1.1)
ISO-8859-1(1.0) UTF-8(1.2) UTF-8(1.1).
omniORB: Native wide char code sets: UTF-16.
omniORB: Transmission wide char code sets: UTF-16(1.2).
omniORB: Initialising omniDynamic library.
omniORB: DefaultInitRef (file) =
omniORB: DefaultInitRef (args) =
omniORB: InitRef = NameService=corbaname::localhost
omniORB: abortOnInternalError = 0
omniORB: abortOnNativeException = 0
omniORB: acceptBiDirectionalGIOP = 1
omniORB: acceptMisalignedTcIndirections = 0
omniORB: bootstrapAgentHostname =
omniORB: bootstrapAgentPort = 900
omniORB: clientCallTimeOutPeriod = 0
omniORB: clientConnectTimeOutPeriod = 0
omniORB: clientTransportRule = * unix,ssl,tcp
omniORB: configFile = /etc/omniORB.cfg
omniORB: connectionWatchImmediate = 0
omniORB: connectionWatchPeriod = 50000
omniORB: copyValuesInLocalCalls = 1
omniORB: diiThrowsSysExceptions = 0
omniORB: dumpConfiguration = 0
omniORB: endPoint = giop:tcp::4001
omniORB: endPointPublish = addr
omniORB: giopMaxMsgSize = 536870912
omniORB: giopTargetAddressMode = KeyAddr
omniORB: id = omniORB4
omniORB: idleThreadTimeout = 10
omniORB: immediateAddressSwitch = 0
omniORB: inConScanPeriod = 0
omniORB: lcdMode = 0
omniORB: maxGIOPConnectionPerServer = 100
omniORB: maxGIOPVersion = 1.2
omniORB: maxInterleavedCallsPerConnection = 5
omniORB: maxServerThreadPerConnection = 100
omniORB: maxServerThreadPoolSize = 100
omniORB: maxSocketRecv = 2147483647
omniORB: maxSocketSend = 2147483647
omniORB: nativeCharCodeSet = ISO-8859-1
omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 2
omniORB: Scavenger task execute.
omniORB: Server accepted connection from giop:tcp:[::ffff:10.9.19.20]:54325
omniORB: AsyncInvoker: thread id = 3 has started. Total threads = 3
omniORB: giopWorker task execute.
omniORB: Accepted connection from giop:tcp:[::ffff:10.9.19.20]:54325
because of this rule: "* unix,ssl,tcp"
omniORB: inputMessage: from giop:tcp:[::ffff:10.9.19.20]:54325 80 bytes
omniORB: sendChunk: to giop:tcp:[::ffff:10.9.19.20]:54325 25 bytes
omniORB: SocketCollection idle. Sleeping.
omniORB: inputMessage: from giop:tcp:[::ffff:10.9.19.20]:54325 1374 bytes
length of book: 1
Exclusion Region Data Received
omniORB: sendChunk: to giop:tcp:[::ffff:10.9.19.20]:54325 25 bytes
omniORB: SocketCollection idle. Sleeping.
// After server restart
IOR:010000001800000049444c3a506172616d2f506172616d426f6f6b3a312e300001000000000000005c000000010102000c00000031302e392e31382e31393300a10f000005000000506172616d0000000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100
omniORB: SocketCollection idle. Sleeping.
omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 2
omniORB: Scavenger task execute.
omniORB: Server accepted connection from giop:tcp:[::ffff:10.9.19.20]:54333
omniORB: AsyncInvoker: thread id = 3 has started. Total threads = 3
omniORB: giopWorker task execute.
omniORB: Accepted connection from giop:tcp:[::ffff:10.9.19.20]:54333
because of this rule: "* unix,ssl,tcp"
omniORB: inputMessage: from giop:tcp:[::ffff:10.9.19.20]:54333 1374 bytes
length of book: 1
Exclusion Region Data Received
omniORB: sendChunk: to giop:tcp:[::ffff:10.9.19.20]:54333 25 bytes
omniORB: SocketCollection idle. Sleeping.
omniORB: inputMessage: from giop:tcp:[::ffff:10.9.19.20]:54333 1374 bytes
length of book: 1
Exclusion Region Data Received
omniORB: sendChunk: to giop:tcp:[::ffff:10.9.19.20]:54333 25 bytes
omniORB: SocketCollection idle. Sleeping.
Thanks
Anirudh
_______________________________________________
omniORB-list mailing list
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
anirudh nair
2011-02-01 10:13:20 UTC
Permalink
Post by Martin B.
Analysis will be easier when you add traceException=1
Client trace with traceException=1

omniORB: (0) 2011-02-01 09:19:56.896000: Invoke '_is_a' on remote:
key<Param>
omniORB: (0) 2011-02-01 09:19:56.898000: Client attempt to connect to
giop:tcp:1
0.9.18.193:4001
omniORB: (1) 2011-02-01 09:19:56.898000: AsyncInvoker: thread id = 1 has
started
. Total threads = 1
omniORB: (1) 2011-02-01 09:19:56.899000: Scavenger task execute.
omniORB: (0) 2011-02-01 09:19:56.908000: Client opened connection to
giop:tcp:10
.9.18.193:4001
omniORB: (0) 2011-02-01 09:19:56.909000: sendChunk: to giop:tcp:
10.9.18.193:4001
80 bytes
omniORB: (0) 2011-02-01 09:19:56.911000: inputMessage: from
giop:tcp:10.9.18.193
:4001 25 bytes
omniORB: (0) 2011-02-01 09:19:56.911000: Return '_is_a' on remote:
key<Param>
omniORB: (0) 2011-02-01 09:19:56.913000: Creating ref to remote: key<Param>
target id : IDL:Param/ParamBook:1.0
most derived id:
omniORB: (0) 2011-02-01 09:19:56.914000: ObjRef() -- deleted.
omniORB: (0) 2011-02-01 09:20:10.519000: Invoke 'send_book' on remote:
key<Param
omniORB: (0) 2011-02-01 09:20:10.520000: sendChunk: to giop:tcp:
10.9.18.193:4001
3249 bytes
omniORB: (0) 2011-02-01 09:20:10.522000: inputMessage: from
giop:tcp:10.9.18.193
:4001 25 bytes
omniORB: (0) 2011-02-01 09:20:10.522000: Return 'send_book' on remote:
key<Param
// first call after server restart

omniORB: (0) 2011-02-01 09:21:07.904000: Invoke 'send_book' on remote:
key<Param
omniORB: (0) 2011-02-01 09:21:07.905000: sendChunk: to giop:tcp:
10.9.18.193:4001
3249 bytes
omniORB: (0) 2011-02-01 09:21:07.906000: Error in network receive (start of
mess
age): giop:tcp:10.9.18.193:4001
omniORB: (0) 2011-02-01 09:21:07.907000: throw giopStream::CommFailure from
giop
Stream.cc:874(0,MAYBE,COMM_FAILURE_WaitingForReply)
omniORB: (0) 2011-02-01 09:21:07.912000: Client connection refcount = 0
omniORB: (0) 2011-02-01 09:21:07.913000: Client close connection to
giop:tcp:10.
9.18.193:4001
omniORB: (0) 2011-02-01 09:21:07.916000: throw COMM_FAILURE from
omniObjRef.cc:7
84 (MAYBE,COMM_FAILURE_WaitingForReply)

// second call after server restart: No exception trrown here. Works
perfectly
omniORB: (0) 2011-02-01 09:21:07.926000: Invoke 'send_book' on remote:
key<Param
omniORB: (0) 2011-02-01 09:21:07.928000: Client attempt to connect to
giop:tcp:1
0.9.18.193:4001
omniORB: (0) 2011-02-01 09:21:07.940000: Client opened connection to
giop:tcp:10
.9.18.193:4001
omniORB: (0) 2011-02-01 09:21:07.940000: sendChunk: to giop:tcp:
10.9.18.193:4001
3249 bytes
omniORB: (0) 2011-02-01 09:21:07.945000: inputMessage: from
giop:tcp:10.9.18.193
:4001 25 bytes
omniORB: (0) 2011-02-01 09:21:07.946000: Return 'send_book' on remote:
key<Param
Thanks
Anirudh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20110201/8533b640/attachment.htm
Martin B.
2011-02-01 14:49:13 UTC
Permalink
Hmmm ... it seems to me that the client side never notices that the
server goes offline (which does seem a bit odd, I would have thought
that the server closes the connection when you restart it, which should
be apparent in the client log).

If the client never notices that the server goes offline, it's original
TCP connection on 4001 will certainly be invalid by the time the server
has restarted. (Or will it? I'm never too sure with those sockets :-)

You say you restart the server. An interesting bit of logging would be
if there's any trace of the server shutdown in the client logs. That is:
just shutdown the server, and then compare the loggings (with
timestamps) of the server and the client at and after server shutdown.

cheers,
Martin

ps: You might have noticed I'm not the biggest expert in this. Just
learning as much as you do I'd say. :-)
Post by anirudh nair
Post by Martin B.
Analysis will be easier when you add traceException=1
Client trace with traceException=1
key<Param>
omniORB: (0) 2011-02-01 09:19:56.898000: Client attempt to connect to
giop:tcp:1
0.9.18.193:4001 <http://0.9.18.193:4001>
omniORB: (1) 2011-02-01 09:19:56.898000: AsyncInvoker: thread id = 1 has
started
. Total threads = 1
omniORB: (1) 2011-02-01 09:19:56.899000: Scavenger task execute.
omniORB: (0) 2011-02-01 09:19:56.908000: Client opened connection to
giop:tcp:10
.9.18.193:4001
omniORB: (0) 2011-02-01 09:19:56.909000: sendChunk: to
giop:tcp:10.9.18.193:4001 <http://10.9.18.193:4001>
80 bytes
omniORB: (0) 2011-02-01 09:19:56.911000: inputMessage: from
giop:tcp:10.9.18.193
:4001 25 bytes
key<Param>
omniORB: (0) 2011-02-01 09:19:56.913000: Creating ref to remote: key<Param>
target id : IDL:Param/ParamBook:1.0
omniORB: (0) 2011-02-01 09:19:56.914000: ObjRef() -- deleted.
key<Param
omniORB: (0) 2011-02-01 09:20:10.520000: sendChunk: to
giop:tcp:10.9.18.193:4001 <http://10.9.18.193:4001>
3249 bytes
omniORB: (0) 2011-02-01 09:20:10.522000: inputMessage: from
giop:tcp:10.9.18.193
:4001 25 bytes
key<Param
// first call after server restart
key<Param
omniORB: (0) 2011-02-01 09:21:07.905000: sendChunk: to
giop:tcp:10.9.18.193:4001 <http://10.9.18.193:4001>
3249 bytes
omniORB: (0) 2011-02-01 09:21:07.906000: Error in network receive (start
of mess
age): giop:tcp:10.9.18.193:4001 <http://10.9.18.193:4001>
omniORB: (0) 2011-02-01 09:21:07.907000: throw giopStream::CommFailure
from giop
Stream.cc:874(0,MAYBE,COMM_FAILURE_WaitingForReply)
omniORB: (0) 2011-02-01 09:21:07.912000: Client connection refcount = 0
omniORB: (0) 2011-02-01 09:21:07.913000: Client close connection to
giop:tcp:10.
9.18.193:4001
omniORB: (0) 2011-02-01 09:21:07.916000: throw COMM_FAILURE from
omniObjRef.cc:7
84 (MAYBE,COMM_FAILURE_WaitingForReply)
// second call after server restart: No exception trrown here. Works
perfectly
key<Param
omniORB: (0) 2011-02-01 09:21:07.928000: Client attempt to connect to
giop:tcp:1
0.9.18.193:4001 <http://0.9.18.193:4001>
omniORB: (0) 2011-02-01 09:21:07.940000: Client opened connection to
giop:tcp:10
.9.18.193:4001
omniORB: (0) 2011-02-01 09:21:07.940000: sendChunk: to
giop:tcp:10.9.18.193:4001 <http://10.9.18.193:4001>
3249 bytes
omniORB: (0) 2011-02-01 09:21:07.945000: inputMessage: from
giop:tcp:10.9.18.193
:4001 25 bytes
key<Param
Thanks
Anirudh
_______________________________________________
omniORB-list mailing list
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
Duncan Grisby
2011-02-05 00:12:32 UTC
Permalink
On Fri, 2011-01-28 at 09:53 +0530, anirudh nair wrote:

[...]
Post by anirudh nair
Now, when the client calls a method after a server restart,
a COMM_FAILURE exception
is raised. The interesting thing here is that when the client catches
the exception and issues
another call to server, the server method is executed.
So, basically only the first call after the server restart raises an
exception. All calls henceforth
works fine.
That is intentional. What happens is that the client does not notice
that the connection has broken until after it has sent its request. You
snipped the bit of the omniORB log that shows the exception details but
you'll see that it has a completion status of COMPLETION_MAYBE. i.e. the
ORB knows it did not get a reply, but it does not know whether or not
the server received the call. The application might need to know that,
so the COMM_FAILURE exception is thrown.

If it had been the case that the call parameters were quite large, the
client may have received the connection error while it was transmitting
data. In that case, it would have known the completion status was
COMPLETED_NO, and it would have automatically retried the call with a
new connection, since it would know that was definitely safe to do.

If you want to automatically retry without explicitly doing so around
each call, you can register a COMM_FAILURE exception handler that
retries once. See

http://omniorb.sourceforge.net/omni41/omniORB/omniORB004.html#toc25

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Martin B.
2011-02-07 15:26:53 UTC
Permalink
Post by Duncan Grisby
[...]
Post by anirudh nair
Now, when the client calls a method after a server restart,
a COMM_FAILURE exception
is raised. The interesting thing here is that when the client catches
the exception and issues
another call to server, the server method is executed.
So, basically only the first call after the server restart raises an
exception. All calls henceforth
works fine.
That is intentional. What happens is that the client does not notice
that the connection has broken until after it has sent its request. You
snipped the bit of the omniORB log that shows the exception details but
you'll see that it has a completion status of COMPLETION_MAYBE. i.e. the
(...)
Hi Duncan,

As you can see in the else thread, I have been trying to follow this
problem, but there's one thing I do not understand:

WHY does the client not notice that the connection is broken?

From what I understand, shouldn't the server properly close it's TCP
connection to the client when it's shutting down. Shouldn't the client
notice this disconnect?

Explanation (or link to some docs) highly appreciated!

cheers,
Martin
Duncan Grisby
2011-02-10 23:31:05 UTC
Permalink
Post by Martin B.
Post by Duncan Grisby
That is intentional. What happens is that the client does not notice
that the connection has broken until after it has sent its request. You
snipped the bit of the omniORB log that shows the exception details but
you'll see that it has a completion status of COMPLETION_MAYBE. i.e. the
(...)
[...]
Post by Martin B.
WHY does the client not notice that the connection is broken?
From what I understand, shouldn't the server properly close it's TCP
connection to the client when it's shutting down. Shouldn't the client
notice this disconnect?
The way TCP sockets work means that the client doesn't learn about the
disconnect until too late.

The sequence of steps a client uses to do a call is:

1. find an existing connection to the server, or open a new one
2. perform one or more send() calls to send the request
3. block in recv() waiting for a reply
4. potentially perform more recv() calls to receive all the data

If the server has closed the connection, it is common for the OS to
report success for the send() calls. It is generally only if a large
amount of data must be sent that send() returns an error.

It is thus only when the client has sent the request and blocks in
recv() that recv() returns an error and the client knows the connection
has broken. By that stage it doesn't know whether the server received
the request or not, hence the COMPLETED_MAYBE status and the lack of
automatic retry by default.

In some circumstances, if omniORB did a poll() or select() on the socket
before its send(), it would be able to see the error state. However,
that would still be vulnerable to exactly the same situation some of the
time, and it would slow down all calls, so omniORB doesn't do that.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Martin B.
2011-02-11 13:18:58 UTC
Permalink
Post by Duncan Grisby
Post by Martin B.
Post by Duncan Grisby
That is intentional. What happens is that the client does not notice
that the connection has broken until after it has sent its request. You
snipped the bit of the omniORB log that shows the exception details but
you'll see that it has a completion status of COMPLETION_MAYBE. i.e. the
(...)
[...]
Post by Martin B.
WHY does the client not notice that the connection is broken?
From what I understand, shouldn't the server properly close it's TCP
connection to the client when it's shutting down. Shouldn't the client
notice this disconnect?
The way TCP sockets work means that the client doesn't learn about the
disconnect until too late.
1. find an existing connection to the server, or open a new one
2. perform one or more send() calls to send the request
3. block in recv() waiting for a reply
4. potentially perform more recv() calls to receive all the data
If the server has closed the connection, it is common for the OS to
report success for the send() calls. It is generally only if a large
amount of data must be sent that send() returns an error.
It is thus only when the client has sent the request and blocks in
recv() that recv() returns an error and the client knows the connection
has broken. By that stage it doesn't know whether the server received
the request or not, hence the COMPLETED_MAYBE status and the lack of
automatic retry by default.
In some circumstances, if omniORB did a poll() or select() on the socket
before its send(), it would be able to see the error state. However,
that would still be vulnerable to exactly the same situation some of the
time, and it would slow down all calls, so omniORB doesn't do that.
Oh my! Thanks a lot for explaining that!

(One day I should do some serious socket programming myself -- but who
ever needs that if one's got C-omniORB-A to do the details :-)

cheers,
Martin

Loading...