facebook/tornado — pull request #574 by stiletto (2012-07-30 20:32:24+00:00)
Title: tornado.platform.twisted shutdown sequence

Twisted reactor should be stopped only in 'during' phase of shutdown event.
Current behavior causes hang on shutdown if any of event handlers in 'before' phase return Deferred. (twisted.application.service.MultiService as an example).
This patch fixes it.