[OPEN-ILS-DEV] Bug with start_all in opensrf.py?

Dan Scott dan at coffeecode.net
Tue Nov 9 17:01:03 EST 2010


On Tue, Nov 09, 2010 at 08:51:49AM -0500, Bill Erickson wrote:
> On Mon, Nov 8, 2010 at 9:07 PM, Michael J. Giarlo <
> leftwing at alumni.rutgers.edu> wrote:
> 
> > On Mon, Nov 8, 2010 at 20:42, Dan Scott <dan at coffeecode.net> wrote:
> > >
> > > I'd like to see the opensrf.xml file, personally!
> > >
> >
> 
> 
> Does anything interesting come up with: egrep "ERR|WARN" osrfsys.log?
> 
> You could also try un-commenting the exception handling at the end of
> osrf.server:run() (around line 121) and trying the test again.

The behaviour of opensrf.py is interesting and annoying, in that
repeatedly running the following commands returns different results
for the number of opensrf.py processes:

/openils/bin/opensrf.py -l -a restart_all
ps wax | grep opensrf.py | wc -l

The PID files for each service get created, and adding a loop within
opensrf.py to check for the existence of the PID via os.getsid()
suggests that it truly is there - but then, in most cases, only two of
the services actually continue to run after opensrf.py finishes forking
the parent processes for the daemons.

It seems like forking daemons within a Python script that in turn fork
child processes just isn't working. Probably something stupid on my part
that I haven't seen, but so be it...

To make this work, I added a "list_all" function to opensrf.py that just
returns the list of Python OpenSRF services from the configuration file,
and then changed the "start_python" implementation in osrf_ctl.sh to
invoke list_all, and then starts each service separately. It feels
dirty, but it seems to do the trick.

While I was poking around in the OpenSRF Python codebase today I
cleaned up a number of other obvious problems, although pylint says that
there are calls to non-existent methods that still need love, such as:

E:407:ServerRequest._build_complete_msg: Class 'NetworkObject' has no
'osrfMessage' member

Still, the march towards a solid Python OpenSRF infrastructure
continues. Thanks for the continuing feedback, Michael; you're pushing
us towards a good place!


More information about the Open-ils-dev mailing list