[Twisted-web] Xml-Rpc server troubles
andrea at teamsw.it
Wed Nov 17 00:39:07 MST 2004
On 11/16/04 22:35:50, Eric Mangold wrote:
> Where is your Errback? If this doesn't work then you'll never know
> the Deferred gets GC'ed, if it ever does, and even then only
> Deferred's have __del__ defined to hopefully, maybe, warn the user if
> were errors that never got handled. This is of course not guarenteed
> to happen.
> Always, always, add Errbacks.
Ok, you're right. I'll do.
> I don't know much about Twisted's RDBMS stuff. I'm assuming
> createjob gets run in a thread.
> Maybe these threads are getting stuck? *shrug*. Apparently the
> Deferred's aren't firing, but you
> could have a timeout function to see if they really are getting fired
> but lost before the
> result gets send back by xml-rpc.
> Perhaps something like this (untested):
> def xmlrpc_createjob(self,hash):
> d = self.dbpool.runInteraction(self.createjob,hash)
> reactor.callLater(5, checkIfDeferredFired, d)
> return d.addCallback(self.returnData)
> def checkIfDeferredFired(d):
> if not d.called:
> log.msg('Deferred not fired after 5 seconds')
> #omit this if it will fill your logs too much
> log.msg('Deferred fired OK')
Thank you very much Eric.
I'll follow your advices.
mailto:andrea at teamsw.it
im:aser76 at jabber.linux.it
Team Software S.r.l.
Via Campagna 30
More information about the Twisted-web