]> Sergey Matveev's repositories - btrtrc.git/log
btrtrc.git
2 months agoclassic storage by default btrtrc-slow
Sergey Matveev [Wed, 20 Aug 2025 06:49:54 +0000 (09:49 +0300)]
classic storage by default

2 months agocmd/btrtrc client
Sergey Matveev [Thu, 20 Apr 2023 07:42:38 +0000 (10:42 +0300)]
cmd/btrtrc client

2 months agoAdd comment about nil rate.Limiter for webseed responses
Matt Joiner [Fri, 22 Aug 2025 04:52:14 +0000 (14:52 +1000)]
Add comment about nil rate.Limiter for webseed responses

2 months agoCompare Client and per-Torrent active webseed maps and reuse large allocations
Matt Joiner [Fri, 22 Aug 2025 04:51:51 +0000 (14:51 +1000)]
Compare Client and per-Torrent active webseed maps and reuse large allocations

2 months agocompare webseed OK responses to correct expected Content-Length
Matt Joiner [Thu, 21 Aug 2025 06:32:44 +0000 (16:32 +1000)]
compare webseed OK responses to correct expected Content-Length

Should compare to the entire file length, not the end of the current part (good guess tho).
Also fix bad URL conversion to struct in logger, and don't skip logging interesting case before returning error.

2 months agoJust use File.WriteAt for mmap file io WriteAt
Matt Joiner [Thu, 21 Aug 2025 04:25:48 +0000 (14:25 +1000)]
Just use File.WriteAt for mmap file io WriteAt

Also remove WriteTo for shared handle, it doesn't make sense without a pos.

2 months agoRejigger library search paths for possum tests
Matt Joiner [Thu, 21 Aug 2025 04:24:54 +0000 (14:24 +1000)]
Rejigger library search paths for possum tests

2 months agoAdd git ignores for Sintel test in fs directory
Matt Joiner [Thu, 21 Aug 2025 02:22:12 +0000 (12:22 +1000)]
Add git ignores for Sintel test in fs directory

2 months agoAdd a test for seek data right after writing to mmap and not syncing
Matt Joiner [Wed, 20 Aug 2025 01:43:05 +0000 (11:43 +1000)]
Add a test for seek data right after writing to mmap and not syncing

2 months agoGive webseed request goroutines readable names
Matt Joiner [Wed, 20 Aug 2025 01:42:33 +0000 (11:42 +1000)]
Give webseed request goroutines readable names

2 months agoAvoid buffering to write zeroes
Matt Joiner [Wed, 20 Aug 2025 01:41:25 +0000 (11:41 +1000)]
Avoid buffering to write zeroes

2 months agoSpecialize the limited write for hashing in file storage
Matt Joiner [Tue, 19 Aug 2025 07:44:37 +0000 (17:44 +1000)]
Specialize the limited write for hashing in file storage

2 months agoSkip holes with mmapFileIo
Matt Joiner [Tue, 19 Aug 2025 07:49:00 +0000 (17:49 +1000)]
Skip holes with mmapFileIo

2 months agoRemove possum storage replace master v1.59.1
Matt Joiner [Mon, 18 Aug 2025 05:07:58 +0000 (15:07 +1000)]
Remove possum storage replace

Fixes #1020.

2 months agoSync to tagged deps v1.59.0
Matt Joiner [Fri, 15 Aug 2025 01:28:25 +0000 (11:28 +1000)]
Sync to tagged deps

2 months agoAdd TODO on SEEK_DATA
Matt Joiner [Fri, 15 Aug 2025 01:10:28 +0000 (11:10 +1000)]
Add TODO on SEEK_DATA

2 months agoMerge branch 'erigon'
Matt Joiner [Fri, 15 Aug 2025 01:06:01 +0000 (11:06 +1000)]
Merge branch 'erigon'

2 months agoSet default webseed host request concurrency to 25
Matt Joiner [Fri, 15 Aug 2025 01:04:48 +0000 (11:04 +1000)]
Set default webseed host request concurrency to 25

2 months agoSet default file IO implementation to mmap
Matt Joiner [Fri, 15 Aug 2025 01:04:35 +0000 (11:04 +1000)]
Set default file IO implementation to mmap

2 months agoSmall improvements to cmd/torrent2 metainfo pprint
Matt Joiner [Thu, 14 Aug 2025 07:13:48 +0000 (17:13 +1000)]
Small improvements to cmd/torrent2 metainfo pprint

