Skip to content

Zero length stream return during simultaneous downloads #1740

@m0a0k0s

Description

@m0a0k0s

On one of a servers DownloadFileAsync returns zero length output stream in concurrency scenario without throwing any exceptions.
The server uses virtual folder and some scripts configuration to move files from one folder to another after it was downloaded by client connection.
Files are non zero length. It reproduces ocasionally.
From logs I see this cases: 3 messages downloaded at 21:01:37.457, at 21:01:39 exception after checking for zero length stream written.
3 message downloaded at 2025-11-18 21:25:51.700, at 11/18/2025 21:25:52 exception after checking for zero length stream written.
SSH.NET for both version 2024.2.0, 2025.1.0 .Net 9.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions