Hi there,
I would like to know what is the proper actions that have to be done in order to shutdown the orb gracefully.
I have an application which connect to the server using this string:
-ORBDottedDecimalAddresses 1
-ORBInitRef NameService=corbaloc:ssliop:%s:23201/NameService
-ORBEndpoint iiop://shlomile:6666
As you can see I’m using the ORBEndPoint with a specific port.
The problem is when the Server is being shutting down and my application is destroying the root_poa and the orb and then trying to init the orb again,
While trying to init the orb again (With the same ORBEndPoint string) I’m getting a BAD_PARAM exception because the port 6666 (That was used in the previous EndPoint string) is still being occupied (when running netstat I see that the port 6666 is still on LISTENING status).
How can I verify that all the TCP connection is being closing properly? The Listening and Outgoing ports.
I would like to be able to init the orb again with the same ORBEndPoint string without terminating the process.
Thanks for your help
Shlomi Levi
Software Engineer
CTI Group, EIS R&D
NICE Systems Ltd. Israel
(T) +972 (9) 7753655
(F) +972 (9) 7753600
> I would like to know what is the proper actions that have to be done in order to shutdown the orb gracefully.
To ensure that we have proper version/platform/compiler information,
please make sure you fill out the appropriate problem report form (PRF),
which is in
$ACE_ROOT/PROBLEM-REPORT-FORM
$TAO_ROOT/PROBLEM-REPORT-FORM
or in
$ACE_ROOT/BUG-REPORT-FORM
$TAO_ROOT/BUG-REPORT-FORM
in older versions of ACE+TAO. Make sure to include this information
when asking any questions about ACE+TAO since otherwise we have to
"guess" what version/platform/compiler/options you've using, which is
very error-prone and slows down our responsiveness. If you don't use
the PRF, therefore, it is less likely that someone from the core
ACE+TAO developer team will be able to answer your question.
Naturally, we encourage and appreciate other members of the ACE+TAO
user community who can respond to questions that they have the answers
to.
Thanks,
Doug
> _______________________________________________
> tao-users mailing list
> tao-...@list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/tao-users
> Please see attached PRF.
> TAO VERSION: 1.4.6
> ACE VERSION: 5.4.6
Thanks for using the PRF!
> Please Note: Currently I can't move on to the newer ACE/TAO version since this application is being running on our customer's machine
> and the customer doesn't allow us to do any code modification.
> I will move on to the newer ACE/TAO with our new application version - but still need to fix the problem with TAO 1.4.6
>
> I would like to know what is the proper actions that have to be done in order to shutdown the orb gracefully and cleaning all listening ports created by OrbEndPoint configuration - Please check the PRF for detailed information.
If you can't upgrade to ACE+TAO x.6.6 (i.e., ACE 5.6.6 and TAO 1.6.6 I
recommend that you check out
http://www.dre.vanderbilt.edu/support.html
for a list of companies that will provide you with ACE+TAO commercial
support for older versions of ACE+TAO.
Thanks very much,
Doug
> I would like to know what is the proper actions that have to be done
> in order to shutdown the orb gracefully and cleaning all listening
> ports created by OrbEndPoint configuration - Please check the PRF
> for detailed information.
I didn't read the PRF, but in general teardown is the reverse of
startup. So, to tear down, you would do something like:
- destroy POAs
- shutdown ORB
- destroy ORB
It's very possible that the version of TAO you're using has a
descriptor leak, or it might be related to configuration options
you've chosen.
---
Chris Cleeland, Principal Software Engineer
http://www.theaceorb.com AND http://www.ociweb.com
if ( !CORBA::is_nil( oPoa.ptr() ) )
{
oPoa->destroy( true, true );
oPoa = PortableServer::POA::_nil();
}
if( oOrb->work_pending() )
{
oOrb->perform_work();
}
oOrb->shutdown(true);
oOrb->destroy();
// assert that there are no more servants, etc. active
oOrb->_incr_refcnt();
int v = (int)oOrb->_decr_refcnt();
ASSERT( v == 1 );
// oOrb = CORBA::ORB::_nil() will decrement last reference counter
to zero
If reference counter is not yet 1, this means that a servant or something
else still holds a reference to the existing orb.
My guess is that when you then call init again (for example if v is 4),
you will get the same orb instead of a new one.
Thanks for the info mate!
I did get v=6 which mean that a servant or something else still holds a reference to the existing orb.
Doesn't the orb shutdown/destroy function kill all the orb reference?
Is there any option to tell the orb to kill all the reference to it?
Is it possible that the server is holding a reference to my orb since my application is Mixed Tao Client and Server?
Thanks in advance
Shlomi
>I did get v=6 which mean that a servant or something else still holds a
>reference to the existing orb.
>Doesn't the orb shutdown/destroy function kill all the orb reference?
Not necessarily, particularly if your code holds a reference to the ORB. Calling ORB::shutdown()/destroy() should cleanup the resources held by the ORB, but the ORB object itself may still exist, albeit in a form that may not be very useful.
>Is there any option to tell the orb to kill all the reference to it?
It shouldn't be necessary to do that if the reference count is properly managed. Doing so also defeats the purpose of reference counting.
>Is it possible that the server is holding a reference to my orb since my
>application is Mixed Tao Client and Server?
Possibly, but I don't think the reference count is the issue here, at least not if you're calling ORB::shutdown and ORB::destroy(). Those method calls should take care of the OS resource cleanup regardless of the reference count.
I recall that Phil Mesnier at OCI addressed a file descriptor leak in TAO's pluggable protocol framework. It's possible that you're running into that same problem. Do you have the same problem with the latest version of TAO?
HTH,
-Ossama
By the way, can somebody explain me the parameter "etherialize_objects" of
the POA->destroy(..) method?
virtual void destroy (
::CORBA::Boolean etherealize_objects,
::CORBA::Boolean wait_for_completion) = 0;
In the OCI Dev Guide Index there is only one page for "etherealize" (629),
but this does not explain anything at all.
If i try to translate "ethereal" it does not make sense neither.
dict.leo.org proposes me something like "heavenly".
Synonyms of verb etherealize, etherialise
"change, alter, modify"
So simple question, what should be the parameter to destroy the poa?
oPoa->destroy(true, true);
Michael...@leica-geosystems.com wrote:
> By the way, can somebody explain me the parameter "etherialize_objects" of
> the POA->destroy(..) method?
> virtual void destroy (
> ::CORBA::Boolean etherealize_objects,
> ::CORBA::Boolean wait_for_completion) = 0;
>
> In the OCI Dev Guide Index there is only one page for "etherealize" (629),
> but this does not explain anything at all.
Right. The OCI TAO Developer's Guide is meant to augment other
documentation about CORBA, such as the OMG specification or the
1999 Henning & Vinoski book "Advanced CORBA Programming with C++"
(H&V), not to be a complete CORBA reference manual.
> If i try to translate "ethereal" it does not make sense neither.
> dict.leo.org proposes me something like "heavenly".
>
> Synonyms of verb etherealize, etherialise
> "change, alter, modify"
I recommend reading what H&V says about POA destruction. I don't
have my copy handy, so I cannot point you to a specific chapter
and section.
In general, to "etherealize" a servant in CORBA means to tear down
the association between that servant and a given CORBA object
(where that association is maintained by the POA). It is the
opposite of "incarnate", which means to create an association
between a servant and a CORBA object. H&V explains it very well.
With respect to the etherealize_objects parameter to
PortableServer::POA::destroy(), the CORBA 3.1 specification says,
in section 15.3.9.3:
> If the etherealize_objects parameter is TRUE, the POA has the
> RETAIN policy, and a servant manager is
> registered with the POA, the etherealize operation on the
> servant manager is called for each active object in the
> Active Object Map. The apparent destruction of the POA occurs
> before any calls to etherealize are made. Thus, for
> example, an etherealize method that attempts to invoke
> operations on the POA receives the
> OBJECT_NOT_EXIST exception.
If the POA has the RETAIN policy and a servant manager (in this
case, it would be a Servant Activator), then during destruction,
the POA will iterate through the Active Object Map and call the
servant manager's etherealize() operation, passing it each servant
in its Active Object Map. The servant manager is provided by the
application developer, so it may decide to decrement the servant's
reference count, or do some other clean-up, or whatever the
application developer wants.
So, unless you are using a Servant Activator with your POA, you
probably do not need to worry about the etherealize_objects
parameter.
> So simple question, what should be the parameter to destroy the poa?
> oPoa->destroy(true, true);
It depends on what you want to do, and whether or not you are
using a Servant Activator.
Steve
--
----------------------------------------------------------------
Steve Totten, Principal Software Engineer and Partner
Object Computing, Inc. (OCI), St. Louis, MO, USA
http://www.ociweb.com/ http://www.theaceorb.com/
----------------------------------------------------------------
> By the way, can somebody explain me the parameter "etherialize_objects" of
> the POA->destroy(..) method?
> virtual void destroy (
> ::CORBA::Boolean etherealize_objects,
> ::CORBA::Boolean wait_for_completion) = 0;
"etheralize" essential means "to make disappear," i.e., "destroy". Check
out the discussion of "etherealize" in the article at
http://www.cs.wustl.edu/~schmidt/PDF/C++-report-col11.pdf
> In the OCI Dev Guide Index there is only one page for "etherealize" (629),
> but this does not explain anything at all.
> If i try to translate "ethereal" it does not make sense neither.
> dict.leo.org proposes me something like "heavenly".
>
> Synonyms of verb etherealize, etherialise
> "change, alter, modify"
>
> So simple question, what should be the parameter to destroy the poa?
> oPoa->destroy(true, true);
Yes, that's correct - assuming that you want to destroy objects and wait
for completion. You should get a copy of "Advanced CORBA Programming
with C++" by Henning/Vinoski for more details about this sort of stuff.
Thanks,
Doug