[omniORB] Forks, BOA, ports and persistence
Nick Brook
ncb@adaptivebroadband.com
Thu, 10 Jun 1999 16:36:09 +0100
Hi folks,
This is a long one, but please bear with me. Basically I'm trying to
implement a persistent objects framework using a process model instead
of a fork model. By persistence I mean that I create servant objects
using the same omniORB key and on the same BOAiiop_port so that their
IORs remain the same for different runs. This is quite straight-forward
to do using a thread model.
However I get problems when I move to a process model. I've implemented
this by putting each servant in it's own executable, with it's own ORB
and BOA. Whenever a factory object is asked to create a child object it
first forks, then calls execlp on the name of the executable. The
executable initialises the ORB and the BOA with the BOAiiop_port set to
a fixed port allocated to the child object by the parent factory. It
then creates the servant and sends the stringified IOR back to the
parent factory, which de-stringifies this and returns a reference to the
object.
Right, well this all works - up to a point. However problems arise when
you kill a parent (factory) process: I find by netstat that even after I
kill it there is still a TCP connection open on LISTEN for the port
associated with that object. In fact I can kill ALL the parents /
grandparents / etc. leaving only the children and STILL all these ports
are LISTENing. But there's no process around that could be doing the
LISTENing, unless the child process is somehow listening all every port
that has ever been used by a BOA. Weird.
As a result of this I can't reincarnate a parent object if it has died
unexpectedly as it's port is currently in use by it's children, unless I
kill all it's decendents, which is rather anti-social.
Any ideas would be greatly appreciated, even if it's "You can't do
that!",
Cheers,
Nick Brook
Adaptive Broadband Ltd,
Cambridge,
UK