[Twisted-Python] Remote PB calls in ApplicationService.stopService
Glyph Lefkowitz
glyph at twistedmatrix.com
Sat Aug 2 11:09:33 MDT 2003
On Saturday, August 2, 2003, at 05:55 AM, Moshe Zadka wrote:
> BTW, currently that feature is not in the new Application code I'm
> working
> on. I could add it, but when we discussed it I didn't know of anybody
> using that feature. It seems a bit too dangerous to allow a buggy
> remote
> side to delay our shutdown by a long amount of time [depending on PB
> timeouts]. I humbly suggest that an architecture which depends on being
> able to send "one last message" is probably flawed.
There are a couple of different use-cases here that need to be
separated; for example, shutting down an active thread pool requires
waiting, otherwise you will deadlock - and yes, this is due to the fact
that OS threads are a basically flawed concept, but we've been over
that one before :).
Sometimes it's also useful to be able to send out a descriptive message
before dying, like, "The service is going down! Please hurry up." I
admit that the deferred-from-stopService is probably not the best way
to handle this, though; there should be a different canonical way to
shut down a Twisted server that allows those sorts of messages to be
sent.
However, as long as the deferred in the latter case always comes with
the timeout, I think the use cases are about equivalent. Thoughts?
More information about the Twisted-Python
mailing list