[Twisted-Python] unhandled exception in deferred has a delayed logging ?

Jonathan Vanasco twisted-python at 2xlp.com
Wed Sep 26 17:46:32 MDT 2012


while migrating some functionality to a deferred callback chain and debugging my app, i noticed this oddity...

if a function doesn't have the proper args/kwargs definition, no error is raised and everything just hangs

for example, if i have these 2 class functions in an internet.TimerService managed class ...

     def start_chain( self ):
        database.get_dbPool().runInteraction( self.get_update_batch )\
            .addCallback( self.process_batch )

   def get_update_batch(self):
        return True

and then improperly don't have an arg to capture the return value in the callback...

     def process_batch( self ):
         pass

then the reactor just seems to hang.

if i kill the process, then the Unhandled Error and Traceback message prints.
If i wait until the next interval that the timerservice runs, then the Unhandled Error and Traceback message will print then ( but that could be minutes/hours later ).  

has anyone else noticed this before ? 

are there any good ways around this , other than setting the timer service to be within seconds during bugtesting ?



More information about the Twisted-Python mailing list