summaryrefslogtreecommitdiff
path: root/TAO/tao/Synch_Invocation.cpp
diff options
context:
space:
mode:
authorPhil Mesnier <mesnier_p@ociweb.com>2014-10-23 22:05:01 +0000
committerPhil Mesnier <mesnier_p@ociweb.com>2014-10-23 22:05:01 +0000
commitb441391262639bee4242e0c042907bb875659b98 (patch)
tree19e6cdd50f3c38e60307da533840d3384cb57faa /TAO/tao/Synch_Invocation.cpp
parent4b13a218761ad1401713f5a1e089a4f46c73eafa (diff)
downloadATCD-b441391262639bee4242e0c042907bb875659b98.tar.gz
Thu Oct 23 21:43:09 UTC 2014 Phil Mesnier <mesnier_p@ociweb.com>
* orbsvcs/ImplRepo_Service/AsyncAccessManager.h: * orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp: * orbsvcs/ImplRepo_Service/LiveCheck.cpp: Ensure that an AAM instance that is updated by the peer Locator is properly finalized if the new state is final. * bin/tao_other_tests.lst: * orbsvcs/tests/ImplRepo/manual_start: A test verifying the above fix. * tao/Invocation_Retry_State.cpp: * tao/Invocation_Utils.h: * tao/Synch_Invocation.cpp: Refactor the retry decision code to be more comprehendable.
Diffstat (limited to 'TAO/tao/Synch_Invocation.cpp')
-rw-r--r--TAO/tao/Synch_Invocation.cpp112
1 files changed, 70 insertions, 42 deletions
diff --git a/TAO/tao/Synch_Invocation.cpp b/TAO/tao/Synch_Invocation.cpp
index 8c2a3271a79..87c593f2cc6 100644
--- a/TAO/tao/Synch_Invocation.cpp
+++ b/TAO/tao/Synch_Invocation.cpp
@@ -32,6 +32,45 @@
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+namespace
+{
+ int
+ excep_for_type (const char *tid)
+ {
+ if (ACE_OS_String::strcmp (tid, "IDL:omg.org/CORBA/TRANSIENT:1.0") == 0)
+ {
+ return TAO::FOE_TRANSIENT;
+ }
+ else if (ACE_OS_String::strcmp (tid,
+ "IDL:omg.org/CORBA/COMM_FAILURE:1.0") == 0)
+ {
+ return TAO::FOE_COMM_FAILURE;
+ }
+ else if (ACE_OS_String::strcmp (tid,
+ "IDL:omg.org/CORBA/OBJECT_NOT_EXIST:1.0") == 0)
+ {
+ return TAO::FOE_OBJECT_NOT_EXIST;
+ }
+ else if (ACE_OS_String::strcmp (tid,
+ "IDL:omg.org/CORBA/INV_OBJREF:1.0") == 0)
+ {
+ return TAO::FOE_INV_OBJREF;
+ }
+ else if (ACE_OS_String::strcmp (tid,
+ "IDL:omg.org/CORBA/OBJ_ADAPTER:1.0") == 0)
+ {
+ return TAO::FOE_OBJ_ADAPTER;
+ }
+ else if (ACE_OS_String::strcmp (tid,
+ "IDL:omg.org/CORBA/NO_RESPONSE:1.0") == 0)
+ {
+ return TAO::FOE_NO_RESPONSE;
+ }
+
+ return 0;
+ }
+}
+
namespace TAO
{
Synch_Twoway_Invocation::Synch_Twoway_Invocation (
@@ -584,19 +623,7 @@ namespace TAO
this->retry_state_->forward_on_exception_limit_used () &&
(CORBA::CompletionStatus) completion == CORBA::COMPLETED_NO)
{
- if ((ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/TRANSIENT:1.0") == 0 &&
- this->retry_state_->forward_on_exception_increment (TAO::FOE_TRANSIENT)) ||
- (ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/COMM_FAILURE:1.0") == 0 &&
- this->retry_state_->forward_on_exception_increment (TAO::FOE_COMM_FAILURE)) ||
- (ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/OBJECT_NOT_EXIST:1.0") == 0 &&
- this->retry_state_->forward_on_exception_increment (TAO::FOE_OBJECT_NOT_EXIST)) ||
- (ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/INV_OBJREF:1.0") == 0 &&
- this->retry_state_->forward_on_exception_increment (TAO::FOE_INV_OBJREF))
- )
+ if (this->retry_state_->forward_on_exception_increment (excep_for_type (type_id.in ())))
{
retry_on_exception = true;
this->retry_state_->sleep_at_starting_profile (*this->stub ());
@@ -605,38 +632,39 @@ namespace TAO
else
{
int foe_kind = orb_params->forward_once_exception();
+ int ex_id = excep_for_type (type_id.in ());
- retry_on_exception =
- (CORBA::CompletionStatus) completion != CORBA::COMPLETED_YES
- && (((foe_kind & TAO::FOE_TRANSIENT) == 0
- && ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/TRANSIENT:1.0") == 0) ||
- ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/OBJ_ADAPTER:1.0") == 0 ||
- ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/NO_RESPONSE:1.0") == 0 ||
- ((foe_kind & TAO::FOE_COMM_FAILURE) == 0
- && ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/COMM_FAILURE:1.0") == 0) ||
- (orb_params->forward_invocation_on_object_not_exist ()
- && ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/OBJECT_NOT_EXIST:1.0") == 0) ||
- (do_forward = ! this->stub ()->forwarded_on_exception ()
- && ((((foe_kind & TAO::FOE_OBJECT_NOT_EXIST) == TAO::FOE_OBJECT_NOT_EXIST)
- && (ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/OBJECT_NOT_EXIST:1.0") == 0)) ||
- (((foe_kind & TAO::FOE_COMM_FAILURE) == TAO::FOE_COMM_FAILURE)
- && (ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/COMM_FAILURE:1.0") == 0)) ||
- (((foe_kind & TAO::FOE_TRANSIENT) == TAO::FOE_TRANSIENT)
- && (ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/TRANSIENT:1.0") == 0)) ||
- (((foe_kind & TAO::FOE_INV_OBJREF) == TAO::FOE_INV_OBJREF)
- && (ACE_OS_String::strcmp (type_id.in (),
- "IDL:omg.org/CORBA/INV_OBJREF:1.0") == 0)))));
+ // this logic is a little confusing but prior to Jul 24 2009, TRANSIENT,
+ // OBJ_ADAPTER, NO_RESPONSE, and COMM_FAILURE were always retried if possible.
+ // Later, the ForwardOnceOn* were added, which reverts to default behavior
+ // when not set.
+ if ((CORBA::CompletionStatus) completion != CORBA::COMPLETED_YES)
+ {
+ switch (ex_id)
+ {
+ case TAO::FOE_TRANSIENT:
+ case TAO::FOE_COMM_FAILURE:
+ retry_on_exception = (foe_kind & ex_id) == 0;
+ break;
+ case TAO::FOE_OBJ_ADAPTER:
+ case TAO::FOE_NO_RESPONSE:
+ retry_on_exception = true;
+ break;
+ case TAO::FOE_OBJECT_NOT_EXIST:
+ retry_on_exception = orb_params->forward_invocation_on_object_not_exist ();
+ break;
+ default:
+ break;
+ }
+ if (!retry_on_exception)
+ {
+ do_forward = !this->stub ()->forwarded_on_exception () &&
+ ((foe_kind & ex_id) == ex_id);
+ }
+ }
}
- if (retry_on_exception)
+ if (retry_on_exception || do_forward)
{
// If we are here then possibly we'll need a restart.
mon.set_status (TAO_INVOKE_RESTART);