Problem:
- Product Name: VisiBroker
- Product Version: 8.0 and above
- Product Component: Core ORB
- Platform/OS Version: n.a.
- JDK/Compiler Version: n.a.
Setting relativeRTT property creates a thread per connection
Resolution:
Explanation on how relativeRTT property works:
When "relativeRTT" property is used, ORB will take into account the time taken to write the Request Message to the connection.
In the worse network congestion scenario, time taken to write Request Message to a connect is unnegligible. ORB creates a new WritingThread to write the Request Message to connection. If the time taken by the WritingThread exceeds the timeout Writing Thread is interrupted and TIMEOUT exception is thrown to the application. In this case, the main overhead are the thread resources (including memory) that are needed in order to enforce an accurate WRITE timeout.
WritingThread is not created once the connection is established. In fact, it is only created when the first WRITE operation occurs. However, after RequestMessage has been written to the connection, WritingThread will enter WAIT state for next RequestMesage going through the same connection.
WritingThread does not terminate after getting timed out -- instead it is interrupted from its Socket writing operation and goes back into WAIT state for the next Request Message going to the same connection. Writing Thread will be destroyed when its corresponding connection is closed. If no request are given to the same connection, Writing Thread will remain in WAIT state.
How "tcpTimeout" property Works:
Alternative, one can use "tcpTimeout" property. This property will NOT take into account of the time taken to write the RequestMessage to the connection. Therefore under worse case situation (i.e. network is in most congested situation), timeout with "tcpTimeout" will be inaccurate. It is mostly useful for timeout when reading Reply Message. There are others factors contributing to its inaccuracy.
Here are some of the limitations for vbroker.orb.tcpTimeout property:
- This property associates a timeout with ALL socket-read at client-side ORB. The specified timeout value is in milliseconds that is passed directory to setSoTimeout() in java.net.Socket.
NOTE: setting this property will disable QoS relative round trip and request timeout policies - This property is an ORB-level property, so there is no way to obtain object-level or thread-level granularity unlike QoS policies. If More than one CORBA requests are to be sent to the same connection by multiple threads concurrently, the actual time spent in reading data from socket may be greater than timeout value set per invocation.
NOTE: this property has been deprecated due to the limitation (i.e. it's set at physical socket level). It is not compliant to OMG CORBA Messaging Specification. For more information, refer to QoS relative roundtrip and request properties or policies which are well implemented and more accurate. This proopery applies only to VisiBroker for Java.
A test case is attached to this article, which explains the limitations of "tcpTimeout" property
-
Related documents: - Testcase.zip
#Security
#timeout
#VisiBroker