On 05:22 pm, email@example.com wrote:
I'm about to start looking at this. Is there any formal procedure to follow, or shall I just put in a ticket and assign it to myself?
That's the formal procedure. :)
On Fri, 08 Oct 2010 17:50 +0100, "Peter Westlake" firstname.lastname@example.org wrote:
On Fri, 08 Oct 2010 13:19 +0000, email@example.com wrote:
On 1 Oct, 02:31 pm, firstname.lastname@example.org wrote:
J.P's excellent article
explains how to avoid calling Request.finish() on a request after
connection was lost, because that now raises an exception. The code
the article is able to avoid calling finish() because it handles
rendering itself. The call to finish() is right there in _delayedRender. But I'm using Nevow (because it's awesome) and all that stuff is
behind the scenes, where I can't get to it.
Mmm. Indeed. Nevow doesn't make it easy to handle this case.
Nevow itself should be taking some action in this case, I think.
possibility would be to cancel the Deferred associated with the
lookup/rendering operation. This would depend on having a new
version of Twisted (such that Deferred cancellation is available) though. Otherwise all Nevow could really do is ignore the result of
Deferred when it comes.
Is the version of Twisted with cancellation more recent than the version of Nevow that detects the error? If not, it might be reasonable to expect cancellation to be available. Or would it be reasonable to test for it at the beginning of the Nevow source?
Unfortunately, the finish() error was introduced in Twisted 9.0 and cancellation was introduced in 10.1. So there's a few combinations to account for.
Actually, ignoring the result might be a sensible thing to implement first anyway. It should be simpler and have no application
except to get rid of the now-disallowed finish() call.
Are you interested in helping implement this?
I'm certainly willing to try! Especially as I have a cron job that mails me whenever it finds an exception in the log.
Any hints as to how to go about it would be very welcome. So far I've found NevowRequest._cbFinishRender in appserver.py
- is that the right sort of area? And NevowSite.handleSegment?
That sounds like the right area.