none
WCF Service Occasionally Rejects All Client Connections RRS feed

  • Question

  • We have a long running WCF client/server application.  Often, no communication takes place for a long time.  We see all the clients disconnect and reconnect hourly, since we have set receiveTimeout=”01:00:00”.  Occasionally, after this hourly reset occurs we see that all clients disconnect and no clients, existing or new, can connect to our service until we restart the service or another hour passes.  When this happens, through WCF logging on the server we see many errors of the form:

    “The communication object, System.ServiceModel.Channels.ServerReliableDuplexSessionChannel, cannot be used for communication because it has been Aborted.”

    We are looking for suggestions to make our service more reliable.

    Thanks,

    Kent Griffin

    Some relevant service code-----------------------------------------------------------

        [ServiceContract(SessionMode = SessionMode.Required,

            CallbackContract = typeof(ISubscribableItemCallback))]

        public interface IItemService

        {

            [OperationContract]

            void Update(SomeItem item);

                                   

                                    [OperationContract]

                                    void Delete(SomeItem item);

            [OperationContract]

            ItemDatabase Subscribe();

            [OperationContract]

            void Unsubscribe();

        }

        public interface ISubscribableItemCallback

        {

            [OperationContract(IsOneWay = true)]

            void Updated(SomeItem item);

            [OperationContract(IsOneWay = true)]

            void ItemsUpdated(IList<SomeItem> items);

            [OperationContract(IsOneWay = true)]

            void ItemDeleted(Guid item);

            [OperationContract(IsOneWay = true)]

            void ItemsDeleted(IList<Guid> issueKeys);

        }

                   

                    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]

        public class SubscribableIssueService : IIssueService

                    {       

            public void Update(SomeItem item) {... }

                                   

                                    [OperationContract]

                                    void Delete(SomeItem item) {... }

            [OperationContract]

            ItemDatabase Subscribe() { ... }

            [OperationContract]

            void Unsubscribe() { ... }

                    }

    The Service .config file ------------------------------------------------------------------

    <?xml version="1.0"?>

    <configuration>

      <system.diagnostics>

        <sources>

          <source name="System.ServiceModel"

                  switchValue="Warning, Error"

                  propagateActivity="true">

            <listeners>

              <add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="C:\temp\diagnostics.svclog" />

            </listeners>

          </source>

        </sources>

        <trace autoflush="true" indentsize="4">

          <listeners>

            <remove name="Default" />

          </listeners>

        </trace>

      </system.diagnostics>

                    <system.serviceModel>

                                    <services>

                                                    <service behaviorConfiguration="StatusBehavior" name="DRAMS.IssueService.Common.SubscribableIssueService">

                                                                    <endpoint address="net.tcp://localhost:8015/SubscribableIssueService" binding="netTcpBinding" bindingConfiguration="tcp_ReliableSecuredService" contract="RADESDotNet.BusinessLogic.DRAMS.Client.IssueTracking.IIssueService"/>

                                                    </service>

                                    </services>

                                    <bindings>

                                                    <netTcpBinding>

            <binding name="tcp_ReliableSecuredService"

                     maxReceivedMessageSize="2147483646"

                     receiveTimeout="01:00:00"

                     listenBacklog="128"

                                                                     maxConnections="200">

              <reliableSession enabled="true" />

              <readerQuotas maxStringContentLength="2147483645"

                            maxBytesPerRead="2147483646"

                            maxArrayLength="2147483646"

                            maxDepth="2147483646"

                            maxNameTableCharCount="2147483646" />

              <security mode="Transport">

                <transport clientCredentialType="Windows"/>

              </security>

            </binding>

                                                    </netTcpBinding>

                                    </bindings>

                                    <behaviors>

                                                    <serviceBehaviors>

                                                                    <behavior name="StatusBehavior">

                                                                                    <dataContractSerializer maxItemsInObjectGraph="1000000000"/>

                                                                                    <serviceThrottling maxConcurrentCalls="5000" maxConcurrentInstances="2000" maxConcurrentSessions="2000"/>

                                                                                    <serviceDebug includeExceptionDetailInFaults="true"/>

                                                                    </behavior>

                                                                    <behavior name="DRAMS.Service.DRAMSDataService.DRAMSDataServiceBehavior">

                                                                                    <serviceMetadata httpGetEnabled="true"/>

                                                                                    <serviceDebug includeExceptionDetailInFaults="false"/>

                                                                    </behavior>

                                                    </serviceBehaviors>

                                    </behaviors>

                    </system.serviceModel>

                    <startup>

                                    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>

                    </startup>

    </configuration>

    ------------------------------------- The last few WCF error log entries

    </StackTrace><ExceptionString>System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '10675199.02:48:05.4775807'. ---&amp;gt; System.IO.IOException: The read operation failed, see inner exception. ---&amp;gt; System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '10675199.02:48:05.4775807'. ---&amp;gt; System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

       at System.ServiceModel.Channels.SocketConnection.HandleReceiveAsyncCompleted()

       at System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(Object sender, SocketAsyncEventArgs eventArgs)

       --- End of inner exception stack trace ---

       at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)

       at System.ServiceModel.Channels.ConnectionStream.EndRead(IAsyncResult asyncResult)

       at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)

       --- End of inner exception stack trace ---

       at System.Net.Security.NegotiateStream.EndRead(IAsyncResult asyncResult)

       at System.ServiceModel.Channels.StreamConnection.EndRead()

       --- End of inner exception stack trace ---</ExceptionString><InnerException><ExceptionType>System.IO.IOException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>The read operation failed, see inner exception.</Message><StackTrace>   at System.Net.Security.NegotiateStream.EndRead(IAsyncResult asyncResult)

       at System.ServiceModel.Channels.StreamConnection.EndRead()</StackTrace><ExceptionString>System.IO.IOException: The read operation failed, see inner exception. ---&amp;gt; System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '10675199.02:48:05.4775807'. ---&amp;gt; System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

       at System.ServiceModel.Channels.SocketConnection.HandleReceiveAsyncCompleted()

       at System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(Object sender, SocketAsyncEventArgs eventArgs)

       --- End of inner exception stack trace ---

       at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)

       at System.ServiceModel.Channels.ConnectionStream.EndRead(IAsyncResult asyncResult)

       at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)

       --- End of inner exception stack trace ---

       at System.Net.Security.NegotiateStream.EndRead(IAsyncResult asyncResult)

       at System.ServiceModel.Channels.StreamConnection.EndRead()</ExceptionString><InnerException><ExceptionType>System.ServiceModel.CommunicationException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '10675199.02:48:05.4775807'.</Message><StackTrace>   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)

       at System.ServiceModel.Channels.ConnectionStream.EndRead(IAsyncResult asyncResult)

       at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)</StackTrace><ExceptionString>System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '10675199.02:48:05.4775807'. ---&amp;gt; System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

       at System.ServiceModel.Channels.SocketConnection.HandleReceiveAsyncCompleted()

       at System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(Object sender, SocketAsyncEventArgs eventArgs)

       --- End of inner exception stack trace ---

       at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)

       at System.ServiceModel.Channels.ConnectionStream.EndRead(IAsyncResult asyncResult)

       at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)</ExceptionString><InnerException><ExceptionType>System.Net.Sockets.SocketException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>An existing connection was forcibly closed by the remote host</Message><StackTrace>   at System.ServiceModel.Channels.SocketConnection.HandleReceiveAsyncCompleted()

       at System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(Object sender, SocketAsyncEventArgs eventArgs)</StackTrace><ExceptionString>System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host

       at System.ServiceModel.Channels.SocketConnection.HandleReceiveAsyncCompleted()

       at System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(Object sender, SocketAsyncEventArgs eventArgs)</ExceptionString><NativeErrorCode>2746</NativeErrorCode></InnerException></InnerException></InnerException></Exception></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131075</EventID><Type>3</Type><SubType Name="Error">0</SubType><Level>2</Level><TimeCreated SystemTime="2018-02-01T16:14:35.0943552Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" /><Execution ProcessName="DRAMSIssueService" ProcessID="352" ThreadID="36" /><Channel/><Computer>VS-HILL-DRAMSPI</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error"><TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceIdentifier><Description>Throwing an exception.</Description><AppDomain>DRAMSIssueService.exe</AppDomain><Exception><ExceptionType>System.ServiceModel.CommunicationException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '10675199.02:48:05.4775807'.</Message><StackTrace>   at System.ServiceModel.Channels.StreamConnection.EndRead()

       at System.ServiceModel.Channels.SessionConnectionReader.OnAsyncReadComplete(Object state)</StackTrace><ExceptionString>System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '10675199.02:48:05.4775807'. ---&amp;gt; System.IO.IOException: The read operation failed, see inner exception. ---&amp;gt; System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '10675199.02:48:05.4775807'. ---&amp;gt; System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

       at System.ServiceModel.Channels.SocketConnection.HandleReceiveAsyncCompleted()

       at System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(Object sender, SocketAsyncEventArgs eventArgs)

       --- End of inner exception stack trace ---

       at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)

       at System.ServiceModel.Channels.ConnectionStream.EndRead(IAsyncResult asyncResult)

       at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)

       --- End of inner exception stack trace ---

       at System.Net.Security.NegotiateStream.EndRead(IAsyncResult asyncResult)

       at System.ServiceModel.Channels.StreamConnection.EndRead()

       --- End of inner exception stack trace ---

       at System.ServiceModel.Channels.StreamConnection.EndRead()

       at System.ServiceModel.Channels.SessionConnectionReader.OnAsyncReadComplete(Object state)</ExceptionString><InnerException><ExceptionType>System.IO.IOException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>The read operation failed, see inner exception.</Message><StackTrace>   at System.Net.Security.NegotiateStream.EndRead(IAsyncResult asyncResult)

       at System.ServiceModel.Channels.StreamConnection.EndRead()</StackTrace><ExceptionString>System.IO.IOException: The read operation failed, see inner exception. ---&amp;gt; System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '10675199.02:48:05.4775807'. ---&amp;gt; System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

       at System.ServiceModel.Channels.SocketConnection.HandleReceiveAsyncCompleted()

       at System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(Object sender, SocketAsyncEventArgs eventArgs)

       --- End of inner exception stack trace ---

       at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)

       at System.ServiceModel.Channels.ConnectionStream.EndRead(IAsyncResult asyncResult)

       at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)

       --- End of inner exception stack trace ---

       at System.Net.Security.NegotiateStream.EndRead(IAsyncResult asyncResult)

       at System.ServiceModel.Channels.StreamConnection.EndRead()</ExceptionString><InnerException><ExceptionType>System.ServiceModel.CommunicationException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '10675199.02:48:05.4775807'.</Message><StackTrace>   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)

       at System.ServiceModel.Channels.ConnectionStream.EndRead(IAsyncResult asyncResult)

       at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)</StackTrace><ExceptionString>System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '10675199.02:48:05.4775807'. ---&amp;gt; System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

       at System.ServiceModel.Channels.SocketConnection.HandleReceiveAsyncCompleted()

       at System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(Object sender, SocketAsyncEventArgs eventArgs)

       --- End of inner exception stack trace ---

       at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)

       at System.ServiceModel.Channels.ConnectionStream.EndRead(IAsyncResult asyncResult)

       at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)</ExceptionString><InnerException><ExceptionType>System.Net.Sockets.SocketException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>An existing connection was forcibly closed by the remote host</Message><StackTrace>   at System.ServiceModel.Channels.SocketConnection.HandleReceiveAsyncCompleted()

       at System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(Object sender, SocketAsyncEventArgs eventArgs)</StackTrace><ExceptionString>System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host

       at System.ServiceModel.Channels.SocketConnection.HandleReceiveAsyncCompleted()

       at System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(Object sender, SocketAsyncEventArgs eventArgs)</ExceptionString><NativeErrorCode>2746</NativeErrorCode></InnerException></InnerException></InnerException></Exception></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>524299</EventID><Type>3</Type><SubType Name="Warning">0</SubType><Level>4</Level><TimeCreated SystemTime="2018-02-01T16:14:35.0943552Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" /><Execution ProcessName="DRAMSIssueService" ProcessID="352" ThreadID="36" /><Channel/><Computer>VS-HILL-DRAMSPI</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Warning"><TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.CommunicationObjectFaulted.aspx</TraceIdentifier><Description>Faulted System.ServiceModel.Channels.ServerSessionPreambleConnectionReader+ServerFramingDuplexSessionChannel</Description><AppDomain>DRAMSIssueService.exe</AppDomain><Source>System.ServiceModel.Channels.ServerSessionPreambleConnectionReader+ServerFramingDuplexSessionChannel/21019913</Source></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>262171</EventID><Type>3</Type><SubType Name="Warning">0</SubType><Level>4</Level><TimeCreated SystemTime="2018-02-01T16:14:35.0943552Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" /><Execution ProcessName="DRAMSIssueService" ProcessID="352" ThreadID="36" /><Channel/><Computer>VS-HILL-DRAMSPI</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Warning"><TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Channels.SocketConnectionAbort.aspx</TraceIdentifier><Description>SocketConnection aborted</Description><AppDomain>DRAMSIssueService.exe</AppDomain><Source>System.ServiceModel.Channels.SocketConnection/44959327</Source></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131075</EventID><Type>3</Type><SubType Name="Error">0</SubType><Level>2</Level><TimeCreated SystemTime="2018-02-01T16:14:35.0943552Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" /><Execution ProcessName="DRAMSIssueService" ProcessID="352" ThreadID="36" /><Channel/><Computer>VS-HILL-DRAMSPI</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error"><TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceIdentifier><Description>Throwing an exception.</Description><AppDomain>DRAMSIssueService.exe</AppDomain><Source>System.ServiceModel.Channels.ServerSessionPreambleConnectionReader+ServerFramingDuplexSessionChannel/21019913</Source><Exception><ExceptionType>System.ServiceModel.CommunicationObjectFaultedException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>The communication object, System.ServiceModel.Channels.ServerSessionPreambleConnectionReader+ServerFramingDuplexSessionChannel, cannot be used for communication because it is in the Faulted state.</Message><StackTrace>   at System.ServiceModel.Channels.CommunicationObject.BeginClose(TimeSpan timeout, AsyncCallback callback, Object state)

       at System.ServiceModel.Channels.ReliableChannelBinderHelper.CloseInputSessionChannelAsyncResult`2.HandleInputComplete(IAsyncResult result, Boolean&amp;amp; gotEof)

       at System.ServiceModel.Channels.ReliableChannelBinderHelper.CloseInputSessionChannelAsyncResult`2.WaitForEof()

       at System.ServiceModel.Channels.ReliableChannelBinderHelper.CloseInputSessionChannelAsyncResult`2.OnWaitForPendingOperationsCompleteStatic(IAsyncResult result)

       at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)

       at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)

       at System.ServiceModel.Channels.WaitAsyncResult.OnSignaled()

       at System.ServiceModel.Channels.InterruptibleWaitObject.Set()

       at System.ServiceModel.Channels.ReliableChannelBinder`1.ChannelSynchronizer.ReturnChannel()

       at System.ServiceModel.Channels.ReliableChannelBinder`1.InputAsyncResult`1.CompleteInput(IAsyncResult result)

       at System.ServiceModel.Channels.ReliableChannelBinder`1.InputAsyncResult`1.OnInputComplete(IAsyncResult result)

       at System.ServiceModel.Channels.ReliableChannelBinder`1.InputAsyncResult`1.OnInputCompleteStatic(IAsyncResult result)

       at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)

       at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)

       at System.ServiceModel.Channels.TransportDuplexSessionChannel.TryReceiveAsyncResult.OnReceive(IAsyncResult result)

       at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)

       at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)

       at System.ServiceModel.Channels.SynchronizedMessageSource.ReceiveAsyncResult.OnReceiveComplete(Object state)

       at System.ServiceModel.Channels.SessionConnectionReader.OnAsyncReadComplete(Object state)

       at System.ServiceModel.Channels.StreamConnection.OnRead(IAsyncResult result)

       at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)

       at System.Net.LazyAsyncResult.Complete(IntPtr userToken)

       at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)

       at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)

       at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)

       at System.ServiceModel.Channels.ConnectionStream.IOAsyncResult.OnAsyncIOComplete(Object state)

       at System.ServiceModel.Channels.SocketConnection.FinishRead()

       at System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(Object sender, SocketAsyncEventArgs eventArgs)

       at System.ServiceModel.Channels.SocketConnection.OnReceiveAsyncCompleted(Object sender, SocketAsyncEventArgs e)

       at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs e)

       at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationAsyncFailure(SocketError socketError, Int32 bytesTransferred, SocketFlags flags)

       at System.Net.Sockets.SocketAsyncEventArgs.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)

       at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

    </StackTrace><ExceptionString>System.ServiceModel.CommunicationObjectFaultedException: The communication object, System.ServiceModel.Channels.ServerSessionPreambleConnectionReader+ServerFramingDuplexSessionChannel, cannot be used for communication because it is in the Faulted state.</ExceptionString></Exception></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131075</EventID><Type>3</Type><SubType Name="Error">0</SubType><Level>2</Level><TimeCreated SystemTime="2018-02-01T16:14:35.1724738Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" /><Execution ProcessName="DRAMSIssueService" ProcessID="352" ThreadID="34" /><Channel/><Computer>VS-HILL-DRAMSPI</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error"><TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceIdentifier><Description>Throwing an exception.</Description><AppDomain>DRAMSIssueService.exe</AppDomain><Source>System.ServiceModel.Channels.ServerReliableDuplexSessionChannel/5559451</Source><Exception><ExceptionType>System.ServiceModel.CommunicationObjectAbortedException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>The communication object, System.ServiceModel.Channels.ServerReliableDuplexSessionChannel, cannot be used for communication because it has been Aborted.</Message><StackTrace>   at System.ServiceModel.Channels.CommunicationObject.ThrowIfAborted()

       at System.ServiceModel.Channels.InputQueueChannel`1.EndDequeue(IAsyncResult result, TDisposable&amp;amp; item)

       at System.ServiceModel.Channels.DuplexChannel.EndTryReceive(IAsyncResult result, Message&amp;amp; message)

       at System.ServiceModel.Dispatcher.DuplexChannelBinder.EndTryReceive(IAsyncResult result, RequestContext&amp;amp; requestContext)

       at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext&amp;amp; requestContext)

       at System.ServiceModel.Dispatcher.ChannelHandler.EndTryReceive(IAsyncResult result, RequestContext&amp;amp; requestContext)

       at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)

       at System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result)

       at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)

       at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)

       at System.Runtime.InputQueue`1.AsyncQueueReader.Set(Item item)

       at System.Runtime.InputQueue`1.Shutdown(Func`1 pendingExceptionGenerator)

       at System.ServiceModel.Channels.InputQueueChannel`1.OnClosing()

       at System.ServiceModel.Channels.ReliableDuplexSessionChannel.OnClosing()

       at System.ServiceModel.Channels.CommunicationObject.Abort()

       at System.ServiceModel.Dispatcher.DuplexChannelBinder.Abort()

       at System.ServiceModel.Channels.ServiceChannel.OnAbort()

       at System.ServiceModel.Channels.CommunicationObject.Abort()

       at System.ServiceModel.Channels.ServiceChannel.SessionIdleManager.TimerCallback()

       at System.ServiceModel.Channels.ServiceChannel.SessionIdleManager.TimerCallback(Object state)

       at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)

       at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)

       at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

    </StackTrace><ExceptionString>System.ServiceModel.CommunicationObjectAbortedException: The communication object, System.ServiceModel.Channels.ServerReliableDuplexSessionChannel, cannot be used for communication because it has been Aborted.</ExceptionString></Exception></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent><E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131075</EventID><Type>3</Type><SubType Name="Error">0</SubType><Level>2</Level><TimeCreated SystemTime="2018-02-01T16:14:35.2349774Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" /><Execution ProcessName="DRAMSIssueService" ProcessID="352" ThreadID="36" /><Channel/><Computer>VS-HILL-DRAMSPI</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error"><TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceIdentifier><Description>Throwing an exception.</Description><AppDomain>DRAMSIssueService.exe</AppDomain><Source>System.ServiceModel.Channels.ServerReliableDuplexSessionChannel/55162326</Source><Exception><ExceptionType>System.ServiceModel.CommunicationObjectAbortedException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>The communication object, System.ServiceModel.Channels.ServerReliableDuplexSessionChannel, cannot be used for communication because it has been Aborted.</Message><StackTrace>   at System.ServiceModel.Channels.CommunicationObject.ThrowIfAborted()

       at System.ServiceModel.Channels.InputQueueChannel`1.EndDequeue(IAsyncResult result, TDisposable&amp;amp; item)

       at System.ServiceModel.Channels.DuplexChannel.EndTryReceive(IAsyncResult result, Message&amp;amp; message)

       at System.ServiceModel.Dispatcher.DuplexChannelBinder.EndTryReceive(IAsyncResult result, RequestContext&amp;amp; requestContext)

       at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext&amp;amp; requestContext)

       at System.ServiceModel.Dispatcher.ChannelHandler.EndTryReceive(IAsyncResult result, RequestContext&amp;amp; requestContext)

       at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)

       at System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result)

       at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)

       at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)

       at System.Runtime.InputQueue`1.AsyncQueueReader.Set(Item item)

       at System.Runtime.InputQueue`1.Shutdown(Func`1 pendingExceptionGenerator)

       at System.ServiceModel.Channels.InputQueueChannel`1.OnClosing()

       at System.ServiceModel.Channels.ReliableDuplexSessionChannel.OnClosing()

       at System.ServiceModel.Channels.CommunicationObject.Abort()

       at System.ServiceModel.Dispatcher.DuplexChannelBinder.Abort()

       at System.ServiceModel.Channels.ServiceChannel.OnAbort()

       at System.ServiceModel.Channels.CommunicationObject.Abort()

       at System.ServiceModel.Channels.ServiceChannel.SessionIdleManager.TimerCallback()

       at System.ServiceModel.Channels.ServiceChannel.SessionIdleManager.TimerCallback(Object state)

       at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)

       at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)

       at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

    </StackTrace><ExceptionString>System.ServiceModel.CommunicationObjectAbortedException: The communication object, System.ServiceModel.Channels.ServerReliableDuplexSessionChannel, cannot be used for communication because it has been Aborted.</ExceptionString></Exception></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent>

    Thursday, February 1, 2018 8:25 PM

