On connection timeout, POP3 grabber fails with an unhandled AttributeError

Bug #998044 reported by Jean-Paul Calderone
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Quotient
Fix Committed
Undecided
Unassigned

Bug Description

This traceback shows up in my logs sometimes:

2012-05-10 14:40:57-0400 [ControlledPOP3GrabberProtocol (BandwidthMeasuringProtocol) (TLSMemoryBIOProtocol),client] Unhandled Error
        Traceback (most recent call last):
          File "/home/quotient/.local/lib/python2.7/site-packages/epsilon/hotfixes/deferredgenerator_tfailure.py", line 44, in gotResult
            _deferGenerator(g, deferred)
          File "/home/quotient/.local/lib/python2.7/site-packages/epsilon/hotfixes/deferredgenerator_tfailure.py", line 25, in _deferGenerator
            deferred.errback()
          File "/home/quotient/.local/lib/python2.7/site-packages/Twisted-11.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 391, in errback
            self._startRunCallbacks(fail)
          File "/home/quotient/.local/lib/python2.7/site-packages/Twisted-11.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 458, in _start File "/home/quotient/.local/lib/python2.7/site-packages/Twisted-11.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 458, in _start
RunCallbacks
            self._runCallbacks()
          File "/home/quotient/.local/lib/python2.7/site-packages/Twisted-11.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 545, in _runCa
llbacks
            current.result = callback(current.result, *args, **kw)
          File "/home/quotient/.local/lib/python2.7/site-packages/epsilon/hotfixes/deferredgenerator_tfailure.py", line 44, in gotResult
            _deferGenerator(g, deferred)
        --- <exception caught here> ---
          File "/home/quotient/.local/lib/python2.7/site-packages/epsilon/hotfixes/deferredgenerator_tfailure.py", line 20, in _deferGenerator
            result = g.next()
          File "/home/quotient/.local/lib/python2.7/site-packages/xquotient/grabber.py", line 501, in _grab
            self.setStatus(u"Connection lost", False)
          File "/home/quotient/.local/lib/python2.7/site-packages/xquotient/grabber.py", line 596, in setStatus
            self._transact(self.grabber.status.setStatus, msg, success)
        exceptions.AttributeError: 'NoneType' object has no attribute 'status'

Looking at the code, it seems the likely explanation is that the connection times out (a frequent occurrence on my net connection/server). `timeoutConnection` calls `stoppedRunning`. `stoppedRunning` sets `self.grabber` to `None` (a recent improvement, as previously it would choke on a scheduler problem before getting there, now fixed). `timeoutConnection` then calls `loseConnection` which eventually causes the connection to be lost, resulting in `connectionLost`, causing one of the Deferreds waited on in `_grab` to fail. This leads to a `setStatus` call which fails because the `grabber` attribute was discarded already.

Related branches

Changed in quotient:
status: New → Fix Committed
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.