tahoe-lafs/tahoe-lafs.git
12 years agointerfaces.py: corrections to interfaces to make more of them checkable.
david-sarah [Tue, 24 Jul 2012 03:39:24 +0000 (03:39 +0000)]
interfaces.py: corrections to interfaces to make more of them checkable.

12 years agointerfaces.py: which -> that.
david-sarah [Tue, 24 Jul 2012 03:37:07 +0000 (03:37 +0000)]
interfaces.py: which -> that.

12 years agoDefault arguments in interface declarations should only be used to specify a default...
david-sarah [Tue, 24 Jul 2012 03:34:46 +0000 (03:34 +0000)]
Default arguments in interface declarations should only be used to specify a default, not to specify the type, in order to be checkable.

12 years agoRemove spurious 'self' arguments that should not be included in interface declarations.
david-sarah [Tue, 24 Jul 2012 03:32:56 +0000 (03:32 +0000)]
Remove spurious 'self' arguments that should not be included in interface declarations.

12 years agointerfaces.py: whitespace
david-sarah [Tue, 24 Jul 2012 03:29:14 +0000 (03:29 +0000)]
interfaces.py: whitespace

12 years agodocs: fix link to mutable.rst. Thanks to TimothyA for noticing the broken link
Zooko O'Whielacronx [Fri, 20 Jul 2012 19:24:02 +0000 (19:24 +0000)]
docs: fix link to mutable.rst. Thanks to TimothyA for noticing the broken link

12 years agodocs/configuration.rst: clarify statement about lack of redundancy when shares.happy...
david-sarah [Thu, 12 Jul 2012 20:30:26 +0000 (20:30 +0000)]
docs/configuration.rst: clarify statement about lack of redundancy when shares.happy <= k. fixes #1793

12 years agoUpdate release date for 1.9.2.
david-sarah [Tue, 3 Jul 2012 16:30:10 +0000 (16:30 +0000)]
Update release date for 1.9.2.

12 years agoSlightly improve the error message when a stats.pickle file cannot be read.
david-sarah [Tue, 3 Jul 2012 14:45:22 +0000 (14:45 +0000)]
Slightly improve the error message when a stats.pickle file cannot be read.

12 years agoRelnotes, NEWS and quickstart updates for 1.9.2, with updated release date. refs...
david-sarah [Sun, 1 Jul 2012 23:19:21 +0000 (23:19 +0000)]
Relnotes, NEWS and quickstart updates for 1.9.2, with updated release date. refs #1776

12 years agoFailing to load a crawler state pickle uses default values, but the exception clause...
david-sarah [Mon, 2 Jul 2012 18:18:47 +0000 (18:18 +0000)]
Failing to load a crawler state pickle uses default values, but the exception clause to detect this failure is too narrow; it can also fail with EOFError or KeyError for example.

12 years agoIf a stats.pickle file cannot be read, print a better error message.
david-sarah [Mon, 2 Jul 2012 18:15:55 +0000 (18:15 +0000)]
If a stats.pickle file cannot be read, print a better error message.

12 years agoMakefile: in check-umids, exclude 'old.py' to avoid false positives.
david-sarah [Sun, 1 Jul 2012 20:17:11 +0000 (20:17 +0000)]
Makefile: in check-umids, exclude 'old.py' to avoid false positives.

13 years agosrc/allmydata/__init__.py: head off a possible warning on platforms where twisted...
david-sarah [Mon, 8 Aug 2011 18:20:13 +0000 (18:20 +0000)]
src/allmydata/__init__.py: head off a possible warning on platforms where twisted-conch is a separate package.

12 years ago'tahoe --version': remove inconsistent trailing comma, easier to parse
Brian Warner [Tue, 26 Jun 2012 16:18:45 +0000 (09:18 -0700)]
'tahoe --version': remove inconsistent trailing comma, easier to parse

12 years ago_auto_deps: bump foolscap to >=0.6.3 to tolerate twisted-12.0.0
Brian Warner [Sun, 24 Jun 2012 19:10:24 +0000 (12:10 -0700)]
_auto_deps: bump foolscap to >=0.6.3 to tolerate twisted-12.0.0

The current Twisted release is 12.1.0, which (like 12.0.0 before it)
isn't compatible with foolscap-0.6.2 and earlier. We previously required
foolscap>=0.6.1, since that's all we actually need from foolscap itself.
_auto_deps specifies twisted>=11.0.0, so any system that can't meet that
will install the current Twisted (12.1.0), which will give them
something incompatible with foolscap-0.6.1 and 0.6.2 .

