aliyun / aliyun-oss-csharp-sdk

Aliyun OSS SDK for C#
MIT License
383 stars 206 forks source link

2.5.1 及之前的版本都会在上传网络超时时导致 IIS W3P进程崩溃,后续版本未测试 #32

Open nishizhen opened 6 years ago

nishizhen commented 6 years ago

发生了未经处理的异常,已终止进程。

Application ID: /LM/W3SVC/11/ROOT

Process ID: 10568

Exception: System.Net.WebException

Message: 请求被中止: 请求已被取消。

StackTrace: 在 System.Net.ConnectStream.CloseInternal(Boolean internalCall, Boolean aborting) 在 System.Net.ConnectStream.System.Net.ICloseEx.CloseEx(CloseExState closeState) 在 System.Net.ConnectStream.Dispose(Boolean disposing) 在 System.IO.Stream.Close() 在 Aliyun.OSS.Common.Communication.ServiceClientImpl.<>cDisplayClass6.b4(IAsyncResult ar) 在 System.Net.LazyAsyncResult.Complete(IntPtr userToken) 在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 在 System.Net.ContextAwareResult.Complete(IntPtr userToken) 在 System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken) 在 System.Net.HttpWebRequest.InvokeGetRequestStreamCallback() 在 System.Net.HttpWebRequest.EndWriteHeaders_Part2() 在 System.Net.HttpWebRequest.SetRequestContinue(CoreResponseData continueResponse) 在 System.Net.Connection.ReadComplete(Int32 bytesRead, WebExceptionStatus errorStatus) 在 System.Net.LazyAsyncResult.Complete(IntPtr userToken) 在 System.Net.ContextAwareResult.Complete(IntPtr userToken) 在 System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken) 在 System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped nativeOverlapped) 在 System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped pOVERLAP)

InnerException: System.IO.IOException

Message: 在写入所有字节之前不能关闭流。

StackTrace: 在 System.Net.ConnectStream.CloseInternal(Boolean internalCall, Boolean aborting)

nishizhen commented 6 years ago

这个很严重,会导致提供不了服务的~ 谢谢请关注~ @baiyubin @qiyuewuyi

还是我们哪里有使用问题,请指正,谢谢~

nishizhen commented 6 years ago

错误信息来自 2.5.1 版本

nishizhen commented 6 years ago

我们现在自己使用Client 的TimeOut参数 控制了 上传和下载的超时时间,我们设置为 55秒,不知道咱们那个出现问题是大约多久,因为很难复现。

nishizhen commented 6 years ago

这个复现,可以通过把上传带宽限定到1kb,然后同时通过一台机器同时上传(10个并行)3M以内的文件,IIS则会出现上面的异常,前提是没有设置任何的TimeOut的限制