+
Skip to content

file descriptors cache needs to be disableable / configurable #31

Open
@kolayuk

Description

@kolayuk

Cuz for now it could cause issues on fetching pieces on the other nodes like

2024/09/11 13:51:50 [STORAGE] LOAD PIECE FROM 192.168.1.36:10501 ERR: failed to query piece 4. err: response deadline exceeded, err: context deadline exceeded

because node is waiting infinitely, also limit is too low for the lib as server usually have unlimited file descriptors setting.

But for nor now it is impossible to manage it, because
fs is private (being used in torrent.getInternalPieces)
limit is const

Reproduce steps:

  1. create multiple bags on a single process with ~10 mb file
tr, err := storage.CreateTorrent(ctx, c.rootStoragePath, user, user, c.progress, c.conn, refs, func(done uint64, max uint64) {
		if done == max {
			wg.Done()
		}
})
err = tr.Start(true, true, false)
  1. request those files on Ton-Proxy multiple times, after 3-4 try download gets stuck
curl ... -x https://127.0.0.1:8081 http://<BAG_ID>.bag/output.mp4 -o output_d.mp4

> GET http://<...>.bag/output.mp4 HTTP/2
> Host: ....bag
> User-Agent: curl/8.4.0
> Accept: */*
> Proxy-Connection: Keep-Alive
> 
{ [5 bytes data]
  0     0    0     0    0     0      0      0 --:--:--  0:09:42 --:--:--     0^C

^ 10 minutes trying to download

in case of downgrade to 0.6.3 issue is not reproducable anymore

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载