If we're limited to setuptools's declarative constraint language (and
can't have a function which evaluates the available dependency versions
and gives recommendations on which to change), then the only safe
approach is to make sure that any acceptable Foolscap version will be
compatible with all acceptable Twisted versions. So, bump the foolscap
dependency to >=0.6.3, which covers all currently-known
incompatibilities.

12 years agoMakefile: Add 'check-rst' target to check .rst files for errors. Also add 'doc-checks...
david-sarah [Sat, 23 Jun 2012 23:23:19 +0000 (23:23 +0000)]
Makefile: Add 'check-rst' target to check .rst files for errors. Also add 'doc-checks' which at the moment just runs check-rst, but might do more in future. fixes #1780

12 years agoUpdate docs, notably performance.rst, to include MDMF. fixes #1772
david-sarah [Sat, 23 Jun 2012 23:13:38 +0000 (23:13 +0000)]
Update docs, notably performance.rst, to include MDMF. fixes #1772

12 years agoNEWS.rst: hyperlink reference fixes. refs #1776
david-sarah [Sat, 23 Jun 2012 22:02:46 +0000 (22:02 +0000)]
NEWS.rst: hyperlink reference fixes. refs #1776

12 years agoRelease notes, NEWS, and quickstart updates for 1.9.2a1. refs #1776
david-sarah [Sat, 23 Jun 2012 00:17:52 +0000 (00:17 +0000)]
Release notes, NEWS, and quickstart updates for 1.9.2a1. refs #1776

12 years agoChange the maximum mutable share size to 69105 TB, and add a maximum-mutable-share...
david-sarah [Fri, 22 Jun 2012 15:43:54 +0000 (15:43 +0000)]
Change the maximum mutable share size to 69105 TB, and add a maximum-mutable-share-size field to the version announcement. Includes a test. refs #1778

12 years agoRelease notes and NEWS for 1.9.1. refs #1776
david-sarah [Thu, 21 Jun 2012 23:45:56 +0000 (23:45 +0000)]
Release notes and NEWS for 1.9.1. refs #1776

12 years agodocs/frontends/FTP-and-SFTP.rst: remove reference to rekeying bug since it does not...
david-sarah [Mon, 18 Jun 2012 17:03:15 +0000 (17:03 +0000)]
docs/frontends/FTP-and-SFTP.rst: remove reference to rekeying bug since it does not apply now that we depend on Twisted 11.0. refs #1297 refs #1771

12 years ago_auto_deps.py: bump the Twisted dependency to >= 11.0.0 to avoid Twisted bugs #411...
david-sarah [Sun, 17 Jun 2012 00:21:25 +0000 (00:21 +0000)]
_auto_deps.py: bump the Twisted dependency to >= 11.0.0 to avoid Twisted bugs #411 (Deferred recursion limit) and #4395 (SSH server rekeying). refs #1297 fixes #1771

12 years agomutable: fix shape of 'verinfo' tuple returned from MDMFSlotWriteProxy.get_verinfo...
david-sarah [Thu, 21 Jun 2012 20:52:21 +0000 (20:52 +0000)]
mutable: fix shape of 'verinfo' tuple returned from MDMFSlotWriteProxy.get_verinfo(). fixes #1669

12 years agoTests for ref #1669. Also refactor the existing tests to reduce duplicated code and...
david-sarah [Thu, 21 Jun 2012 20:46:27 +0000 (20:46 +0000)]
Tests for ref #1669. Also refactor the existing tests to reduce duplicated code and to fix a cut-and-paste error that caused one case (successful SDMF repair) to go untested.

12 years agoAdd assertions to make sure that set_default_encoding_parameters is always called...
david-sarah [Tue, 19 Jun 2012 02:05:04 +0000 (02:05 +0000)]
Add assertions to make sure that set_default_encoding_parameters is always called, rather than using hardcoded 3/7/10 defaults. Also update affected tests. Note that this by itself cannot fix the bug mentioned in ticket:1212#comment:41, but it might make it easier to reproduce. refs #1212

12 years agodocs/frontends/FTP-and-SFTP.rst: listing of directories containing mutable files...
david-sarah [Mon, 18 Jun 2012 00:24:54 +0000 (00:24 +0000)]
docs/frontends/FTP-and-SFTP.rst: listing of directories containing mutable files (but not reading/writing mutable files) is fixed for FTP. Also remove the orphaned trac link to #1688. refs #680

12 years agodocs: remove mention of #1588 from docs/frontends/FTP-and-SFTP.rst, since it is fixed
Zooko O'Whielacronx [Sun, 17 Jun 2012 03:14:04 +0000 (03:14 +0000)]
docs: remove mention of #1588 from docs/frontends/FTP-and-SFTP.rst, since it is fixed