All replies

  • Hi Kent,

    >> after this hourly reset occurs we see that all clients disconnect and no clients, existing or new, can connect to our service until we restart the service or another hour passes

    Did you host the service in IIS or self-host?

    While the connection disconnected, will it work if you create a new client to open the connection?

    Did you receive any error at client side? I suggest you also enable WCF Tracing at client side to check the error.

    To check whether it is related with network, if you create a client on the service hosted computer, will it hit this issue?

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, February 2, 2018 5:12 AM
  • 1. It is a self-host service. 

    2. New clients cannot connect either.

    3. Yes.  We get a timeout exception on the client.  Sometimes it is says that it failed to open in time, and but usually it states that the client machine actively refused the connection.

    4. We don't suspect that it is a network issue, because when we restart the service the clients are immediately able to connect.
    Friday, February 2, 2018 5:25 PM
  • Hi Kent,

    Based on your current configuration, you achieved your service by Duplex Service which is one way operation.

    I would suggest you reduce the receiveTimeout to "00:00:10", will you receive any time out error?

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 5, 2018 3:13 AM
  • Our code automatically attempts to reconnect after a disconnect (after a fault).  When we reduce the receive timeout to 10 seconds, the clients are (as expected) disconnecting every 10 seconds. We do not see the timeout exception in that case because after the client is disconnected, it connects successfully when it attempts to reconnect.  The reason that we see the timeout exception in the failing case is that the service is rejecting all connections, including re-connections.  
    Monday, February 5, 2018 3:56 PM
  • Hi Kent,

    >> When we reduce the receive timeout to 10 seconds, the clients are (as expected) disconnecting every 10 seconds.

    Did you configure any settings to disconnect? I am not sure the reason the client disconnected every 10 seconds is expected, and the rate of disconnecting is the same as receive timeout.

    >> Our code automatically attempts to reconnect after a disconnect (after a fault)

    Is the Fault expected? Do you mean the fault will cause disconnect?

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, February 6, 2018 2:47 AM
  • Hello,

    I have been trying to figure this out for awhile and very little information on this.

    After a period of time the system just stops responding.  This only happens when I have the systems load balanced in our AWS environment.

    I'm not sure if this sheds some light on this or if this is even the same problem.  Are there any known issues with the network load balacners in AWS and net.tcp comm with WCF?

    System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:05:00'. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

       at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)

       at System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)

       --- End of inner exception stack trace ---

    Server stack trace:

       at System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)

       at System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)

       at System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)

       at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)

       at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)

       at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)

       at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)

       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)

       at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)

       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)

    Exception rethrown at [0]:

       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

       at System.ServiceModel.ICommunicationObject.Open()

       at DG35.Core.Utility.WCF.Create[T](String URI, String ServiceFile, Boolean SupportsStreaming)

       at DG35.Queue.Service.ListenerRunner.RunListener() in C:\Users\rbarone.SRI.000\source\repos\SBWebQueue\DG35.Queue.Service\ListenerRunner.cs:line 126

    Wednesday, May 1, 2019 2:27 PM