#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
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
comment:5 Changed at 2016-03-22T05:02:52Z by warner
- Milestone changed from 1.11.0 to 1.12.0
Milestone renamed
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.