12 years agoMake the intent of the loop over servers in test_system.Connections.test_rref clearer...
david-sarah [Sat, 16 Jun 2012 18:18:44 +0000 (18:18 +0000)]
Make the intent of the loop over servers in test_system.Connections.test_rref clearer, and able to be the same in 1.9.2 and trunk. Remove the now-unused node_key_s attribute of Client. refs #1636

12 years agoFix a bug in mutable publish that could cause an IndexError when a writer is removed...
david-sarah [Fri, 15 Jun 2012 03:44:37 +0000 (03:44 +0000)]
Fix a bug in mutable publish that could cause an IndexError when a writer is removed in Publish._connection_problem. This version uses DictOfSets as suggested by warner. fixes #1749

12 years agoSkip allmydata.test.test_system.Connections.test_rref unless we have foolscap >=...
david-sarah [Fri, 15 Jun 2012 23:20:28 +0000 (23:20 +0000)]
Skip allmydata.test.test_system.Connections.test_rref unless we have foolscap >= 0.6.4, because of http://foolscap.lothar.com/trac/ticket/196 . refs #1636

12 years agoAfter a server disconnects, make the IServer retain the dead RemoteReference, and...
david-sarah [Fri, 15 Jun 2012 01:48:55 +0000 (01:48 +0000)]
After a server disconnects, make the IServer retain the dead RemoteReference, and continue to return it to anyone who calls get_rref(). This removes the need for callers to guard against receiving a None (as long as the server was connected at least once, which is always the case for servers returned by get_servers_for_psi(), which is how all upload/download code gets servers). Includes test. fixes #1636

12 years agoSince DeprecationWarning about twisted.internet.interfaces.IFinishableConsumer is...
david-sarah [Thu, 14 Jun 2012 21:33:15 +0000 (21:33 +0000)]
Since DeprecationWarning about twisted.internet.interfaces.IFinishableConsumer is suppressed globally, it doesn't need to be suppressed during import. refs #1295

