test_transport fails sometimes with an AlreadyCancelledError

Bug #250978 reported by Christopher Armstrong
6
Affects Status Importance Assigned to Milestone
Landscape Client
Fix Released
High
Christopher Armstrong
Landscape Server
Fix Released
High
Christopher Armstrong

Bug Description

This sometimes happens:

===============================================================================
[ERROR]: landscape.broker.tests.test_transport.HTTPTransportTest.test_ssl_verification_negative

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/twisted/python/log.py", line 48, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/python/log.py", line 33, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/python/context.py", line 59, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/twisted/python/context.py", line 37, in callWithContext
    return func(*args,**kw)
  File "/usr/lib/python2.5/site-packages/twisted/internet/gtk2reactor.py", line 203, in _doReadOrWrite
    self._disconnectSelectable(source, why, didRead == source.doRead)
  File "/usr/lib/python2.5/site-packages/twisted/internet/posixbase.py", line 252, in _disconnectSelectable
    selectable.readConnectionLost(f)
  File "/usr/lib/python2.5/site-packages/twisted/internet/tcp.py", line 405, in readConnectionLost
    self.connectionLost(reason)
  File "/usr/lib/python2.5/site-packages/twisted/internet/tcp.py", line 416, in connectionLost
    protocol.connectionLost(reason)
  File "/usr/lib/python2.5/site-packages/twisted/web/http.py", line 1110, in connectionLost
    self.setTimeout(None)
  File "/usr/lib/python2.5/site-packages/twisted/protocols/policies.py", line 525, in setTimeout
    self.__timeoutCall.cancel()
  File "/usr/lib/python2.5/site-packages/twisted/internet/base.py", line 93, in cancel
    raise error.AlreadyCancelled
twisted.internet.error.AlreadyCancelled: Tried to cancel an already-cancelled event.
-------------------------------------------------------------------------------

Revision history for this message
Christopher Armstrong (radix) wrote :

Ok, ready for review in the attached branch.

Changed in landscape:
assignee: nobody → radix
status: New → In Progress
Changed in landscape-client:
assignee: nobody → radix
status: New → In Progress
Revision history for this message
Jamu Kakar (jkakar) wrote :

Marking as 'High' as this affects the PQM/Xen work Tom is doing.

Changed in landscape-client:
importance: Undecided → High
Changed in landscape:
importance: Undecided → High
Revision history for this message
Jamu Kakar (jkakar) wrote :

[1]

+ def got_result(result):

Would you mind renaming 'result' to 'ignored' in the cases you've
added these calls.

Everything looks good and tests pass here on hardy, +1!

Revision history for this message
Thomas Herve (therve) wrote :

Great, the problem is fixed here, +1. Small nits:

One flake:
landscape/broker/tests/test_transport.py:5: 'API' imported but unused

and one trailing whitespace.

Revision history for this message
Christopher Armstrong (radix) wrote :

Thanks, it's in trunk now.

Changed in landscape-client:
status: In Progress → Fix Committed
Changed in landscape:
status: In Progress → Fix Committed
Changed in landscape:
milestone: none → thames
status: Fix Committed → Fix Released
Changed in landscape-client:
status: Fix Committed → Fix Released
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.