#2510 closed defect (fixed)

test failures with foolscap-0.9.1

Reported by: warner Owned by: warner
Priority: critical Milestone: 1.12.0
Component: code Version: 1.10.1
Keywords: review-needed Cc:
Launchpad Bug:

Description

I changed some Foolscap internals in the latest release (0.9.1), involving how connection hints are stored and managed, and it looks like that broke tahoe's rrefutil.hosts_for_rref and hosts_for_furl functions.

  • allmydata.test.test_introducer.SystemTest.test_system_v1_server
  • allmydata.test.test_introducer.SystemTest.test_system_v2_server
  • allmydata.test.test_system.SystemTest.test_filesystem
[ERROR]
Traceback (most recent call last):
  File "/home/bb-tahoe/bb-tahoe/Ubuntu_trusty_14_04/build/src/allmydata/test/test_introducer.py", line 738, in _check1
    text = ir.renderSynchronously().decode("utf-8")
  File "/home/bb-tahoe/bb-tahoe/Ubuntu_trusty_14_04/build/support/lib/python2.7/site-packages/Nevow-0.11.1-py2.7.egg/nevow/rend.py", line 611, in renderSynchronously
    list(flat.iterflatten(doc, ctx, io.write, raiseAlways))
  File "/home/bb-tahoe/bb-tahoe/Ubuntu_trusty_14_04/build/support/lib/python2.7/site-packages/Nevow-0.11.1-py2.7.egg/nevow/flat/ten.py", line 83, in iterflatten
    for item in gen:
  File "/home/bb-tahoe/bb-tahoe/Ubuntu_trusty_14_04/build/support/lib/python2.7/site-packages/Nevow-0.11.1-py2.7.egg/nevow/flat/flatstan.py", line 103, in TagSerializer
    yield serialize(toBeRenderedBy, context)
  File "/home/bb-tahoe/bb-tahoe/Ubuntu_trusty_14_04/build/support/lib/python2.7/site-packages/Nevow-0.11.1-py2.7.egg/nevow/flat/ten.py", line 70, in serialize
    return partialflatten(context, obj)
  File "/home/bb-tahoe/bb-tahoe/Ubuntu_trusty_14_04/build/support/lib/python2.7/site-packages/Nevow-0.11.1-py2.7.egg/nevow/flat/ten.py", line 61, in partialflatten
    return flattener(obj, context)
  File "/home/bb-tahoe/bb-tahoe/Ubuntu_trusty_14_04/build/support/lib/python2.7/site-packages/Nevow-0.11.1-py2.7.egg/nevow/flat/flatstan.py", line 264, in DirectiveSerializer
    return serialize(renderer, context)
  File "/home/bb-tahoe/bb-tahoe/Ubuntu_trusty_14_04/build/support/lib/python2.7/site-packages/Nevow-0.11.1-py2.7.egg/nevow/flat/ten.py", line 70, in serialize
    return partialflatten(context, obj)
  File "/home/bb-tahoe/bb-tahoe/Ubuntu_trusty_14_04/build/support/lib/python2.7/site-packages/Nevow-0.11.1-py2.7.egg/nevow/flat/ten.py", line 61, in partialflatten
    return flattener(obj, context)
  File "/home/bb-tahoe/bb-tahoe/Ubuntu_trusty_14_04/build/support/lib/python2.7/site-packages/Nevow-0.11.1-py2.7.egg/nevow/flat/flatstan.py", line 247, in MethodSerializer
    return FunctionSerializer(original, context, nocontext)
  File "/home/bb-tahoe/bb-tahoe/Ubuntu_trusty_14_04/build/support/lib/python2.7/site-packages/Nevow-0.11.1-py2.7.egg/nevow/flat/flatstan.py", line 236, in FunctionSerializer
    result = original(context, data)
  File "/home/bb-tahoe/bb-tahoe/Ubuntu_trusty_14_04/build/src/allmydata/web/introweb.py", line 93, in render_client_summary
    for s in self.introducer_service.get_subscribers():
  File "/home/bb-tahoe/bb-tahoe/Ubuntu_trusty_14_04/build/src/allmydata/introducer/server.py", line 178, in get_subscribers
    advertised_addresses = rrefutil.hosts_for_rref(rref)
  File "/home/bb-tahoe/bb-tahoe/Ubuntu_trusty_14_04/build/src/allmydata/util/rrefutil.py", line 36, in hosts_for_rref
    assert not isinstance(hint, str), hint