2 months agoBlock Torrent.Complete on hashing
Matt Joiner [Thu, 14 Aug 2025 07:13:05 +0000 (17:13 +1000)]
Block Torrent.Complete on hashing

2 months agoUpdate webseed requests if queue is completely drained
Matt Joiner [Thu, 14 Aug 2025 02:46:10 +0000 (12:46 +1000)]
Update webseed requests if queue is completely drained

2 months agoRebuke webseed peers for a minute on bad responses
Matt Joiner [Thu, 14 Aug 2025 02:45:51 +0000 (12:45 +1000)]
Rebuke webseed peers for a minute on bad responses

2 months agoAdd webseed.ReadRequestPartError
Matt Joiner [Thu, 14 Aug 2025 02:41:57 +0000 (12:41 +1000)]
Add webseed.ReadRequestPartError

2 months agoSkip unnecessary peer iteration when there's no peers to ban
Matt Joiner [Thu, 14 Aug 2025 02:39:59 +0000 (12:39 +1000)]
Skip unnecessary peer iteration when there's no peers to ban

2 months agoRemove pprof labels for webseed request read routine
Matt Joiner [Thu, 14 Aug 2025 02:40:18 +0000 (12:40 +1000)]
Remove pprof labels for webseed request read routine

2 months agoDon't close webseed peers for bad data
Matt Joiner [Thu, 14 Aug 2025 02:30:34 +0000 (12:30 +1000)]
Don't close webseed peers for bad data

2 months agoDon't issue webseed requests that clobber pending cancels
Matt Joiner [Thu, 14 Aug 2025 02:27:23 +0000 (12:27 +1000)]
Don't issue webseed requests that clobber pending cancels

2 months agoTrack activeWebseedRequests in Client too
Matt Joiner [Thu, 14 Aug 2025 02:36:12 +0000 (12:36 +1000)]
Track activeWebseedRequests in Client too

2 months agoMaybe partial file for existing webseed requests that are finished would panic
Matt Joiner [Thu, 14 Aug 2025 02:25:54 +0000 (12:25 +1000)]
Maybe partial file for existing webseed requests that are finished would panic

2 months agoFix out of bounds in mmap WriteTo
Matt Joiner [Thu, 14 Aug 2025 02:15:23 +0000 (12:15 +1000)]
Fix out of bounds in mmap WriteTo

2 months agoLog source fetch fail when not retrying
Matt Joiner [Thu, 14 Aug 2025 02:14:56 +0000 (12:14 +1000)]
Log source fetch fail when not retrying

2 months agoUse msync flushing in mmap file io
Matt Joiner [Thu, 14 Aug 2025 02:13:49 +0000 (12:13 +1000)]
Use msync flushing in mmap file io

2 months agoMerge aprioriWebseedRequestKey and webseedUniqueRequestKey
Matt Joiner [Wed, 13 Aug 2025 02:12:18 +0000 (12:12 +1000)]
Merge aprioriWebseedRequestKey and webseedUniqueRequestKey

2 months agoFix some tests that didn't hold lock while deferring actions
Matt Joiner [Wed, 13 Aug 2025 01:57:26 +0000 (11:57 +1000)]
Fix some tests that didn't hold lock while deferring actions

2 months agogorond
Matt Joiner [Wed, 13 Aug 2025 01:57:03 +0000 (11:57 +1000)]
gorond

2 months agoFix some lints
Matt Joiner [Wed, 13 Aug 2025 01:56:43 +0000 (11:56 +1000)]
Fix some lints

2 months agoRework existing webseed requests for unique slice indexes
Matt Joiner [Wed, 13 Aug 2025 01:42:12 +0000 (11:42 +1000)]
Rework existing webseed requests for unique slice indexes

2 months agoTry harder to pass useful error on webseed read chunks cancellation
Matt Joiner [Tue, 12 Aug 2025 14:32:59 +0000 (00:32 +1000)]
Try harder to pass useful error on webseed read chunks cancellation

2 months agoWait 1-2 mins between failed metainfo fetches
Matt Joiner [Tue, 12 Aug 2025 14:31:09 +0000 (00:31 +1000)]
Wait 1-2 mins between failed metainfo fetches

2 months agoUse ignorePieceForRequests instead of shady pending pieces
Matt Joiner [Tue, 12 Aug 2025 14:28:21 +0000 (00:28 +1000)]
Use ignorePieceForRequests instead of shady pending pieces

