Skip to content

Infinite timeout on async UploadFile with OpenAsync/CopyToAsync #1497

Closed
@Dunge

Description

@Dunge

I'm using the code here #819 (comment) to have an async upload file and it works.

Unfortunately, if I'm uploading a file and close the connection on the remote end, the method will never finish. I would be expecting some exception to be thrown. Instead the thread remains stuck indefinitely, and it's not a good thing for server-side process doing this operation in batches.

I found this decade old question and tried to set the OperationTimeout property to 30sec, but it doesn't seems to have any effect.

I'm aware I can have a CancellationToken, but this would be a way for me to trigger a cancellation from my end, not one that happens when the connection get closed remotely or if a timeout happen.

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