Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF calls timeout for no apparent reason
    primarykey
    data
    text
    <p>I am working on a piece of internal software that contains a database service which is used to provide access to a SQL Server database located locally on the same server that the database service is running on. </p> <p>The database service is a WCF service written against .NET 4.0 with VS 2010 as a 32 bit application. As of right now the client and server are connected to each other right now over a cross-over cable.</p> <p>There are two clients to the database service. One client attempts to store data at 4hz. The other client attempts to store data at 1hz. This normally works perfectly fine however every now and then the client that is attempting to store data at 1hz timesout. The database service is a singleton service with multiple concurrency mode. The 1hz and 4hz clients execute different methods and only share an nhibernate session factory.</p> <p>To get a better idea of what was going on I added some basic profiling with the Stopwatch class to the call the 1hz client makes. I found that the data stores the required data in under 40ms. The 4hz client stores the required data in under 10ms. Both clients have a timeout of 5s (both ways). </p> <p>One oddity is that only the 1hz client ever experiences a timeout issue. The 4hz client keeps on working. Another is that when I catch the timeout exception on the 1hz client and I check the log on the server for that same time I find that the server does execute and stores the data (in under 40ms, much faster than the 5s timeout). To further the issue it appears that for ~1 minute after this event occurs the 1hz client never attempts to store data (even though data is being generated). Also I never observe another timeout exception. Then the 1hz client resumes and starts storing data again as if nothing ever happened. </p> <p>During this time the 4hz client keeps on going as if nothing is wrong. The 1hz client and 4hz client are hosted in the same application but execute on separate threads.</p> <p>I have spent the past 3 days reading about potential causes for a WCF timeout and making sure to follow the advice I found. WCF client proxies are opened, acted on, and closed. SQL Server calls are taking much less time than the 5s timeout period.</p> <p>If code is required I will edit the question with the code that is requested. I am at a loss as to how I should proceed now so your assistance is much appreciated.</p> <p>Edit #1:</p> <p>The client works like this. Open proxy. Execute Ping() (an empty method to make sure service is up). Execute actual work method. Close proxy. The stack trace indicates that ping works fine however when the client attempts to execute the work method things go poorly.</p> <pre><code>XXX.XXX.ServiceConnectionException: Failed to connect to service XXX.XXX.IDatabaseService. ---&gt; System.TimeoutException: The request channel timed out attempting to send after 00:00:05. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout. ---&gt; System.TimeoutException: The HTTP request to 'http://192.168.100.100/database' has exceeded the allotted timeout of 00:00:00. The time allotted to this operation may have been a portion of a longer timeout. at System.ServiceModel.Channels.HttpChannelUtilities.SetRequestTimeout(HttpWebRequest request, TimeSpan timeout) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout) at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) --- End of inner exception stack trace --- Server stack trace: at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type) at XXX.XXX.IService.Ping() at XXX.XXX.Client`1.Open() in C:\XXX\XXX\XXX\XXX\Client.cs:line 76 --- End of inner exception stack trace --- at XXX.XXX.Client`1.Open() in C:\XXX\XXX\XXX\XXX\Client.cs:line 81 at XXX.XXX.Client`1.Execute(Action`1 execute) in C:\XXX\XXX\XXX\XXX\Client.cs:line 93 at XXX.XXX.XXX.ProcessItems(List`1 items) in C:\XXX\XXX\XXX\XXX\InsertProcess.cs:line 57 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload