Skip to content

Implement a number of improvements and bug fixes with download logic#1472

Merged
jpdillingham merged 10 commits into
masterfrom
prime-transfers
Oct 10, 2025
Merged

Implement a number of improvements and bug fixes with download logic#1472
jpdillingham merged 10 commits into
masterfrom
prime-transfers

Conversation

@jpdillingham

Copy link
Copy Markdown
Member

I've been stress testing the download logic over the last week or so by enqueuing ~1000 files at the same time, and I've been able to tweak things so that the success rate is 100% (I'm sure it's 99.something in reality), which is up from maybe 60-70% when I started

Some of the changes:

  • Upgraded Soulseek.NET to 8.3.0, which had a few of its own improvements
  • Disabled the connection write queue for all types other than distributed (this was a major culprit)
  • Configured timeouts for socket send and receive (possible indefinite hang if the receiving side is not reading/writing)

Lastly, the logic that enqueues files has been updated so that it first inserts a record for each file in the batch in the Queued | Locally state before requesting them from the remote client concurrently (up to 10), which means transfers will no longer slowly show up in the UI one at a time.

The logic has also been adjusted so that it no longer waits until the files are enqueued; it returns as soon as the download tasks have been kicked off. This should give a better and more predictable experience when initiating downloads.

@jpdillingham jpdillingham merged commit baafe5f into master Oct 10, 2025
4 checks passed
@jpdillingham jpdillingham deleted the prime-transfers branch October 10, 2025 23:47
alexlebens pushed a commit to alexlebens/infrastructure that referenced this pull request Nov 6, 2025
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [slskd/slskd](https://slskd.org) ([source](https://github.com/slskd/slskd)) | minor | `0.23.2` -> `0.24.0` |

---

### Release Notes

<details>
<summary>slskd/slskd (slskd/slskd)</summary>

### [`v0.24.0`](https://github.com/slskd/slskd/releases/tag/0.24.0)

[Compare Source](slskd/slskd@0.23.2...0.24.0)

### 🔧 Transfer Overhaul

This release incorporates a ton of bug fixes and refactoring in both slskd and the underlying [Soulseek.NET](https://github.com/jpdillingham/Soulseek.NET) library with the goal of resolving 'stuck' and failing transfers (both uploads and downloads).

#### What's Changed

- fix(docs): add missing prefixes to some environment variables by [@&#8203;RalphORama](https://github.com/RalphORama) in [#&#8203;1420](slskd/slskd#1420)
- Add telemetry module to make Prometheus metrics available in the UI by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1410](slskd/slskd#1410)
- Fix debug log that displays information about migrations at startup by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1421](slskd/slskd#1421)
- Refactor initialization of database connection strings by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1422](slskd/slskd#1422)
- Eliminate 'magic strings' when referencing databases and connection strings by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1423](slskd/slskd#1423)
- Bump Soulseek.NET to 8.0.0 by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1438](slskd/slskd#1438)
- Fix bug causing 'Value cannot be null. (Parameter 'instance')' while editing a commented-out config by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1441](slskd/slskd#1441)
- Bump form-data in /src/web by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1439](slskd/slskd#1439)
- Bump ws in /src/web by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1440](slskd/slskd#1440)
- Tweak how file access is handled when validating config by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1449](slskd/slskd#1449)
- Refactor upload logic, splitting file enqueue and upload and adding defensive checks throughout by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1456](slskd/slskd#1456)
- Refactor transfer progress update logic by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1457](slskd/slskd#1457)
- Support the ability for the web interface to listen on a unix socket by [@&#8203;encode42](https://github.com/encode42) in [#&#8203;1453](slskd/slskd#1453)
- Refine support for unix domain sockets (UDS) by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1458](slskd/slskd#1458)
- Refactor download logic to split enqueue and download by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1462](slskd/slskd#1462)
- Improve logging of DownloadDenied and DownloadFailed events by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1463](slskd/slskd#1463)
- Bump Soulseek.NET to 8.1.2 by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1464](slskd/slskd#1464)
- Enqueue files one at a time by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1465](slskd/slskd#1465)
- Wait for transfer response from remote client before enqueuing the next file by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1467](slskd/slskd#1467)
- Implement a number of improvements and bug fixes with download logic by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1472](slskd/slskd#1472)
- Add dedicated transfer connection timeout, set server, distributed and transfer connection timeouts explicitly.  Bump Soulseek.NET to 8.4.0 by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1474](slskd/slskd#1474)
- Skip transfer progress updates if a previous update is still in progress by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1479](slskd/slskd#1479)
- Limit concurrent enqueue requests to 20 by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1480](slskd/slskd#1480)
- Set concurrent search limit to 2 (from the default 10) by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1481](slskd/slskd#1481)
- Set Unix file mode after moving downloaded files by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1482](slskd/slskd#1482)
- Add rate limiting to search and download requests by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1483](slskd/slskd#1483)
- Add more logging to download logic by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1484](slskd/slskd#1484)
- Fix bug with Prometheus threadpool statistics by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1485](slskd/slskd#1485)
- Prime message connection before enqueueing downloads locally by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1486](slskd/slskd#1486)
- Temporarily disable unobserved exception logging by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1487](slskd/slskd#1487)
- Refactor download logic to improve stability and improve performance by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1491](slskd/slskd#1491)
- Bump Soulseek.NET to 8.5.0 by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1497](slskd/slskd#1497)
- Add missing filename filter when superseding download records by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1500](slskd/slskd#1500)
- Make check of index names in transfer indexes migration case insensitive by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1501](slskd/slskd#1501)
- Increase concurrent download requests to 2, return enqueue results by [@&#8203;jpdillingham](https://github.com/jpdillingham) in [#&#8203;1504](slskd/slskd#1504)

#### New Contributors

- [@&#8203;RalphORama](https://github.com/RalphORama) made their first contribution in [#&#8203;1420](slskd/slskd#1420)
- [@&#8203;encode42](https://github.com/encode42) made their first contribution in [#&#8203;1453](slskd/slskd#1453)

**Full Changelog**: <slskd/slskd@0.23.2...0.24.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNzEuMiIsInVwZGF0ZWRJblZlciI6IjQxLjE3MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbWFnZSJdfQ==-->

Reviewed-on: https://gitea.alexlebens.dev/alexlebens/infrastructure/pulls/1965
Co-authored-by: Renovate Bot <renovate-bot@alexlebens.net>
Co-committed-by: Renovate Bot <renovate-bot@alexlebens.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant