Twisted integration: shutdown event vs. manual stop

Bug #534078 reported by Michael Elsdörfer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Storm
New
Undecided
Unassigned

Bug Description

When shutting down my twistd server, using storm-twisted with MySQL, I get:

File "/home/michael/.virtualenvs/pw-server/src/storm/storm/database.py", line 262, in rollback
     self._raw_connection.rollback()
 exceptions.AttributeError: 'NoneType' object has no attribute 'rollback'

This is because one of my services manually calls StorePool.stop(), and at the same time, each DeferredStore itself registers a reactor shutdown event. As a result, the store.rollback() call in DeferredStore.close() is executed twice.

I'm not sure what the best way to go about this would be. Checking again for self.thread.stopped before actually calling rollback() seems to do the job. Or maybe the shutdown event should just be optional.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.