Commit Graph

2695 Commits

Author SHA1 Message Date
Matt Joiner 307d6d178f Prepare to implement max unverified bytes 2021-06-07 13:01:39 +10:00
Matt Joiner 8e9cb9f2be Do checks for preallocated requests too
Otherwise we reserve requests with the assumption that they can be assigned later, and they actually might not be.
2021-06-07 13:01:39 +10:00
Matt Joiner 9dd85e5bd2 Fix non-deterministic test 2021-06-07 13:01:39 +10:00
Matt Joiner b80e2b08b5 Get request rebalancing working optimally! 2021-06-07 13:01:39 +10:00
Matt Joiner 4e9f707aeb Move piece allocation to its own func 2021-06-07 13:01:39 +10:00
Matt Joiner 07ba6e9210 New tests and fixes for them
Not complete. There's still a request-stealing balancing issue, but it's functional for now.
2021-06-07 13:01:39 +10:00
Matt Joiner e7c5ed679f Don't log each applied request 2021-06-07 13:01:39 +10:00
Matt Joiner 26837ee73c Add a working request strategy test 2021-06-07 13:01:39 +10:00
Matt Joiner 0d4e566fc0 Extract request strategy stuff into a separate module 2021-06-07 13:01:39 +10:00
Matt Joiner 233135493f Improve num requests per piece status output 2021-06-07 13:01:39 +10:00
Matt Joiner f19564d597 Improve piece availability status output 2021-06-07 13:01:39 +10:00
Matt Joiner ef489f4a44 Fixes to reassigning chunks in requests 2021-06-07 13:01:39 +10:00
Matt Joiner 09823b9e36 Rework to improve work stealing and try to thread peers through all request pieces 2021-06-07 13:01:39 +10:00
Matt Joiner 4577e8a3c1 Forgot to remove initial have all state for webseeds
Later when the webseed was closed, it was assumed that it had contributed to the piece availability count.
2021-06-07 13:01:39 +10:00
Matt Joiner 16eb8a9693 Do requests every 100ms 2021-06-07 13:01:39 +10:00
Matt Joiner a2fcce5374 Don't need stable sort 2021-06-07 13:01:39 +10:00
Matt Joiner fc06909014 Improve naming on storage key 2021-06-07 13:01:39 +10:00
Matt Joiner 875ead3582 Reuse pieceRequestOrder slice 2021-06-07 13:01:39 +10:00
Matt Joiner 99a7cb9291 Missed piece availability code 2021-06-07 13:01:39 +10:00
Matt Joiner d9172ef277 Comments 2021-06-07 13:01:39 +10:00
Matt Joiner 6d25c99ac6 Ignore pieces for request after accounting for storage 2021-06-07 13:01:39 +10:00
Matt Joiner b508877d82 Track peer availability at the Torrent-level 2021-06-07 13:01:39 +10:00
Matt Joiner 2d2456249a Remove unused pieceRequestOrder in Client 2021-06-07 13:01:39 +10:00
Matt Joiner 52e6979457 go mod tidy 2021-06-07 13:01:39 +10:00
Matt Joiner 977a3ec00f Use multiless with Float64 2021-06-07 13:01:39 +10:00
Matt Joiner 9c9ba1aeac PeerConn.post becomes PeerConn.write 2021-06-07 13:01:39 +10:00
Matt Joiner 56e2a8a3a6 Fix download rate, status output 2021-06-07 13:01:39 +10:00
Matt Joiner 5f8471e21b Rework storage.TorrentImpl to support shared capacity key 2021-06-07 13:01:39 +10:00
Matt Joiner 6e97ce952f Tidy up request and cancel 2021-06-07 13:01:39 +10:00
Matt Joiner 5f437e6b7f Remove empty file 2021-06-07 13:01:39 +10:00
Matt Joiner b2c68b314b Limit outstanding requests 2021-06-07 13:01:39 +10:00
Matt Joiner 0830589b0a Pass tests with new full-client request strategy implementation 2021-06-07 13:01:39 +10:00
Matt Joiner 56e5d08eff Log failure to complete metadata 2021-06-07 12:57:42 +10:00
Matt Joiner f5d2ba37bc Count peers added from DHT for logging 2021-06-07 12:57:32 +10:00
Matt Joiner d7c549d2e4 Add TODOs around setting info bytes 2021-06-07 12:57:09 +10:00
Matt Joiner 125d7f0e90
Create go.yml (#497)
* Create go.yml

* Go version 1.16

* Add benchmarks

* Match CircleCI test coverage

* Add 15 minute timeout

* Don't log to file

* Download modules in separate step, minimize test runs

* Install godo before running torrentfs end-to-end test

* More fixes

* More fixes for GitHub Actions CI
2021-06-07 12:44:51 +10:00
gitpubber 8f6f47a2e0
Added build tags to disable few packages if necessary (#499) 2021-05-25 18:48:59 +10:00
Matt Joiner a60a4c9117 Progress testing without cgo a bit 2021-05-21 15:22:26 +10:00
Matt Joiner b21aebeaae Make wal the default for sqlite resource pieces
Fixes broken test as a result.
2021-05-17 11:56:10 +10:00
Matt Joiner 7798e2a306 Make synchronous=off the default 2021-05-17 11:56:10 +10:00
Matt Joiner c585b84126 Set smarter defaults 2021-05-17 11:56:10 +10:00
Matt Joiner fc0f2d146d Set page size before initializing connections
Setting page_size seems to be ignored if done after setting journal_mode, specifically to WAL I think. There's huge performance benefits to getting it right.
2021-05-17 11:56:10 +10:00
Matt Joiner ad421ea2d0 Default to sqlite piece completion for dir if cgo enabled 2021-05-14 15:51:26 +10:00
Matt Joiner a4e84688ae Fix sqlite piece completion 2021-05-14 15:45:54 +10:00
Matt Joiner 8654f1b01d Move envpprof.Stop to main 2021-05-14 15:43:24 +10:00
Matt Joiner 8585eb09ba Possible fix for GitHub code scanning warning 2021-05-14 15:43:13 +10:00
Matt Joiner 961cbfd765 Add CustomDirect BenchmarkMarkComplete sub-test 2021-05-14 15:42:54 +10:00
Matt Joiner bdcba73cf9 Fix race in webtorrent dial stats 2021-05-14 15:42:25 +10:00
Matt Joiner b9c36ebef3 cmd/torrent: Track download rate 2021-05-14 15:42:20 +10:00
Matt Joiner a44f9921aa Remove github.com/pkg/errors use in peerconn.go
Was contributing to unexpected CPU use, and it's way out of date.
2021-05-14 15:42:07 +10:00