diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2019-04-26 07:52:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-26 07:52:51 +0200 |
commit | 629588a38264e5ff3d2fd2a0c8f866d863b332b7 (patch) | |
tree | e08cb15d12d2994bd53be3db616c98a80321e4a0 /TAO/orbsvcs/ImplRepo_Service/INS_Locator.cpp | |
parent | 26212992b6723c287d231fa0a6b8e2ebf059533c (diff) | |
parent | b940c3951fb908fcdaa3c8490803ac7459dfc0a5 (diff) | |
download | ATCD-629588a38264e5ff3d2fd2a0c8f866d863b332b7.tar.gz |
Merge pull request #893 from jwillemsen/jwi-implreprestart-889
Fixed race condition in the ImplRepo on server shutdown/restart
Diffstat (limited to 'TAO/orbsvcs/ImplRepo_Service/INS_Locator.cpp')
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/INS_Locator.cpp | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/TAO/orbsvcs/ImplRepo_Service/INS_Locator.cpp b/TAO/orbsvcs/ImplRepo_Service/INS_Locator.cpp index 1a4242e0cb0..d2da4e94eb2 100644 --- a/TAO/orbsvcs/ImplRepo_Service/INS_Locator.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/INS_Locator.cpp @@ -12,6 +12,7 @@ #include "ImR_Locator_i.h" #include "tao/ORB_Constants.h" #include "tao/ORB_Core.h" +#include "orbsvcs/Log_Macros.h" INS_Locator::INS_Locator (ImR_Locator_i& loc) : imr_locator_ (loc) @@ -63,7 +64,7 @@ INS_Locator::async_locate (::IORTable::Locate_ResponseHandler handler, //---------------------------------------------------------------------------------------- INS_Loc_ResponseHandler::INS_Loc_ResponseHandler (const char *key, ::IORTable::Locate_ResponseHandler handler) - : key_(key), + : key_str_(key), rh_ (handler) { } @@ -72,8 +73,36 @@ void INS_Loc_ResponseHandler::send_ior (const char *pior) { ACE_CString ior = pior; - ior += key_; - rh_->forward_ior (ior.c_str(), false); + + // Check that the returned ior is the expected partial ior with + // missing ObjectKey. + if (ior.find ("corbaloc:") == 0 && ior[ior.length () -1] == '/') + { + ior += key_str_; + + if (ImR_Locator_i::debug () > 5) + { + ORBSVCS_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) INS_Loc_ResponseHandler::send_ior (): Forwarding ") + ACE_TEXT ("key <%C> to IOR <%C>\n"), + key_str_.in (), ior.c_str ())); + } + rh_->forward_ior (ior.c_str(), false); + } + else + { + if (ImR_Locator_i::debug () > 1) + { + ORBSVCS_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) INS_Loc_ResponseHandler::send_ior (): Invalid corbaloc ior for key <%C> IOR <%C>\n"), + key_str_.in (), pior)); + } + + rh_->raise_excep (CORBA::OBJECT_NOT_EXIST (CORBA::SystemException::_tao_minor_code + ( TAO_IMPLREPO_MINOR_CODE, 0), + CORBA::COMPLETED_NO)); + } + delete this; } |