Bug 2658 - the_servant in Servant_Locator::postinvoke is zero when preinvoke throws OBJECT_NOT_EXIST
Summary: the_servant in Servant_Locator::postinvoke is zero when preinvoke throws OBJE...
Status: RESOLVED FIXED
Alias: None
Product: TAO
Classification: Unclassified
Component: POA (show other bugs)
Version: 1.5.2
Hardware: All All
: P3 normal
Assignee: DOC Center Support List (internal)
URL:
Depends on: 2511
Blocks:
  Show dependency tree
 
Reported: 2006-09-25 16:00 CDT by milan.cvetkovic
Modified: 2007-02-21 06:34 CST (History)
0 users

See Also:


Attachments
Suggested fic (524 bytes, patch)
2006-09-25 16:03 CDT, milan.cvetkovic
Details
Test case exposing where postinvoke's the_servant is zero (5.54 KB, application/octet-stream)
2006-09-25 16:05 CDT, milan.cvetkovic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description milan.cvetkovic 2006-09-25 16:00:56 CDT
TAO VERSION: 1.5.1
    ACE VERSION: 5.5.1

    HOST MACHINE and OPERATING SYSTEM:
        Sun Sparc Solaris 8

    COMPILER NAME AND VERSION (AND PATCHLEVEL):
        g++-2.95.2

    THE $ACE_ROOT/ace/config.h FILE:
        config-sunos5.8.h

    THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE:
        platform_sunos5_g++.GNU

    AREA/CLASS/EXAMPLE AFFECTED:
        ServantLocator

    DOES THE PROBLEM AFFECT:
        EXECUTION

    SYNOPSIS:
        Occasionally, my ServantLocator receives postinvoke with
        the_servant set to zero.

    DESCRIPTION:

My servant locator occasionally throws OBJECT_NOT_EXIST. I was not
expecting that in this case ServantLocator::postinvoke would be invoked.
However, it is being invoked with the_servant parameter set to zero.

According to the spec:


Well, it seems that TAO does it that way, but this behavior is not
compliant to CORBA spec. In 04-03-12.pdf, Section 11.3.7 "ServantLocator
Interface", the last paragraph:


>> If preinvoke raises an exception, postinvoke is not called. Otherwise
>> the preinvoke and postinvoke operations are always called in pairs in
>> response to any ORB activity. In particular, for a response to a GIOP
>> Locate message a GIOPconforming ORB may (or may not) call preinvoke to
>> determine whether the object could be served at this location. If the
>> ORB makes such a call, whatever the result, the ORB does not invoke a
>> method, but does call postinvoke before responding to the Locate
>> message.

    WORKAROUND:
(possible workaround) add "if (the_servant)" in the body of my
postinvoke function.
Comment 1 milan.cvetkovic 2006-09-25 16:03:47 CDT
Created attachment 607 [details]
Suggested fic
Comment 2 milan.cvetkovic 2006-09-25 16:05:26 CDT
Created attachment 608 [details]
Test case exposing where postinvoke's the_servant is zero
Comment 3 Johnny Willemsen 2006-09-27 02:11:21 CDT
accept on behalf of support, corrected component
Comment 4 Johnny Willemsen 2006-09-27 02:15:22 CDT
acept again
Comment 5 Johnny Willemsen 2007-02-21 06:34:58 CST
Wed Feb 21 12:23:12 UTC 2007  Johnny Willemsen  <jwillemsen@remedy.nl>

        * tests/POA/Bug_2511_Regression/server.cpp:
          Return the error count, in case of a failure then the test
          framework will notice this

        * tao/PortableServer/RequestProcessingStrategyServantLocator.cpp:
          Don't call postinvoke when we don't have a servant. Fixes bugzilla
          bugs 2511 and 2658. Thanks to Martin Cornelius
          <Martin dot Cornelius at smiths-heimann dot com> and Milan
          Cvetkovic <milan dot cvetkovic at mpathix dot com> for reporting
          this and providing a test case and a proposed fix.