Opened 15 years ago

Closed 15 years ago

#129 closed defect (fixed)

zero-length location hints cause getReference() to fail synchronously

Reported by: Brian Warner Owned by:
Priority: major Milestone: 0.4.2
Component: negotiation Version: 0.4.1
Keywords: Cc:

Description

Zooko noticed an exception that highlighted an unexpected code path in Tub.getReference():

File "/home/zooko/playground/allmydata/tahoe/trunk/support/lib/python2.6/site-packages/foolscap-0.4.1-py2.6.egg/foolscap/negotiate.py", line 1366, in connectToAll
    self.checkForFailure()
File "/home/zooko/playground/allmydata/tahoe/trunk/support/lib/python2.6/site-packages/foolscap-0.4.1-py2.6.egg/foolscap/negotiate.py", line 1440, in checkForFailure
    if (self.failureReason.check(RemoteNegotiationError) and
exceptions.AttributeError: 'NoneType' object has no attribute 'check'

I think here's what happened:

  • somebody set their Tahoe node to use tub.location=""
  • the Introducer published this FURL along with a bunch of others in a single announcement
  • Zooko's client received that announcement and started connectors to each of them
  • when it hit the zero-length location hint, we fell through the loop in TubConnector.connectToAll and landed in checkForFailure without ever actually having seen a failure, so self.failureReason was still None
  • the synchronous exception bypassed the rest of the each-announcement loop, causing his client to not try to connect to anybody else

What should happen is that the call to Tub.getReference() should return defer.fail (i.e. a Deferred that's already in the errback state). We can't connect to a Tub that has no location hints (although they might have already connected to us), but the failure should be eventual, not synchronous.

Attachments (2)

AttributeError.flog (52.7 KB) - added by Zooko 15 years ago.
AttributeError-2.flog.bz2 (69.0 KB) - added by Zooko 15 years ago.

Download all attachments as: .zip

Change History (4)

Changed 15 years ago by Zooko

Attachment: AttributeError.flog added

Changed 15 years ago by Zooko

Attachment: AttributeError-2.flog.bz2 added

comment:1 Changed 15 years ago by Brian Warner

hm, in adding a unit test to exercise a zero-length connection hint (i.e. pb://tubid@/swiss, it looks like getReference() will throw a synchronous exception when trying to parse the FURL. This is annoying, and should probably be asynchronous, and would probably cause the Tahoe-won't-connect-to-anyone-else behavior we hypothesized, but it would *not* cause the AttributeError that zooko saw.

So I need to look at this more closely..

comment:2 Changed 15 years ago by Brian Warner

Milestone: undecided0.4.2
Resolution: fixed
Status: newclosed

Fixed, by [b9bc4a40679e86f2f15c407ec85ff4be5e6c6601]. It turned out that pb://tubid@,/swiss or pb://tubid@-unrouteable-/swiss would pass the regexp check but then be turned into no-hints later on. Someone in the Tahoe testgrid had set their tub.location to "-unrouteable-", which triggered this problem.

Note: See TracTickets for help on using tickets.