2 months agoAdd mmap alternative IO system for file storage
Matt Joiner [Tue, 12 Aug 2025 14:27:26 +0000 (00:27 +1000)]
Add mmap alternative IO system for file storage

2 months agoAllow args to just test
Matt Joiner [Tue, 12 Aug 2025 14:26:17 +0000 (00:26 +1000)]
Allow args to just test

2 months agoDon't assign DisallowData* being assigned in Torrent.MergeSpec
Matt Joiner [Tue, 12 Aug 2025 13:40:59 +0000 (23:40 +1000)]
Don't assign DisallowData* being assigned in Torrent.MergeSpec

This was masking an ancient bug in SetInfoBytes, and AllowDataDownload!

2 months agoFix AllowDataDownload not triggering piece request state
Matt Joiner [Tue, 12 Aug 2025 13:31:18 +0000 (23:31 +1000)]
Fix AllowDataDownload not triggering piece request state

2 months agoAdd checks that defers only occur on write locks
Matt Joiner [Tue, 12 Aug 2025 13:29:42 +0000 (23:29 +1000)]
Add checks that defers only occur on write locks

2 months agoAdd MetainfoSourcesMerger
Matt Joiner [Tue, 12 Aug 2025 13:27:36 +0000 (23:27 +1000)]
Add MetainfoSourcesMerger

2 months agoBreak out file IO abstraction
Matt Joiner [Mon, 11 Aug 2025 06:09:47 +0000 (16:09 +1000)]
Break out file IO abstraction

2 months agoDon't panic on non-zero chunk sizes in Client.AddTorrentSpec
Matt Joiner [Mon, 11 Aug 2025 01:19:13 +0000 (11:19 +1000)]
Don't panic on non-zero chunk sizes in Client.AddTorrentSpec

2 months agoFix build on Windows
Matt Joiner [Fri, 8 Aug 2025 03:29:22 +0000 (13:29 +1000)]
Fix build on Windows

2 months agoMove assertion back to proper place
Matt Joiner [Fri, 8 Aug 2025 02:09:23 +0000 (12:09 +1000)]
Move assertion back to proper place

2 months agoImprove webseed part request log message for identifying cache boundaries
Matt Joiner [Thu, 7 Aug 2025 05:48:30 +0000 (15:48 +1000)]
Improve webseed part request log message for identifying cache boundaries

2 months agoTODO on stat atomics being out of sync
Matt Joiner [Thu, 7 Aug 2025 05:48:06 +0000 (15:48 +1000)]
TODO on stat atomics being out of sync

2 months agoConvert cmd/torrent2 to bargle/v2
Matt Joiner [Thu, 7 Aug 2025 05:47:44 +0000 (15:47 +1000)]
Convert cmd/torrent2 to bargle/v2

2 months agoLower webseed read chunks log level when peer is closed
Matt Joiner [Wed, 6 Aug 2025 12:56:36 +0000 (22:56 +1000)]
Lower webseed read chunks log level when peer is closed

2 months agoFix proposed and existing cancelled webseed requests colliding in priority heap
Matt Joiner [Wed, 6 Aug 2025 10:36:29 +0000 (20:36 +1000)]
Fix proposed and existing cancelled webseed requests colliding in priority heap

2 months agoClear pprof labels in spawned webseed requests
Matt Joiner [Wed, 6 Aug 2025 10:34:56 +0000 (20:34 +1000)]
Clear pprof labels in spawned webseed requests

2 months agoProbably fix a nasty buffer size performance issue with rate limited readers
Matt Joiner [Wed, 6 Aug 2025 10:34:40 +0000 (20:34 +1000)]
Probably fix a nasty buffer size performance issue with rate limited readers

2 months agoSkip download rate limited reader wrapping if DownloadRateLimiter is nil
Matt Joiner [Wed, 6 Aug 2025 10:34:08 +0000 (20:34 +1000)]
Skip download rate limited reader wrapping if DownloadRateLimiter is nil

2 months agoFix new warning in piece hashing due to new file piece WriteTo
Matt Joiner [Wed, 6 Aug 2025 10:25:27 +0000 (20:25 +1000)]
Fix new warning in piece hashing due to new file piece WriteTo

2 months agoFix Torrent.close race in test
Matt Joiner [Wed, 6 Aug 2025 10:22:01 +0000 (20:22 +1000)]
Fix Torrent.close race in test