exceptions.AssertionError: localhost:43728

allmydata.test.test_introducer.SystemTest.test_system_v2_server

I didn't realize tahoe was looking that closely into foolscap's getLocationHints() method. To fix this, I may need to change getLocationHints() to return the old-style (type,host,port) tuple, or change tahoe to tolerate either just-a-string or tuple.

Change History (5)

comment:1 Changed at 2015-09-23T00:30:21Z by warner

I've got a fix in https://github.com/warner/tahoe-lafs/tree/2510-new-foolscap .

There were three places that looked at connection hints, all serving the introducer's status page. I removed the one that pulled hints from an rref (to populate the "subscribers are advertising these IP addresses" column), and the one that counted distinct IP addresses for servers (only included in the JSON output at http://introducer/?t=json).

The remaining one was populating the "servers are advertising these IP addresses" column. I replaced that with entire connection hints, instead of just IP addresses. Since those are pretty wide, I also removed the "Advertised IPs" column entirely, and display the connection hints as a tooltip/popup on the "Advertised" (timestamp) column.

Note that these columns have been broken since August 2014 when foolscap-0.6.5 was released, changing the internal hints tuple from ("ipv4",host,port) to ("tcp",host,port). So removing them isn't much of a loss.

I *think* these should work, but it's hard to test them locally, because tahoe's over-agressive version checks were throwing errors when I tried to run tahoe against my local checkout of foolscap. I had to comment those out, which breaks (at least) the tests that expect their output to look a certain way.

There's another set of problems that might be happening with the new foolscap-0.9.1, which is DirtyReactorError as tests finish up. I simplified the Tub shutdown code in the new foolscap, which enabled some further code simplifications, but I think the consequence might be that Tubs with pending connections don't shut them down properly (or maybe just quickly enough) when the Tub is shut down, and that shows up as dirty reactors. I think that avoiding IP-address autodetection helps (at least in the one case that I tested manually). Anyways, the upshot is that this patch may not be sufficient to fix tahoe+foolscap-0.9.1, and we might either need a foolscap-0.9.2 which cleans up better, or change Tahoe to stop defaulting to IP-address autodetection, or some combination of both.

comment:2 Changed at 2015-09-23T00:51:57Z by warner

  • Keywords review-needed added

Huh, well, it passed travis. Maybe the Tub shutdown problem is more likely to show up on a machine that's not connected to the network while the tests are run, or it's somehow timing-dependent. Anyways, it's probably suitable for review now.

comment:3 Changed at 2015-09-23T04:30:20Z by warner

Ok, I'll land that fix. The buildbot wasn't showing DirtyReactorErrors, so maybe that's just on my laptop, and the fix should be sufficient to close this.

comment:4 Changed at 2015-09-23T04:30:34Z by Brian Warner <warner@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 67dcedd8df386905a60757f91d70440da8328be4/trunk:

introweb: fix connection hints for server announcements

A long time ago, the introducer's status web page would show the
advertised IP addresses for all published services, by parsing their
FURL's connection hints. This hasn't worked since about 12-Aug-2014 when
foolscap-0.6.5 changed the internal format of these hints (the column
has been empty this whole time).

This removes the "Advertised IPs" column from the Service Announcements
table. Instead, the service's full connection hints (not just the IP
address) is displayed in a tooltip/popup on the "Announced" timestamp
column.

The code that pulls these connection hints is now tolerant of all three
foolscap styles:

  • foolscap<=0.6.4 : tuples of ("ipv4",host,port)
  • 0.6.5 .. 0.8.0 : tuples of ("tcp",host,port)
  • foolscap>=0.9.0 : strings

fixes ticket:2510

comment:5 Changed at 2016-03-22T05:02:52Z by warner

  • Milestone changed from 1.11.0 to 1.12.0

Milestone renamed

Note: See TracTickets for help on using tickets.