【发布时间】:2017-04-07 12:13:01
【问题描述】:
我使用返回 Stream 的 FileSystemOperationsExtensions.Open 方法,我可以从中读取。 有时,当服务从流(~150-300 Mb)中读取大文件时,服务会出现以下异常:
System.IO.IOException: The read operation failed, see inner exception. ---> System.Net.WebException: The request was aborted: The request was canceled.
at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Http.HttpClientHandler.WebExceptionWrapperStream.Read(Byte[] buffer, Int32 offset, Int32 count)
"ClassName": "System.IO.IOException",
"Message": "Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size)\r\n
at System.Net.Http.HttpClientHandler.WebExceptionWrapperStream.Read(Byte[] buffer, Int32 offset, Int32 count)
而且它是随机发生的。 此外,我创建了一个具有 60 分钟超时时间的 DataLakeStoreFileSystemManagementClient 类对象,但这些错误发生在它之前。 它可能需要 3、10、20 或任何分钟。 当然,我可以重新读取带有偏移量的流,但这需要额外的开发时间。 也许还有另一种方法可以避免这些异常。 有人可以帮我吗?
【问题讨论】:
标签: c# azure azure-data-lake