try except question - serious foo bar question, and pulling my hair out :-)

Laszlo Nagy gandalf at shopzeus.com
Tue Feb 24 07:34:11 EST 2009


>>
>> I assume stop_requested is an Event object. Maybe other thread 
>> cleared it?
>>
> It was never set! -> nothing can clear it.
In theory, it could be that a thread sets the event object. E.g.:

#1. other thread calls stop_requested.set()
#2. "while not self.stop_requested.isSet()" -- loop exists
#3. other thread calls stop_requested.clear()
#4. called this: self.logger.error("Feeder stopped. stop_requested = 
%s",str(self.cm.stop_requested.isSet()))

However, this cannot happen. This application is running multiple 
threads (10+) and every thread monitors the global "stop_requested" 
flag. If there was an unexpected error in the service, 
stop_requested.set() is called. It will stop all threads and exit the 
process. stop_requested.clear() is NEVER called, so the while loop 
should have not been ended. So what is happening here? It drives me crazy.




More information about the Python-list mailing list