[Bug 752] New: deployer-corba shuts down Orb before stopping components

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=752

Summary: deployer-corba shuts down Orb before stopping
components
Product: OCL
Version: 1.10.1
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P3
Component: Deployment
AssignedTo: orocos-dev [..] ...
ReportedBy: alexis [..] ...
CC: orocos-dev [..] ..., alexis [..] ...
Estimated Hours: 0.0

The Corba deployer connects to the orb before starting its components (which is
nice, it allows them to communicate as they start), but it shuts down and
destroys the Orb connection before the components stop/cleanup/unload sequence
which means the components can't use Corba to communicate as they shut down.

Currently the DeploymentComponent's dtor calls kickOutAll() which does the
stop/cleanup/unload of components. Unfortunately forcing the dtor earlier
(e.g. limiting its scope) causes the subsequent ShutdownOrb() to fail.

It also appears that kickOutAll() should only be called if the boolean property
"AutoUnload" is true (as is done in the dtor).

Please consider applying something equivalent to the following short patch:

--- orocos-ocl-1.10.1/bin/deployer-corba.orig.cpp
+++ orocos-ocl-1.10.1/bin/deployer-corba.cpp
@@ -95,6 +95,9 @@

tb.loop();

+ if (dc.properties()->getProperty<bool>("AutoUnload")->get())
+ dc.kickOutAll();
+
ControlTaskServer::ShutdownOrb();

ControlTaskServer::DestroyOrb();

[Bug 752] deployer-corba shuts down Orb before stopping componen

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=752

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution| |FIXED
Status|ASSIGNED |RESOLVED

--- Comment #2 from Peter Soetens <peter [..] ...> 2010-02-22 11:50:41 ---
I fixed this issue on 1.x trunks and the 2.0 mainlines, both RTT (r31415) and
OCL (r31416,31417). Can't be backported to 1.10.

There was little bookkeeping going on in the cleanup phase, and the
ControlTaskServer class did not allow to cleanup a single TaskContext. Each
Corba ControlTask server will be cleaned up when the deployer cleans up a
component ('unloading'), including itself.

In normal situations, you should not see any corba/orb related warnings or
errors anymore when cdeployer or deployer-corba exits.

Peter

[Bug 752] deployer-corba shuts down Orb before stopping componen

On Feb 22, 2010, at 05:50 , Peter Soetens wrote:

> https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=752
>
>
> Peter Soetens <peter [..] ...> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> Resolution| |FIXED
> Status|ASSIGNED |RESOLVED
>
>
>
>
> --- Comment #2 from Peter Soetens <peter [..] ...> 2010-02-22 11:50:41 ---
> I fixed this issue on 1.x trunks and the 2.0 mainlines, both RTT (r31415) and
> OCL (r31416,31417). Can't be backported to 1.10.
>
> There was little bookkeeping going on in the cleanup phase, and the
> ControlTaskServer class did not allow to cleanup a single TaskContext. Each
> Corba ControlTask server will be cleaned up when the deployer cleans up a
> component ('unloading'), including itself.
>
> In normal situations, you should not see any corba/orb related warnings or
> errors anymore when cdeployer or deployer-corba exits.

Wahoo!!! Good to hear this, Peter. It's always been odd to explain to my customers, "you can just ignore any warnings like this ..." :-)
Stephen

[Bug 752] deployer-corba shuts down Orb before stopping componen

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=752

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED

--- Comment #1 from Peter Soetens <peter [..] ...> 2010-02-22 10:42:14 ---
(In reply to comment #0)
> The Corba deployer connects to the orb before starting its components (which is
> nice, it allows them to communicate as they start), but it shuts down and
> destroys the Orb connection before the components stop/cleanup/unload sequence
> which means the components can't use Corba to communicate as they shut down.
>
> Currently the DeploymentComponent's dtor calls kickOutAll() which does the
> stop/cleanup/unload of components. Unfortunately forcing the dtor earlier (e.g.
> limiting its scope) causes the subsequent ShutdownOrb() to fail.
>
> It also appears that kickOutAll() should only be called if the boolean property
> "AutoUnload" is true (as is done in the dtor).
>
> Please consider applying something equivalent to the following short patch:
>
> --- orocos-ocl-1.10.1/bin/deployer-corba.orig.cpp
> +++ orocos-ocl-1.10.1/bin/deployer-corba.cpp
> @@ -95,6 +95,9 @@
>
> tb.loop();
>
> + if (dc.properties()->getProperty<bool>("AutoUnload")->get())
> + dc.kickOutAll();
> +
> ControlTaskServer::ShutdownOrb();
>
> ControlTaskServer::DestroyOrb();

Thanks for the report. I believe limiting the scope of the deployment component
should be the correct fix, and then figure out why ShutdownOrb fails.

Peter