← Back to team overview

divmod-dev team mailing list archive

[Bug 998044] Re: On connection timeout, POP3 grabber fails with an unhandled AttributeError

 

** Changed in: quotient
       Status: New => Fix Committed

-- 
You received this bug notification because you are a member of Divmod-
dev, which is the registrant for Quotient.
https://bugs.launchpad.net/bugs/998044

Title:
  On connection timeout, POP3 grabber fails with an unhandled
  AttributeError

Status in Multi-protocol messaging server and tools:
  Fix Committed

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/quotient/+bug/998044/+subscriptions


References