c# - Can Linq AsParallel() dispose of SoapHttpClientProtocol objects prematurely? -
In an ASP.NET MVC 4 web application on which I am working. I have a page that originally receives data from a SOAP service and generates a report
My code basically looks like this
list & lt ; Custom Settings & gt; ServerInfos = ServerInfos; ServerInfos.AsParallel (). ForAll (srvInfo => {SOAPHttpClientProtocol soapProxy = CreateProxy (srvInfo); // calls through // so-client through // results in / / // results in fair results} Because I am doing AsParallel here because in a serial fashion many requests on HTTP for always take me. this code works, though in spitefully Should be thrown. Is it possible that things are being disposed of unexpectedly, and should I Yes, PLINQ is not a good solution?
Is it possible that the second threading issue could be the cause of an error which gives the soap client "lose"?
Additional information This special soap proxy is talking to the arguments server generally, you can see the server log and see that when the special requests Is started and if requests fail, well in these logs G is also not visible.
Here is an internal exception stack trace I get from the AsParallel code.
Exception: System.AggregateException: One or more errors occurred. --- & gt; System.Net.WebException: The built-in connection was closed: A connection that was expected to be kept alive was closed by the server. --- & gt; System.IO.IOException: Unable to read data from transport connection: An existing connection by the remote host was forcibly closed. --- & gt; System.Net.Sockets.SocketException: An existing connection was forcibly closed by system.Net.Sockets.Socket.Receive (byte [] buffer, int32 offset, int32 size, SocketFlags socketFlags), remote connection to the system . Net.Sockets.NetworkStream.Read (byte [] buffer, int32 offset, int32 size) --- Internal Exception Stack End of Trace --- on System.Net.Sockets.NetworkStream System.Net.Connection.SyncRead (HttpWebRequest request, Boolean user retrievestream, Boolean probe read) on byte [] buffer, Int32 offset, System.Net.PooledStream.Read (byte [] buffer, introd offset offset, int 32 size) --- The end of the internal exception stack trace --- on the system Web. Services. Protocol. WebclientProtocol GetWeb Response (WebRequest Request) on the system. Web. Service. Protocol. HTTP Web Client Protocol GetWeb Response (WebRequest Request) on the system. Web. Service. Protocol. SAPHTP ClientProtocol.Invoc (String NameName, Object [] parameter) ESRI.ArcGIS.SOAP.FeatureServerProxy.Query on (Int32 LayerOrTableID, String Definiti System.Linq.Parallel.SelectQueryOperator 2.SelectQueryOperatorResults.GetElement (Int32 Index) on System 1.ListContiguousIndexRangeEnumerator.MoveNext (T) on Linux.Parallel.QueryResults 1.get_Item (Expression, Query Filter query filter, Service Data Autoports service DataAutts, String GdbVersion, Double Maximum Aloud Offset) Int32 Index) System.Linq.Parallel.PartitionedDataSource. & Amp; Current Element, Int 32 & am p; System.Linq.Parallel.PipelineSpoolingWork () in System.Linq.Parallel.SpoolingTaskBase.Work () in System.Linq.Parallel.QueryTask.BaseWork (object unused) on SystemkLinq. system. Taipkinr invoked in threading (). Threading Task Task .Excute ()
PLINQ will also allow you to The object does not exist, it can not be closed.
Read this message carefully:
An existing connection by the remote host was forcibly closed.
The server closed the connection unexpectedly, your customer is not at fault.
Interpretation of exception is a necessary debugging skill This information was correct in the exception message.
Maybe you have too much to cause the load to determine a sustainable degree of parallelism default heuristics, COP work not for IO.
.DegreeOfParallelism (10) was stopped by a connection that was expected to be kept alive server.
This may mean that the server does not support keeping HTTP alive.
Comments
Post a Comment