Hi,

I have a pyramid app that internally creates threads to process a
large number of data files per request.  The threads block on a queue
and when I ctrl-c a paster app, the app hangs because the threads are
still alive.  I have to send a sigterm with kill.  If I use paster
with --reload, the file monitor seemingly kills my process for me.
But, for other deployment strategies, I want to be able to close
gracefully, so...

I implemented an ApplicationDelete event and interface and added a
__del__ method to pyramid.router.Router:

    def __del__(self):
        try:
            self.registry.notify(ApplicationDelete(self))
        except:
            pass

My event handler then cleans up the threads.

My problem: I upgraded from pyramid-1.0 to pyramid 1.2 and tried the
same thing but the Router.__del__ method is never called so this no
longer works.  I looked through the change logs but nothing jumps out
at me.  Any thoughts on why this would be so?

Also, perhaps this isn't the best way to go about it, adding a __del__
method just for notification purposes.  Any other ideas?

Regards,
Adam

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to