Skip to content

[BZ-1273] LOCATION_FORWARD profile not tried to completion #1273

@jwillemsen

Description

@jwillemsen
Field Value
Bugzilla ID 1273
Reporter Nanbor Wang
Assigned to DOC Center Support List (internal)
Product TAO
Component ORB
Version 1.2.3
Platform / OS All / All
Priority P3
Severity normal
Status NEW
Resolution
Created 2002-08-08 20:04:52 -0500

Originally posted by Nanbor Wang on 2002-08-08 20:04:52 -0500


Missed to add this to the bugzilla. Here is a bug report from Silvain Laplante
SLaplante@interstarinc.com

--------------------------- Cut Here --------------------------------------

TAO VERSION: 1.2.1
ACE VERSION: 5.2.1

HOST MACHINE and OPERATING SYSTEM:
    PIII Windows2000
COMPILER NAME AND VERSION (AND PATCHLEVEL):
    MSVC 6.0 SP5

AREA/CLASS/EXAMPLE AFFECTED:

DOES THE PROBLEM AFFECT:
    COMPILATION?
        No
    LINKING?
        No
    EXECUTION?
        Yes
    OTHER (please specify)?

SYNOPSIS:

Only the first profile of a multiprofile location_forward is used by the
stub.
DESCRIPTION:
Calls to TAO_Stub::next_profile_retry (from
TAO_Default_Endpoint_Selector::select_endpoint) ends up to "try" only the
first profile of each multiprofile location_forward. However this is not
the
case for the TAO_Stub::base_profiles_. My fix for this problem is a
modification to TAO_Stub::next_profile_retry (see FIX A).

Also, I modified TAO_Stub::add_forward_profiles to work as a
"TAO_Stub::replace_forward_profiles" to avoid excessive chaining of
multiprofiles on long runs with a lot of location_forward events. My
modification is presented in FIX B.

Modifications are delimited by
/* FIX: MODIFICATION BEGIN /
...
/
FIX: MODIFICATION END */

Why are the location_forward_from chained ? Does the modification
presented in FIX B break something in the location_forward specification ?

REPEAT BY:

SAMPLE FIX/WORKAROUND:

FIX A) Modification to TAO_Stub::next_profile_retry
File: TAO/tao/Stub.i

ACE_INLINE CORBA::Boolean
TAO_Stub::next_profile_retry (void)
{
ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
guard,
*this->profile_lock_ptr_,
0));

if (this->profile_success_ && this->forward_profiles_)
{
/* FIX: MODIFICATION BEGIN /
if (this->set_profile_in_use_i (this->forward_profiles_->get_next ()))
{
return 1;
}
/
FIX: MODIFICATION END */
this->reset_profiles_i ();
return 1;
}
else if (this->next_profile_i ())
{
return 1;
}

return 0;
#if 0
else
{
// Check whether the loaded services have something to say about
// this condition
TAO_Profile *prof = 0;
this->orb_core_->service_profile_reselection (this,
prof);

  // If the service is loaded and has a profile then try it.
  if (prof)
    {
      return 1;
    }
  this->reset_profiles_i ();
  return 0;
}

#endif /*If 0 */
}

FIX B) Modification to TAO_Stub::add_forward_profiles
File: TAO/tao/Stub.cpp

void
TAO_Stub::add_forward_profiles (const TAO_MProfile &mprofiles)
{
// we assume that the profile_in_use_ is being
// forwarded! Grab the lock so things don't change.
ACE_MT (ACE_GUARD (ACE_Lock,
guard,
*this->profile_lock_ptr_));

/* FIX: MODIFICATION BEGIN */
//TAO_MProfile *now_pfiles = this->forward_profiles_;
//if (now_pfiles == 0)
// now_pfiles = &this->base_profiles_;
TAO_MProfile now_pfiles = &this->base_profiles_;
if (this->forward_profiles_ != 0)
delete this->forward_profiles_;
/
FIX: MODIFICATION END */

ACE_NEW (this->forward_profiles_,
TAO_MProfile (mprofiles));
// forwarded profile points to the new IOR (profiles)
this->profile_in_use_->forward_to (this->forward_profiles_);

// new profile list points back to the list which was forwarded.
this->forward_profiles_->forward_from (now_pfiles);

// make sure we start at the beginning of mprofiles
this->forward_profiles_->rewind ();

// Since we have been forwarded, we must set profile_success_ to 0
// since we are starting a new with a new set of profiles!
this->profile_success_ = 0;

// Reset any flags that may be appropriate in the services that
// selects profiles for invocation
this->orb_core_->reset_service_profile_flags ();
}

Silvain Laplante
Software Developer
Interstar Technologies Inc.


We cannot apply this patch since there ar other things that are broken here.
Please see bug 1237, 1238 and 1239 for details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions