[Twisted-Python] TestInternet2.testPickledTimer Failed

zhang kai kylerzhang11 at gmail.com
Thu Aug 1 07:08:38 MDT 2013


On Thu, Aug 1, 2013 at 7:50 PM, <exarkun at twistedmatrix.com> wrote:

> I suggest you take a look at TimerService and figure out why pickling one
> of those ever tries to pickle a LoopingCall (take a look around
> `__getstate__` and `volatile`, I think that's where the problem is).  I
> think you'll find an existing bug that the unit test previously failed to
> reveal but which your changes have revealed.
>

Thanks for your help. I've found that the bug is due to a typo. The
"_loopFinshed" in `TimerService.volatile` should be "_loopFinished". So
when pickling a `TimerService` it will actually try to pickle
"_loopFinished"(the Deferred returned by `LoopingCall.start`). When the
Deferred has a reference to the `LoopingCall` instance it will then try to
pickle the `LoopingCall`, thus causes the problem.

I've searched and there is no ticket about this. So I will file a new
ticket and fix this.

-Kai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20130801/5026c946/attachment-0001.html>


More information about the Twisted-Python mailing list