Closed
Description
I went through SftpClient briefly and I noticed that the reset event is only set when s.StatusCode == StatusCodes.Ok
_sftpSession.RequestWrite(handle, offset, buffer, 0, bytesRead, null, s =>
{
if (s.StatusCode == StatusCodes.Ok)
{
Interlocked.Decrement(ref expectedResponses);
responseReceivedWaitHandle.Set();
// Call callback to report number of bytes written
if (uploadCallback != null)
{
// Execute callback on different thread
ThreadAbstraction.ExecuteThread(() => uploadCallback(writtenBytes));
}
}
});
which means that
once loop reaches
// Wait for expectedResponses to change
_sftpSession.WaitOnHandle(responseReceivedWaitHandle, _operationTimeout);
and status code for all write requests != StatusCodes.Ok the loop will hang
This is not just observation I've seen it happen many times, this results in thread starvation for the host application eventually.
Metadata
Metadata
Assignees
Labels
No labels