12 years agomisc/coding_tools/check-interfaces.py: clean-ups (warnings about Windows-specific...
david-sarah [Thu, 14 Jun 2012 21:28:29 +0000 (21:28 +0000)]
misc/coding_tools/check-interfaces.py: clean-ups (warnings about Windows-specific modules and error stream handling).

12 years agoSuppress DeprecationWarning about twisted.internet.interfaces.IFinishableConsumer...
david-sarah [Thu, 14 Jun 2012 21:23:08 +0000 (21:23 +0000)]
Suppress DeprecationWarning about twisted.internet.interfaces.IFinishableConsumer. This also unifies the handling of DeprecationWarnings that need to be suppressed globally. refs #1295

12 years agotest/common.py: fix race condition waiting for the helper connection
Brian Warner [Thu, 14 Jun 2012 19:17:55 +0000 (12:17 -0700)]
test/common.py: fix race condition waiting for the helper connection

The wait_for_connections() method, which is used at the start of
test_system to make sure that all the clients are connected to all the
servers, did not also wait for clients to be connected to their Helpers.
Every once in a while, the helper connection would take a bit longer,
and then
test_system.SystemTest.test_filesystem._test_web._got_welcome_helper
would fail, because we'd check for a helper connection before it was
ready.

The fix is to modify wait_for_connections's polling predicate to look
for helper connections (if configured) as well as the regular
introducer- and server- connections.

Tested by temporarily adding a large (30s) delay to the connectTo() call
in Uploader.startService, simulating a long helper
connection-establishment delay. This makes the test fail consistently.
Then I fixed wait_for_connections(), and the test passed (slowly). Then
I removed the delay.

Closes #1467

12 years agoClarify documentation of RIStorageServer.slot_testv_and_readv_and_writev. fixes ...
david-sarah [Wed, 13 Jun 2012 16:51:35 +0000 (16:51 +0000)]
Clarify documentation of RIStorageServer.slot_testv_and_readv_and_writev. fixes #1744

12 years agointroweb: the Subscribed Clients list shows tubids, not serverids
Brian Warner [Tue, 12 Jun 2012 21:37:27 +0000 (14:37 -0700)]
introweb: the Subscribed Clients list shows tubids, not serverids

Improve the column headers to make it clear that this list shows Tub
IDs. (we can't show pubkey-based serverids because clients don't give
those to us: only servers provide pubkeys). This should be the only
place in the whole webapi that shows TubIDs for modern (V2-introducer)
nodes.

12 years agoDisplay serverids consistently as 8-char pubkey, or 6-char tubid.
Brian Warner [Tue, 12 Jun 2012 21:01:24 +0000 (14:01 -0700)]
Display serverids consistently as 8-char pubkey, or 6-char tubid.

This makes it easy to distinguish between old V1-Introducer
nodes (identified by their Foolscap TubID) and new V2 nodes (identified
by their ed25519 pubkey).

This fixes a few places where we used to display a tubid even if we had
a pubkey, making it hard to visually correlate servers in two different
displays. It also cleans up the way we pass serverids to the JS-based
download timeline.

The "introweb" subscribed-clients list still shows tubids.

12 years agotest_system.py: wait for the Helper connection properly before uploading
Brian Warner [Tue, 12 Jun 2012 06:19:30 +0000 (23:19 -0700)]
test_system.py: wait for the Helper connection properly before uploading

12 years agotest_system.py: clean up control flow, reduce use of stall()
Brian Warner [Tue, 12 Jun 2012 01:22:35 +0000 (18:22 -0700)]
test_system.py: clean up control flow, reduce use of stall()

The _upload_resumable() test interrupts a Helper upload partway
through (by shutting down the Helper), then restarts the Helper and
resumes the upload. The control flow is kind of tricky: to do anything
"partway through" requires adding a hook to the Uploadable. The previous
flow depended upon a (fragile) call to self.stall(), which waits a fixed
number of seconds.

This removes one of those stall() calls (the remainder is in
test/common.py and I'll try removing it in a subsequent revision). It
also removes some now-redundant wait_for_connections() calls, since
bounce_client() doesn't fire its Deferred until the client has finished
coming back up (and uses wait_for_connections() internally to do so).

12 years agotest_system.py: fix minor typo
Brian Warner [Tue, 12 Jun 2012 01:16:36 +0000 (18:16 -0700)]
test_system.py: fix minor typo

12 years agooffloaded.py: don't drop the Deferred
Brian Warner [Tue, 12 Jun 2012 01:16:02 +0000 (18:16 -0700)]
offloaded.py: don't drop the Deferred

There was one corner case (where the client disconnects at just the
wrong time) that could have dropped a Deferred, leading to an Unhandled
Error. Clean up the control flow to avoid this case.

12 years agosetup.py and bin/tahoe-script.template: the error when we try to use Python 3 should...
david-sarah [Mon, 11 Jun 2012 03:52:16 +0000 (03:52 +0000)]
setup.py and bin/tahoe-script.template: the error when we try to use Python 3 should give the correct minimum Python version (now 2.5). refs #1658

12 years agointroducer: add sequence-numbers to announcements, ignore replays
Brian Warner [Mon, 11 Jun 2012 02:10:22 +0000 (19:10 -0700)]
introducer: add sequence-numbers to announcements, ignore replays

This will support revocation of Accounting recommendation records,
assuming the gossip-based broadcast channel isn't easily jammed.

12 years agoclient.py: rename "server key" to "node key", use old name if present
Brian Warner [Mon, 11 Jun 2012 01:14:55 +0000 (18:14 -0700)]
client.py: rename "server key" to "node key", use old name if present

This prepares for invitation-based reciprocal-permission Accounting. In
the scheme I'm developing, nodes publish "I accept shares from Y"
messages, which are assembled into a graph, and server will accept
shares from any client node reachable in this graph. For this to work,
the serverX->clientY edge must be connectable to the serverY->clientZ
edge, which means "clientY" and "serverY" must be connected. If clientY
and serverY are two distinct keys, they must be cross-signed. Life is
easier if there's just one key "Y", rather than distinct client- and
server- keys. Calling this one key "server.privkey" would be confusing.
"node.privkey" and "node.pubkey" makes more sense.

One-server-per-node is a pretty easy restriction. Originally I was
thinking that the client.key should be provided in each webapi call,
just like a filecap is, making a single node useable by multiple users
(Accounting principals), and not providing any ambient storage
authority. But I've been unable to think of a comfortable WUI for
that (at least without requiring javascript), nor a friendly way to
transfer account authority (e.g. writecaps that include storage
authority). So I'm more willing to have one-client-per-node these days.

(and note that this rename doesn't seriously preclude
many-clients-per-node or zero-clients-per-node anyways, it just makes
one-client-per-node less awkward)

12 years agonode.py: add get_private_config()
Brian Warner [Mon, 11 Jun 2012 00:46:38 +0000 (17:46 -0700)]
node.py: add get_private_config()

Also add tests for this and the pre-existing private-config methods.

12 years agoAdded docs/specifications/backends/raic.rst for ticket #1760
Patrick R McDonald [Wed, 6 Jun 2012 02:35:23 +0000 (21:35 -0500)]
Added docs/specifications/backends/raic.rst for ticket #1760

12 years agoFix text in Publish Status results. Closes #1762.
Brian Warner [Fri, 8 Jun 2012 22:21:46 +0000 (15:21 -0700)]
Fix text in Publish Status results. Closes #1762.

12 years agoCheckResults corrupt/incompatible shares now return IServers 10/head
Brian Warner [Fri, 25 May 2012 19:58:28 +0000 (12:58 -0700)]
CheckResults corrupt/incompatible shares now return IServers

DeepResultsBase also has a get_corrupt_shares(), and it is populated
from CheckResults.get_corrupt_shares(). It has been updated too, along
with get_remaining_corrupt_shares().

Remove temporary get_new_corrupt_shares() and
get_new_incompatible_shares().

12 years agoCheckResults.get_servers_responding() now returns IServers
Brian Warner [Fri, 25 May 2012 19:58:18 +0000 (12:58 -0700)]
CheckResults.get_servers_responding() now returns IServers

Remove temporary get_new_servers_responding().

12 years agoCheckResults.get_sharemap() now returns IServers
Brian Warner [Fri, 25 May 2012 19:58:02 +0000 (12:58 -0700)]
CheckResults.get_sharemap() now returns IServers

Remove temporary get_new_sharemap().

12 years agoCheckResults: pass IServer to corrupt/incompatible share locators
Brian Warner [Fri, 25 May 2012 19:57:53 +0000 (12:57 -0700)]
CheckResults: pass IServer to corrupt/incompatible share locators

Getters still return serverid. Adds temporary get_new_corrupt_shares()
and get_new_incompatible_shares().

12 years agoCheckResults: pass IServer to servers_responding=, getter returns serverid
Brian Warner [Fri, 25 May 2012 19:56:20 +0000 (12:56 -0700)]
CheckResults: pass IServer to servers_responding=, getter returns serverid

Add temporary get_new_servers_responding().

12 years agoCheckResults: pass IServer to sharemap=, but get_sharemap() returns serverids
Brian Warner [Fri, 25 May 2012 19:56:03 +0000 (12:56 -0700)]
CheckResults: pass IServer to sharemap=, but get_sharemap() returns serverids

This changes all code which feeds CheckResults(sharemap=) to provide
IServer instances, but CheckResults converts these to old-style
serverids during output, so downstream code doesn't have to change yet.

It adds a temporary get_new_sharemap(), which *does* return IServer
instances, so the immutable repairer can build new CheckResults from an
old one. This will go away when get_sharemap() is updated to return
IServer (and downstream code is updated too).

12 years agoCheckResults: internal cleanup
Brian Warner [Fri, 25 May 2012 19:55:48 +0000 (12:55 -0700)]
CheckResults: internal cleanup

replace the one-big-dictionary with normal private attributes

12 years agoCheckResults: privatize remaining attributes
Brian Warner [Fri, 25 May 2012 19:29:10 +0000 (12:29 -0700)]
CheckResults: privatize remaining attributes

12 years agoCheckResults: use fat init, add type-checking assertions
Brian Warner [Fri, 25 May 2012 07:14:46 +0000 (00:14 -0700)]
CheckResults: use fat init, add type-checking assertions

Added assertions for sharemap, servermap, servers_responding,
list_corrupt_shares, and list_incompatible_shares.

12 years agomutable/checker: refactor to make CheckResults easier to change
Brian Warner [Fri, 25 May 2012 07:14:18 +0000 (00:14 -0700)]
mutable/checker: refactor to make CheckResults easier to change

12 years agoCheckResults: replace get_data() with as_dict(), use getters in web status
Brian Warner [Fri, 25 May 2012 07:14:08 +0000 (00:14 -0700)]
CheckResults: replace get_data() with as_dict(), use getters in web status

12 years agouse the new CheckResult getters almost everywhere
Brian Warner [Fri, 25 May 2012 07:13:48 +0000 (00:13 -0700)]
use the new CheckResult getters almost everywhere

The remaining get_data() calls are either in
web.check_results.json_check_results(), or functioning as repr()s in
various unit test failure cases.

12 years agoCheckResults: replace get_data() with a bunch of individual getters
Brian Warner [Fri, 25 May 2012 07:13:32 +0000 (00:13 -0700)]
CheckResults: replace get_data() with a bunch of individual getters

12 years agochange CheckResults to use a fat set_data()
Brian Warner [Fri, 25 May 2012 07:13:23 +0000 (00:13 -0700)]
change CheckResults to use a fat set_data()

i.e. change set_data() to accept lots of parameters, instead of taking
a single dictionary with lots of keys. Also Convert all CheckResults
creators to use it.

12 years agoCheckResults: simplify self._data
Brian Warner [Fri, 25 May 2012 07:13:13 +0000 (00:13 -0700)]
CheckResults: simplify self._data

12 years agoCheckResults: start hiding .data, first step to clean it up
Brian Warner [Tue, 15 May 2012 04:57:43 +0000 (21:57 -0700)]
CheckResults: start hiding .data, first step to clean it up

The goal is to make CheckResults more strongly typed, and remove the
ambiguous ".data" field in favor of a bunch of specific counters and
sharelists, so I can changes .sharemap and .servermap to use IServer
instances instead of string serverids. By cleaning this up first, I hope
to get that task done with less debugging.

12 years agoimmutable.CiphertextFileNode.check_and_repair: simplify for refactoring
Brian Warner [Tue, 15 May 2012 04:53:49 +0000 (21:53 -0700)]
immutable.CiphertextFileNode.check_and_repair: simplify for refactoring

There were too many nested functions here, making some upcoming changes
too difficult, so let's refactor it first.

12 years agodocs/quickstart.rst: fix rst warning.
david-sarah [Fri, 1 Jun 2012 21:01:04 +0000 (21:01 +0000)]
docs/quickstart.rst: fix rst warning.

12 years agoRestore --rterrors option to 'setup.py test' and 'setup.py trial' to keep buildbots...
david-sarah [Thu, 31 May 2012 22:23:07 +0000 (22:23 +0000)]
Restore --rterrors option to 'setup.py test' and 'setup.py trial' to keep buildbots happy. refs #1699

12 years agoChange 'setup.py test' and 'setup.py trial' to pass --rterrors to trial by default...
david-sarah [Thu, 31 May 2012 22:00:00 +0000 (22:00 +0000)]
Change 'setup.py test' and 'setup.py trial' to pass --rterrors to trial by default. Suppress using --no-rterrors. Also pass --until-failure/-u to trial. fixes #1699

12 years agoCatch exceptions from CLI in order to prevent the Ubuntu crash monolog from triggerin...
david-sarah [Sun, 20 May 2012 15:35:29 +0000 (15:35 +0000)]
Catch exceptions from CLI in order to prevent the Ubuntu crash monolog from triggering. refs #1746

12 years agonode.py: stop stripping whitespace in write_private_config()
Brian Warner [Wed, 30 May 2012 07:17:55 +0000 (00:17 -0700)]
node.py: stop stripping whitespace in write_private_config()

It's nice to add newlines to the saved file, so 'cat' is easy to use. We
still strip on the input side, in get_or_create_private_config().

12 years agotest_web.py: fix memory leak when run with --until-failure
Brian Warner [Tue, 22 May 2012 22:18:26 +0000 (15:18 -0700)]
test_web.py: fix memory leak when run with --until-failure

The Fake*Node classes in test/common.py were accumulating share data in
a class-level dictionary, which persisted from one test run to the next.
As a result, running test_web.py over and over (with trial's
--until-failure feature) made this dictionary grow without bound,
eventually running out of memory.

This fix moves that dictionary into the FakeClient built fresh for each
test, so it doesn't build up. It does the same thing for "file_types",
which was much smaller but still lived at the class level.

Closes #1729

12 years agotest/check_memory.py: oops, fix one last ur.uri -> ur.get_uri()
Brian Warner [Tue, 22 May 2012 15:50:36 +0000 (08:50 -0700)]
test/check_memory.py: oops, fix one last ur.uri -> ur.get_uri()

12 years agochange UploadResults to return IServers, update users to match 8/head
Brian Warner [Tue, 22 May 2012 04:18:37 +0000 (21:18 -0700)]
change UploadResults to return IServers, update users to match

This finally changes all callers of get_servermap()/get_sharemap() to
accept IServers, and changes UploadResults to provide them.

12 years agoUploadResults: store IServers internally, but still return serverids
Brian Warner [Tue, 22 May 2012 04:18:25 +0000 (21:18 -0700)]
UploadResults: store IServers internally, but still return serverids

This stores IDisplayableServer-providing instances (StubServers or
NativeStorageServers) in the .servermap and .sharemap dictionaries. But
get_servermap()/get_sharemap() still return data structures with
serverids, not IServers, by translating their data on the way out. This
lets us put off changing the callers for a little bit longer.

12 years agosplit IDisplayableServer from IServer, add sb.get_stub_server()
Brian Warner [Tue, 22 May 2012 04:17:27 +0000 (21:17 -0700)]
split IDisplayableServer from IServer, add sb.get_stub_server()

IDisplayableServer includes just enough functionality to call
.get_name() and friends, which is all that the UploadResults really
need. IServer is a superset that includes actual share-manipulation
methods. StubServer instances provide only IDisplayableServer, while
actual NativeStorageServer instances provide the full IServer interface.

When the Helper sends a serverid (so we know what to call the server but
nothing else about it, and have no corresponding NativeStorageServer
object to reference), but we want to store an IDisplayableServer in the
UploadResults, we create a synthetic StubServer "server" and store that
instead.

12 years agoswitch UploadResults to use get_uri(), hide internal ._uri
Brian Warner [Tue, 22 May 2012 04:14:44 +0000 (21:14 -0700)]
switch UploadResults to use get_uri(), hide internal ._uri

Complete the getter-based transformation, by hiding ".uri" and updating
callers to use get_uri(). Also don't set a dummy self._uri, leave it
undefined until someone calls set_uri().

12 years agoswitch UploadResults to use getters, hide internal data, for all but .uri
Brian Warner [Tue, 22 May 2012 04:14:28 +0000 (21:14 -0700)]
switch UploadResults to use getters, hide internal data, for all but .uri

This hides attributes with e.g. _sharemap, and creates getters like
get_sharemap() to access them, for every field except .uri . This will
make it easier to modify the internal representation of .sharemap
without requiring callers to adjust quite yet.

".uri" has so many users that it seemed better to update it in a
subsequent patch.

12 years agoconvert UploadResults to a fat init
Brian Warner [Tue, 22 May 2012 04:14:14 +0000 (21:14 -0700)]
convert UploadResults to a fat init

Populate most of UploadResults (except .uri, which is learned later when
using a Helper) in the constructor, instead of allowing creators to
write to attributes later. This will help isolate the fields that we
want to change to use IServers.

12 years agoadd HelperUploadResults
Brian Warner [Tue, 22 May 2012 04:14:00 +0000 (21:14 -0700)]
add HelperUploadResults

This splits the pb.Copyable on-wire object (HelperUploadResults) out
from the local results object (UploadResults). To maintain compatibility
with older Helpers, we have to leave pb.Copyable classes alone and
unmodified, but we want to change UploadResults to use IServers instead
of serverids. So by using a different class on the wire, and translating
to/from it on either end, we can accomplish both.

12 years agoUploader cleanup: create results at end, not beginning
Brian Warner [Tue, 22 May 2012 04:13:47 +0000 (21:13 -0700)]
Uploader cleanup: create results at end, not beginning

This will make it easier to populate the UploadResults during __init__,
instead of doing it one-field-at-a-time later.

12 years agoclean up Helper to make later changes easier
Brian Warner [Tue, 22 May 2012 04:13:32 +0000 (21:13 -0700)]
clean up Helper to make later changes easier

Fix up control flow inside the Helper, to make it more friendly for
later refactoring.

12 years agohelper: remove timings["existence_check"], aka "Already-In-Grid Check"
Brian Warner [Tue, 22 May 2012 04:13:11 +0000 (21:13 -0700)]
helper: remove timings["existence_check"], aka "Already-In-Grid Check"

This measured how long the Helper took to do a filecheck before asking
for ciphertext. The "Contacting Helper" report includes both
existence_check and the client-helper RTT.

For non-overlapping uploads, it was being returned correctly. But when
multiple upload requests overlapped, and the file was not already in the
grid, the filecheck would only run once, and its existence_check time
would be reported for all uploaders (even if they didn't have to wait
for that time). Cleaning that up proved too difficult: the only correct
place to report this time is from the initial remote_upload_chk() call,
but the return value of that is too constrained to accomodate it in the
needs-upload case.

So I'm removing it altogether. Eventually I plan to add a proper
events/times field and record more data, including this check, in a form
that can be drawn on a nice zoomable timeline view.

Old clients talking to a new Helper (which doesn't supply the value)
will tolerate the loss (they'll just display an empty field on the web
view).

12 years agotest_checker: minor improvement in fake-server setup
Brian Warner [Thu, 17 May 2012 17:50:16 +0000 (10:50 -0700)]
test_checker: minor improvement in fake-server setup

This prepares for testing the differences between tubid and pubkey-based
name/longname.

12 years agodocs/frontends/FTP-and-SFTP.rst: remove outdated allmydata.com reference. fixes ...
david-sarah [Fri, 18 May 2012 22:56:18 +0000 (22:56 +0000)]
docs/frontends/FTP-and-SFTP.rst: remove outdated allmydata.com reference. fixes #1743

12 years agoSince we now require Python 2.5, we can use os.SEEK_END.
david-sarah [Wed, 16 May 2012 21:39:48 +0000 (21:39 +0000)]
Since we now require Python 2.5, we can use os.SEEK_END.

12 years agoSimplifications resulting from requiring Python 2.5 and therefore being able to use...
david-sarah [Wed, 16 May 2012 02:47:25 +0000 (02:47 +0000)]
Simplifications resulting from requiring Python 2.5 and therefore being able to use sqlite3 from the standard library. This also drops sqlite3 from the set of versions and paths we report.

12 years agoRequire Python 2.5.
david-sarah [Wed, 16 May 2012 02:41:49 +0000 (02:41 +0000)]
Require Python 2.5.

12 years agomisc/build_helpers/check-interfaces.py: avoid spurious warnings about ignored excepti...
david-sarah [Fri, 18 May 2012 02:12:52 +0000 (02:12 +0000)]
misc/build_helpers/check-interfaces.py: avoid spurious warnings about ignored exceptions on shutdown. Also make the check function able to write errors to an arbitrary stream.

12 years agodictutil.DictOfSets: remove .union() method, it was misleading
Brian Warner [Wed, 16 May 2012 23:50:57 +0000 (16:50 -0700)]
dictutil.DictOfSets: remove .union() method, it was misleading

Unlike set.union(), which returns a new set, DictOfSets.union() modified
the DictOfSets in-place. The name collision bit me when I changed some
code from using DictOfSets to a normal set, and expected that
set.union() would modify the set in-place. Since there was only one user
of DictOfSets.union, I figured it was safer to just get rid of it.

12 years agoimmutable repairer: populate servers-responding properly
Brian Warner [Wed, 16 May 2012 23:50:43 +0000 (16:50 -0700)]
immutable repairer: populate servers-responding properly

If a server did not respond to the pre-repair filecheck, but did respond
to the repair, that server was not correctly added to the
RepairResults.data["servers-responding"] list. (This resulted from a
buggy usage of DictOfSets.union() in filenode.py).

In addition, servers to which filecheck queries were sent, but did not
respond, were incorrectly added to the servers-responding list
anyawys. (This resulted from code in the checker.py not paying attention
to the 'responded' flag).

The first bug was neatly masked by the second: it's pretty rare to have
a server suddenly start responding in the one-second window between a
filecheck and a subsequent repair, and if the server was around for the
filecheck, you'd never notice the problem. I only spotted the smelly
code while I was changing it for IServer cleanup purposes.

I added coverage to test_repairer.py for this. Trying to get that test
to fail before fixing the first bug is what led me to discover the
second bug. I also had to update test_corrupt_file_verno, since it was
incorrectly asserting that 10 servers responded, when in fact one of
them throws an error (but the second bug was causing it to be reported
anyways).

12 years agoUpdate my (davidsarah) gpg fingerprint in CREDITS. Mwahaha! :-)
david-sarah [Wed, 16 May 2012 23:15:26 +0000 (23:15 +0000)]
Update my (davidsarah) gpg fingerprint in CREDITS. Mwahaha! :-)

12 years agofileutil.py: use try/finally to close file in write_atomically.
david-sarah [Wed, 16 May 2012 23:08:39 +0000 (23:08 +0000)]
fileutil.py: use try/finally to close file in write_atomically.

12 years agoChange logging.rst to address warner's review comment. refs #1693
david-sarah [Wed, 16 May 2012 22:13:29 +0000 (22:13 +0000)]
Change logging.rst to address warner's review comment. refs #1693

12 years agowrite node.url and portnum files atomically, to fix race in test_runner
Brian Warner [Mon, 14 May 2012 20:32:03 +0000 (13:32 -0700)]
write node.url and portnum files atomically, to fix race in test_runner

Previously, test_runner sometimes fails because the _node_has_started()
poller fires after the portnum file has been opened, but before it has
actually been filled, allowing the test process to observe an empty file,
which flunks the test.

This adds a new fileutil.write_atomically() function (using the usual
write-to-.tmp-then-rename approach), and uses it for both node.url and
client.port . These files are written a bit before the node is really up and
running, but they're late enough for test_runner's purposes, which is to know
when it's safe to read client.port and use 'tahoe restart' (and therefore
SIGINT) to restart the node.

The current node/client code doesn't offer any better "are you really done
with startup" indicator.. the ideal approach would be to either watch the
logfile, or connect to its flogport, but both are a hassle. Changing the node
to write out a new "all done" file would be intrusive for regular
operations.

12 years agoImprove a comment in __init__.py.
david-sarah [Mon, 14 May 2012 16:34:31 +0000 (16:34 +0000)]
Improve a comment in __init__.py.

12 years agoSuppress the PowmInsecureWarning from PyCrypto. refs #1586
david-sarah [Mon, 14 May 2012 03:23:52 +0000 (03:23 +0000)]
Suppress the PowmInsecureWarning from PyCrypto. refs #1586

12 years agoClarify an ambiguity about which version number is meant in quickstart.rst.
david-sarah [Mon, 14 May 2012 00:26:37 +0000 (00:26 +0000)]
Clarify an ambiguity about which version number is meant in quickstart.rst.

12 years agoperformance.rst: small updates, mention (lack of) MDMF
Brian Warner [Sun, 13 May 2012 21:07:39 +0000 (14:07 -0700)]
performance.rst: small updates, mention (lack of) MDMF

refs #1398