Skip to content

xftp server: release storage of interrupted uploads - #1977

Merged
epoberezkin merged 2 commits into
simplex-chat:masterfrom
evgeny-simplex:ep/xftp-upload-reservation
Oct 26, 2026
Merged

epoberezkin merged 2 commits into
simplex-chat:masterfrom
evgeny-simplex:ep/xftp-upload-reservation

Conversation

@evgeny-simplex

@evgeny-simplex evgeny-simplex commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

xftp server: when the connection of an upload closes while the file is being received, the storage reserved for the upload is released and the partial file is removed, as when the upload ends with an error. Asynchronous exceptions are masked from the reservation until the file is committed or the reservation is released; the transfer runs with them restored, and the reservation is released if the transfer ends with an exception. The two existing release blocks are replaced by one function, which is also called on that exception.

xftp server: file deletion and blocking run with asynchronous exceptions masked, so the storage of a deleted file is released also when the thread is interrupted after the file record is removed.

tests: after uploads are interrupted by closing their connections, the server files directory is empty and the whole storage quota is available.

@evgeny-simplex
evgeny-simplex force-pushed the ep/xftp-upload-reservation branch from b2b599b to 551d16c Compare October 25, 2026 13:58
@epoberezkin
epoberezkin merged commit 195df0d into simplex-chat:master Oct 26, 2026
7 checks passed
@epoberezkin
epoberezkin deleted the ep/xftp-upload-reservation branch October 26, 2026 11:12
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.

2 participants