Commit Graph

2711 Commits

Author SHA1 Message Date
Brian Warner
c89a464510 Share: drop received data after each block finishes. Quick fix for the #1170 spans.py complexity bug. 2010-08-31 18:35:58 -07:00
francois
f026927f86 web: refactor rate computation, fixes #1166 2010-08-15 07:19:33 -07:00
Brian Warner
a3cf3331d2 DownloadStatus: put real numbers in progress/status rows, not placeholders.
Improve tests.
2010-08-09 23:06:03 -07:00
Brian Warner
dc1afc81bb web download-status: tolerate DYHBs that haven't retired yet. Fixes #1160.
Also add a better unit test for it.
2010-08-09 15:51:00 -07:00
Brian Warner
5267fc17fe immutable/filenode.py: put off DownloadStatus creation until first read() call
This avoids spamming the "recent uploads and downloads" /status page from
FileNode instances that were created for a directory read but which nobody is
ever going to read from. I also cleaned up the way DownloadStatus instances
are made to only ever do it in the CiphertextFileNode, not in the
higher-level plaintext FileNode. Also fixed DownloadStatus handling of read
size, thanks to David-Sarah for the catch.
2010-08-09 15:50:55 -07:00
Brian Warner
ed821d1504 Share: hush log entries in the main loop() after the fetch has been completed. 2010-08-09 13:43:59 -07:00
david-sarah
fd9a2205de test_runner.py: correct and simplify normalization of package directory for case-insensitive filesystems. 2010-08-08 11:50:05 -07:00
david-sarah
f88e4f0df6 test_runner.py: make test_path work for test-from-installdir. 2010-08-08 10:13:40 -07:00
david-sarah
f5bf900d64 src/allmydata/__init__.py: make the package paths more accurate when we fail to get them from setuptools. 2010-08-08 10:12:35 -07:00
david-sarah
dc53d4f5ef test_runner.py: another try at calculating the rootdir correctly for test-from-egg and test-from-prefixdir. 2010-08-08 08:43:07 -07:00
david-sarah
39fa9a81d1 test_runner.py: calculate the location of bin/tahoe correctly for test-from-prefixdir (by copying code from misc/build_helpers/run_trial.py). Also fix the false-positive check for Unicode paths in test_the_right_code, which was causing skips that should have been failures. 2010-08-07 21:28:17 -07:00
Brian Warner
4b7c94ece0 downloader.Segmentation: unregisterProducer when asked to stopProducing, this
seems to avoid the #1155 log message which reveals the URI (and filecap).

Also add an [ERROR] marker to the flog entry, since unregisterProducer also
makes interrupted downloads appear "200 OK"; this makes it more obvious that
the download did not complete.
2010-08-06 00:07:05 -07:00
david-sarah
a79ec1c6cd test_util.py: use SHA-256 from pycryptopp instead of MD5 from hashlib (for uses in which any hash will do), since hashlib was only added to the stdlib in Python 2.5. 2010-08-05 22:00:51 -07:00
david-sarah
600cb95fe2 test_runner.py: increase timeout to cater for Francois' ARM buildslave. 2010-08-05 21:26:01 -07:00
david-sarah
8e90255349 test_util.py: remove use of 'a if p else b' syntax that requires Python 2.5. 2010-08-05 21:16:16 -07:00
Brian Warner
a0124e95ee test_download.DownloadTest.test_simultaneous_goodguess: enable some disabled
checks that used to fail but work now.
2010-08-05 11:55:07 -07:00
Brian Warner
f6f9a97627 DownloadNode: fix lost-progress in fetch_failed, tolerate cancel when no segment-fetch is active. Fixes #1154.
The lost-progress bug occurred when two simultanous read() calls fetched
different segments, and the first one failed (due to corruption, or the other
bugs in #1154): the second read() would never complete. While in this state,
cancelling the second read by having its consumer call stopProducing) would
trigger the cancel-intolerance bug. Finally, in downloader.node.Cancel,
prevent late cancels by adding an 'active' flag
2010-08-05 11:55:07 -07:00
Brian Warner
43c5032105 util/spans.py: __nonzero__ cannot return a long either. for #1154 2010-08-05 11:55:07 -07:00
david-sarah
cd8d41584e test_storage.py: change skip note for test_large_share to say that Windows doesn't support sparse files. refs #569 2010-08-04 19:26:12 -07:00
Brian Warner
8844655705 One fix for bug #1154: webapi GETs with a 'Range' header broke new-downloader.
The Range header causes n.read() to be called with an offset= of type 'long',
which eventually got used in a Spans/DataSpans object's __len__ method.
Apparently python doesn't permit __len__() to return longs, only ints.
Rewrote Spans/DataSpans to use s.len() instead of len(s) aka s.__len__() .
Added a test in test_download. Note that test_web didn't catch this because
it uses mock FileNodes for speed: it's probably time to rewrite that.