2 months agoSupport setting the Type-Of-Service field to 'throughput' for sockets (#1017)
Victor [Tue, 5 Aug 2025 16:20:08 +0000 (19:20 +0300)]
Support setting the Type-Of-Service field to 'throughput' for sockets (#1017)

2 months agoFix chansync dep
Matt Joiner [Tue, 5 Aug 2025 14:42:29 +0000 (00:42 +1000)]
Fix chansync dep

2 months agoTry to show context cancellation cause after io.ReadFull
Matt Joiner [Tue, 5 Aug 2025 14:00:32 +0000 (00:00 +1000)]
Try to show context cancellation cause after io.ReadFull

2 months agoSort webseed request heap deterministically
Matt Joiner [Tue, 5 Aug 2025 13:59:44 +0000 (23:59 +1000)]
Sort webseed request heap deterministically

2 months agoCode comments
Matt Joiner [Tue, 5 Aug 2025 12:52:10 +0000 (22:52 +1000)]
Code comments

2 months agoRemove debug log showing up in profiling
Matt Joiner [Tue, 5 Aug 2025 12:51:53 +0000 (22:51 +1000)]
Remove debug log showing up in profiling

2 months agoPedantic optimization of Torrent.AllowDataDownload and AllowDataUpload
Matt Joiner [Tue, 5 Aug 2025 12:51:28 +0000 (22:51 +1000)]
Pedantic optimization of Torrent.AllowDataDownload and AllowDataUpload

2 months agoSet cached piece completion directly on piece hashed
Matt Joiner [Tue, 5 Aug 2025 12:50:08 +0000 (22:50 +1000)]
Set cached piece completion directly on piece hashed

2 months agoFix premature return from GetRequestablePieces iterator
Matt Joiner [Tue, 5 Aug 2025 12:45:56 +0000 (22:45 +1000)]
Fix premature return from GetRequestablePieces iterator

Was missed in earlier refactor

2 months agoSimplify part file promotion and demotion
Matt Joiner [Tue, 5 Aug 2025 12:45:13 +0000 (22:45 +1000)]
Simplify part file promotion and demotion

2 months agoReplace nasty SI file size prefix
Matt Joiner [Tue, 5 Aug 2025 12:43:41 +0000 (22:43 +1000)]
Replace nasty SI file size prefix

2 months agoPropagate better webseed cancellation errors and cancel requests on peer context
Matt Joiner [Tue, 5 Aug 2025 12:42:59 +0000 (22:42 +1000)]
Propagate better webseed cancellation errors and cancel requests on peer context

2 months agoFix pointless double open on unhandled open for write errors
Matt Joiner [Tue, 5 Aug 2025 12:41:13 +0000 (22:41 +1000)]
Fix pointless double open on unhandled open for write errors

2 months agoExpose TORRENT_WEBSEED_REQUEST_CHUNK_SIZE
Matt Joiner [Tue, 5 Aug 2025 12:40:18 +0000 (22:40 +1000)]
Expose TORRENT_WEBSEED_REQUEST_CHUNK_SIZE

2 months agoFix very rare double Torrent close panic
Matt Joiner [Tue, 5 Aug 2025 12:38:40 +0000 (22:38 +1000)]
Fix very rare double Torrent close panic

2 months agoExtract webseed end request calculation and avoid bug for now
Matt Joiner [Tue, 5 Aug 2025 10:02:18 +0000 (20:02 +1000)]
Extract webseed end request calculation and avoid bug for now

2 months agoMake webseedUrlKey more ergonomic to use
Matt Joiner [Tue, 5 Aug 2025 10:01:13 +0000 (20:01 +1000)]
Make webseedUrlKey more ergonomic to use

2 months agoEnsure Torrent.pieceCompletionChanged always runs on piece init
Matt Joiner [Tue, 5 Aug 2025 09:59:32 +0000 (19:59 +1000)]
Ensure Torrent.pieceCompletionChanged always runs on piece init

2 months agoIgnore pieces with unknown completion for requests
Matt Joiner [Tue, 5 Aug 2025 09:56:39 +0000 (19:56 +1000)]
Ignore pieces with unknown completion for requests

2 months agoSet deferred unique actions map to nil rather than clear
Matt Joiner [Tue, 5 Aug 2025 09:55:16 +0000 (19:55 +1000)]
Set deferred unique actions map to nil rather than clear

2 months agoAdd TORRENT_MAX_ACTIVE_PIECE_HASHERS
Matt Joiner [Tue, 5 Aug 2025 09:54:51 +0000 (19:54 +1000)]
Add TORRENT_MAX_ACTIVE_PIECE_HASHERS

2 months agoExtra pedantry in chunkIndexSpec
Matt Joiner [Tue, 5 Aug 2025 05:49:34 +0000 (15:49 +1000)]
Extra pedantry in chunkIndexSpec

2 months agoAdd request-strategy.Btree.Contains
Matt Joiner [Tue, 5 Aug 2025 05:49:09 +0000 (15:49 +1000)]
Add request-strategy.Btree.Contains

We'll need it later when we use piece request order instead of Torrent._pendingPieces.

2 months agoConvert GetRequestablePieces to an iterator
Matt Joiner [Tue, 5 Aug 2025 02:32:30 +0000 (12:32 +1000)]
Convert GetRequestablePieces to an iterator

2 months agoFix panic in piece request order length status
Matt Joiner [Tue, 5 Aug 2025 02:30:40 +0000 (12:30 +1000)]
Fix panic in piece request order length status

2 months agoUse unique.Handle for webseedUrlKey
Matt Joiner [Mon, 4 Aug 2025 23:55:05 +0000 (09:55 +1000)]
Use unique.Handle for webseedUrlKey

Should greatly improve apriori map lookup performance.

2 months agoInclude webseed update reason and some extra debug stuff
Matt Joiner [Mon, 4 Aug 2025 12:15:41 +0000 (22:15 +1000)]
Include webseed update reason and some extra debug stuff

2 months agoInclude CF-Cache-Status in webseed debug
Matt Joiner [Mon, 4 Aug 2025 10:27:59 +0000 (20:27 +1000)]
Include CF-Cache-Status in webseed debug

3 months agoTons of webseed optimizations
Matt Joiner [Fri, 1 Aug 2025 13:51:28 +0000 (23:51 +1000)]
Tons of webseed optimizations

Avoid extra allocation in firstDirtyChunk
Allow multiple requests per file (now called slices or webseed chunks)
Reduce many allocations and extra work in webseed heap ordering
Add webseed request update pprof labels
Use a larger buffer for copying webseed response parts

3 months agoSwitch segments to use iterators
Matt Joiner [Fri, 1 Aug 2025 08:20:13 +0000 (18:20 +1000)]
Switch segments to use iterators

Trying to reduce allocations

3 months agoSwitch to segments.Index.LocateIter everywhere
Matt Joiner [Fri, 1 Aug 2025 06:11:50 +0000 (16:11 +1000)]
Switch to segments.Index.LocateIter everywhere

3 months agoAvoid Iterator allocation
Matt Joiner [Fri, 1 Aug 2025 05:51:52 +0000 (15:51 +1000)]
Avoid Iterator allocation

3 months agoUse unique.Handle for piece order infohashes
Matt Joiner [Fri, 1 Aug 2025 03:38:51 +0000 (13:38 +1000)]
Use unique.Handle for piece order infohashes

3 months agoMake Client.Close more responsive
Matt Joiner [Fri, 1 Aug 2025 03:04:30 +0000 (13:04 +1000)]
Make Client.Close more responsive

Stop updating webseed requests ASAP.
Set the Client closed event outside of the Client lock.
Make Client initialization more consistent for Close.

3 months agogorond
Matt Joiner [Thu, 31 Jul 2025 13:18:44 +0000 (23:18 +1000)]
gorond

3 months agoUpdate missinggo/v2 to fix stm test errors
Matt Joiner [Thu, 31 Jul 2025 13:18:33 +0000 (23:18 +1000)]
Update missinggo/v2 to fix stm test errors

3 months agoTruncate webseed requests to response body cache boundaries
Matt Joiner [Thu, 31 Jul 2025 01:54:39 +0000 (11:54 +1000)]
Truncate webseed requests to response body cache boundaries

3 months agoRejigger the webseed debug logging
Matt Joiner [Thu, 31 Jul 2025 01:54:06 +0000 (11:54 +1000)]
Rejigger the webseed debug logging

3 months agoPrevent webseed requests when torrent data download disallowed
Matt Joiner [Thu, 31 Jul 2025 01:52:19 +0000 (11:52 +1000)]
Prevent webseed requests when torrent data download disallowed