On 10/7/05, Tim Roberts <[EMAIL PROTECTED]> wrote:
> On Thu, 6 Oct 2005 16:20:01 +0100, Paul Moore <[EMAIL PROTECTED]> wrote
>
> >Debugging service RegistryQueryService - press Ctrl+C to stop.
> >Stopping debug service.
> >Stopping debug service.
> >Error 0xC000000B - The Python service control handler failed.
> >
> >  File "C:\Apps\Python24\lib\site-packages\win32\lib\win32serviceutil.py", 
> > line
> >701, in ServiceCtrlHandler
> >    self.SvcStop()
> >  File "D:\Data\RegQueries\service.py", line 14, in SvcStop
> >
> >exceptions.AttributeError: Registry instance has no attribute 'stop'
>
> 0xC000000B is "invalid client ID".  If I had to guess, I'd guess that it
> actually WAS executing self.reg.stop(), but is getting an error during
> some OS operation, and the interpreter is misdiagnosing the results.
>
> What does self.reg.stop() do?  Is it possible you're doing some
> operation that tries to cross a user boundary?  Services run as
> LOCAL_SYSTEM, and there are some things you can't do to service processes.

Ah. I hadn't noticed the hex error number, and was completely
sidetracked by the error saying that the stop attribute didn't exist
:-(

I don't know quite what was going on, but I rewrote the mainloop/stop
interaction (for other reasons, mainly) and the problem went away.

FWIW, the mainloop function was waiting on an Oracle pipe for
requests, then spawning threads to handle the requests. The stop
function was putting a "quit processing" request into the pipe. It
should be OK, but Oracle isn't always very happy with being run in odd
environments (and I think running a multithreaded Windows service in
debug mode probably counts :-)) so I'm going to put it down to
experience. The lesson for me is to be very careful to trap *all*
possible errors from Oracle functions, and don't block forever in
Oracle API calls - I suspect the significant change was moving from an
infinite timeout on the wait, to waiting for 1 second and then going
back round the Python main loop.

Anyway, thanks for pointing me at the real explanation of the problem.

Paul.
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to