There is still an unresolved error-recovery problem in #1154, so I'm not
closing the ticket quite yet.
2010-08-04 11:45:49 -07:00
Brian Warner
2bd8749849 test_download: minor cleanup 2010-08-04 10:55:55 -07:00
Brian Warner
fa34e4dd16 fetcher.py: improve comments 2010-08-04 00:28:14 -07:00
Brian Warner
2a05aa2d91 lazily create DownloadNode upon first read()/get_segment() 2010-08-04 00:28:08 -07:00
Brian Warner
abcd6e0e96 test_hung_server: update comments, remove dead "stage_4_d" code 2010-08-04 00:28:00 -07:00
Brian Warner
919938dd95 copy the rest of David-Sarah's changes to make my tree match 1.8.0beta 2010-08-04 00:27:52 -07:00
Brian Warner
20847dd876 ShareFinder: add 10s OVERDUE timer, send new requests to replace overdue ones
The fixed 10-second timer will eventually be replaced with a per-server
value, calculated based on observed response times.

test_hung_server.py: enhance to exercise DYHB=OVERDUE state. Split existing
mutable+immutable tests into two pieces for clarity. Reenabled several tests.
Deleted the now-obsolete "test_failover_during_stage_4".
2010-08-04 00:27:41 -07:00
Brian Warner
63b61ce7bd Rewrite immutable downloader (#798). This patch adds and updates unit tests. 2010-08-04 00:27:10 -07:00
Brian Warner
7b7b0c9709 Rewrite immutable downloader (#798). This patch includes higher-level
integration into the NodeMaker, and updates the web-status display to handle
the new download events.
2010-08-04 00:27:02 -07:00
Brian Warner
797828f47f Rewrite immutable downloader (#798). This patch rearranges the rest of src/allmydata/immutable/ . 2010-08-04 00:26:39 -07:00
Brian Warner
22a07e9bbe Rewrite immutable downloader (#798). This patch adds the new downloader itself. 2010-08-04 00:26:29 -07:00
Brian Warner
88d7ec2d54 util/observer.py: add EventStreamObserver 2010-08-04 00:26:12 -07:00
Brian Warner
cbcb728e7e Add a byte-spans utility class, like perl's Set::IntSpan for .newsrc files.
Also a data-spans class, which records a byte (instead of a bit) for each
index.
2010-08-04 00:26:00 -07:00
david-sarah
f10f9a8646 test_storage.py: avoid spurious test failure by accepting either 'Next crawl in 59 minutes' or 'Next crawl in 60 minutes'. fixes #1140 2010-08-03 03:20:58 -07:00
david-sarah
a7c474a098 CLI: further improve consistency of basedir options and add tests. addresses #118 2010-08-03 01:54:16 -07:00
david-sarah
b730385ec8 CLI: make the synopsis for 'tahoe unlink' say unlink instead of rm. 2010-08-03 01:53:59 -07:00
david-sarah
a32f625db9 CLI: make all of the option descriptions imperative sentences. 2010-08-03 01:48:01 -07:00
david-sarah
51eeea900f test_cli.py: make 'tahoe mkdir' tests slightly less dumb (check for 'URI:' in the output). 2010-08-03 01:47:20 -07:00
david-sarah
b9174b5fe7 test_cli.py: use u-escapes instead of UTF-8. 2010-08-03 01:35:38 -07:00
david-sarah
d81e8acf88 test_runner.py: add test_run_with_python_options, which checks that the Windows script changes haven't broken 'python <options> bin/tahoe'. 2010-08-01 23:25:58 -07:00
david-sarah
3ddb4a9bbf test_runner.py: fix missing import of get_filesystem_encoding 2010-08-01 23:09:02 -07:00
david-sarah
3af6f19cb0 misc/build_helpers/run_trial.py: check that the root from which the module we are testing was loaded is the current directory. This version of the patch folds in later fixes to the logic for caculating the directories to compare, and improvements to error messages. addresses #1137 2010-08-01 21:55:35 -07:00
david-sarah
88b6c57a1c Skip option arguments to the python interpreter when reconstructing Unicode argv on Windows. 2010-07-27 23:27:31 -07:00
david-sarah
1a5a33886d windows/fixups.py: improve comments and reference some relevant Python bugs. 2010-07-27 11:19:21 -07:00
david-sarah
b5f052a0d7 windows/fixups.py: make errors reported to original_stderr have enough information to debug even if we can't see the traceback. 2010-07-26 15:19:04 -07:00
david-sarah
ec6a674a5c windows/fixups.py: fix paste-o in name of Unicode stderr wrapper. 2010-07-26 14:47:36 -07:00
david-sarah
54bbc5325f windows/fixups.py: Don't rely on buggy MSVCRT library for Unicode output, use the Win32 API instead. This should make it work on XP. Also, change how we handle the case where sys.stdout and sys.stderr are redirected, since the .encoding attribute isn't necessarily writeable. 2010-07-25 21:50:19 -07:00
david-sarah
1fad717aaa test_runner.py: change to code for locating the bin/tahoe script that was missed when rebasing the patch for #1074. 2010-07-25 11:20:08 -07:00
david-sarah
9d04b2a317 Add missing windows/fixups.py (for setting up Unicode args and output on Windows). 2010-07-25 02:28:49 -07:00
david-sarah
37b07a545f Changes to Tahoe needed to work with new zetuptoolz (that does not use .exe wrappers on Windows), and to support Unicode arguments and stdout/stderr -- v5 2010-07-25 01:32:16 -07:00
david-sarah
54a9ba8232 scripts/common.py: fix an error introduced when rebasing to the ticket798 branch, which caused base directories to be duplicated in self.basedirs. 2010-08-01 23:49:29 -07:00