繁体   English   中英

WCF服务呼叫中的“线程被中止”

[英]“Thread was being aborted” in WCF Service Call

在我的程序中,有一个包含wcf客户端的aspx页面,因此调用位于同一服务器上的wcf服务。

当我的wcf客户端调用生产服务器上的IIS中托管的wcf服务时,我将收到此异常。

例如 msg: Thread was being aborted.

防爆堆叠:

在System.Net.Sockets.Socket.Receive(Byte []缓冲区,Int32偏移量,Int32大小,SocketFlags socketFlags,SocketError& System.Net.Sockets.NetworkStream.Read(Byte []缓冲区,Int32偏移,Int32大小)上的errorCode)System.Net.Connection.System.Net.PooledStream.Read(Byte []缓冲区,Int32偏移量,Int32大小) System.Net.ConnectStream.ProcessWriteCallDone(ConnectionReturnResult returnResult)处的System.Net.ConnectStream.CallDone(ConnectionReturnResult returnResult)处的.SyncRead(HttpWebRequest请求,Boolean userRetrievedStream,Boolean probeRead) )在System.Net.HttpWebRequest.WriteHeadersCallback(WebExceptionStatus errorStatus,ConnectStream流,布尔异步)在System.Net.HttpWebRequest.EndWriteHeaders(Boolean异步)在System.Net.HttpWebRequest.EndWriteHeaders_Part2() ystem.Net.ConnectStream.WriteHeaders(布尔型异步)处于System.Net.HttpWebRequest.EndSubmitRequest()处于System.Net.HttpWebRequest.GetResponse()处于System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan超时) System.ServiceModel.Dispatcher.RequestChannelBinder.Request(消息,TimeSpan超时)在System.ServiceModel.Channels.ServiceChannel.Call(字符串操作,布尔单向,在System.ServiceModel.Dispatcher.RequestChannelBinder.Request(消息,TimeSpan超时) ProxyOperationRuntime操作,系统处System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall,ProxyOperationRuntime操作)在System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage消息)处进行Object [] ins,Object [] outs,TimeSpan超时。 StationS.StationService.IStationService.GetCurrentStationTrack(String stationId)上的Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&msgData,Int32类型) ervice.StationServiceClient.GetCurrentStationTrack(String stationId)在GetSongJS.getMarq(字符串radioIdentifier)

我使用PRTG Ipmonitor,它在“请求电流”传感器上给我太多请求。 我的网站在浏览器中可用。 如果删除此页面以致电服务人员,一切都会正常。

听起来您好像没有关闭WCF客户端。

我认为正在发生的是:

  • 用户调用aspx页面
  • aspx页面调用服务
  • aspx页面返回给用户
  • 服务客户端未关闭,因此请求处于打开状态,当前请求数量很高
  • 最终,您打开了最大数量的请求
  • 页面等待一个免费连接,当它没有得到一个aspx页面超时时
  • 然后,您会从超时中获得线程中止异常

客户端代理调用后是否有Response.Redirect(url)调用? 单参数重载将终止当前线程,这会导致许多此类错误显示在日志中。 有时页面已完成工作,但没有发生,但是切换到另一个繁忙的环境通常是一个触发因素。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM