diff options
author | Phil Mesnier <mesnier_p@ociweb.com> | 2014-10-23 22:05:01 +0000 |
---|---|---|
committer | Phil Mesnier <mesnier_p@ociweb.com> | 2014-10-23 22:05:01 +0000 |
commit | b441391262639bee4242e0c042907bb875659b98 (patch) | |
tree | 19e6cdd50f3c38e60307da533840d3384cb57faa /TAO/tao | |
parent | 4b13a218761ad1401713f5a1e089a4f46c73eafa (diff) | |
download | ATCD-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')
-rw-r--r-- | TAO/tao/Invocation_Retry_State.cpp | 18 | ||||
-rw-r--r-- | TAO/tao/Invocation_Utils.h | 2 | ||||
-rw-r--r-- | TAO/tao/Synch_Invocation.cpp | 112 |
3 files changed, 82 insertions, 50 deletions
diff --git a/TAO/tao/Invocation_Retry_State.cpp b/TAO/tao/Invocation_Retry_State.cpp index 016060495c5..179572943f4 100644 --- a/TAO/tao/Invocation_Retry_State.cpp +++ b/TAO/tao/Invocation_Retry_State.cpp @@ -15,14 +15,16 @@ namespace TAO::Invocation_Retry_Params &client_factory_params, TAO::Invocation_Retry_Params &result) { - if (command_line_params.forward_on_exception_limit_[ex] != - result.forward_on_exception_limit_[ex]) - result.forward_on_exception_limit_[ex] = - command_line_params.forward_on_exception_limit_[ex]; - else if (client_factory_params.forward_on_exception_limit_[ex] != - result.forward_on_exception_limit_[ex]) - result.forward_on_exception_limit_[ex] = - client_factory_params.forward_on_exception_limit_[ex]; +#define FOEL forward_on_exception_limit_ + if (command_line_params.FOEL[ex] != result.FOEL[ex]) + { + result.FOEL[ex] = command_line_params.FOEL[ex]; + } + else if (client_factory_params.FOEL[ex] != result.FOEL[ex]) + { + result.FOEL[ex] = client_factory_params.FOEL[ex]; + } +#undef FOEL } /// Calculate the retry parameters by giving a command line parameter diff --git a/TAO/tao/Invocation_Utils.h b/TAO/tao/Invocation_Utils.h index f17df10c510..fde5751d878 100644 --- a/TAO/tao/Invocation_Utils.h +++ b/TAO/tao/Invocation_Utils.h @@ -78,6 +78,8 @@ namespace TAO FOE_COMM_FAILURE = 0x2, FOE_TRANSIENT = 0x4, FOE_INV_OBJREF = 0x8, + FOE_OBJ_ADAPTER = 0x10, + FOE_NO_RESPONSE = 0x20, FOE_ALL = 0xFFFFFFFF }; } 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); |