[Zope-Checkins] CVS: Zope/lib/python/nt_svcutils - service.py:1.1.2.2

Tim Peters tim.peters at gmail.com
Mon Apr 18 23:11:01 EDT 2005


Mark and Sidnei, question for you.  I work on ZRS, which, alas, I
can't pass out code for.  Its Windows service drivers subclass the
Service class in Zope's nt_svcutils/service.py.

I'm trying to build a new ZRS release.  Trying to stop the ZRS service
now "suddenly and for no reason at all" <wink> logs an error, because
I believe its onStop() method is getting called twice now, but used to
be called only once.  That's no good for ZRS, because its onStop
method makes a connection to a special "shutdown port", and ZRS proper
responds by shutting ZRS down.  The socket goes away along with it, so
trying to connect to the shutdown port a second time raises an
exception.

I'm not entirely sure why this didn't used to happen.  I'm guessing
that a stop request with the current code:

1. Triggers SvcStop, which calls onStop() and sets hWaitStop.
2. Setting hWaitStop in turn triggers the WaitForMultipleObjects in run(),
   and then that calls SvcStop again (which calls onStop() again).

Anyway, is this bug or feature?  If it's a feature, I can make the ZRS
subclass onStop() methods safe to call multiple times.  It doesn't
_feel_ like a feature, though <wink>.


More information about the Zope-Checkins mailing list