none
NetMSMQBinding + AppFabric WAS + IIS long running [IsOneWay] Service - Thread abort exception RRS feed

  • Question

  • We have a long running WCF service hosted on IIS which makes use of the AppFabric MSMQ Activation process. The service fetches records from the database, run rules on them and based on the rule it enqueues each record to another MSMQ based service. 

    In production environment, we are experiencing a lot of thread-abort exceptions and the task terminates abruptly. The service is triggered every 30 minutes during business hours after few minutes into the call each thread is terminated with the error below:

    Unhandled exception.  Exception details: System.Threading.ThreadAbortException: Thread was being aborted.

       at Company.Method_Signature(SomeRequestObject aRequest)

       at SyncInvokeMethod_Signature(Object , Object[] , Object[] )

       at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)

       at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)

       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)

       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc)

       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)

       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)

       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)

       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)

       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)

       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)

       at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

       at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext)

       at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)

       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.AsyncResult.Complete(Boolean completedSynchronously, Exception exception)

       at System.ServiceModel.Channels.MsmqReceiveHelper.TryNonTransactedReceiveAsyncResult.OnComplete(IAsyncResult result)

       at System.ServiceModel.Channels.MsmqReceiveHelper.TryNonTransactedReceiveAsyncResult.OnCompleteStatic(IAsyncResult result)

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

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

       at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously, Exception exception)

       at System.ServiceModel.Channels.MsmqQueue.TryReceiveAsyncResult.OnCompletion(Int32 error, Boolean completedSynchronously)

       at System.ServiceModel.Channels.MsmqQueue.TryReceiveAsyncResult.OnPortedCompletion(UInt32 error, UInt32 numBytes, NativeOverlapped* nativeOverlapped)

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

    -------------------

    FYI, the AppPool is set to not recycle during the business hours and private/virtual memory and CPU limit is set to 0. Any ideas? Is there some sort of thread-timeout in place for IIS?

    Any help would be appreciated.

    Tuesday, August 4, 2015 12:51 PM

Answers

  • Hi Param-Artha,

    According to this case, I suggest you can check your web.config file about timeout.

    For more information, please refer to the following articles:

    1.Timeouts in WCF and their default values

    http://blogs.msdn.com/b/hongmeig/archive/2010/03/06/timeouts-in-wcf-and-their-default-values.aspx

    2.WCF Operation Timeout Exception http://www.codeproject.com/Articles/28265/WCF-Operation-Timeout-Exception

    I hope that will be helpful to you.

    Best Regards,

    Tracy Grady



    Thursday, August 6, 2015 7:35 AM
    Moderator

All replies

  • Hi Param-Artha,

    According to this case, I suggest you can check your web.config file about timeout.

    For more information, please refer to the following articles:

    1.Timeouts in WCF and their default values

    http://blogs.msdn.com/b/hongmeig/archive/2010/03/06/timeouts-in-wcf-and-their-default-values.aspx

    2.WCF Operation Timeout Exception http://www.codeproject.com/Articles/28265/WCF-Operation-Timeout-Exception

    I hope that will be helpful to you.

    Best Regards,

    Tracy Grady



    Thursday, August 6, 2015 7:35 AM
    Moderator
  • We have a long running WCF service hosted on IIS which makes use of the AppFabric MSMQ Activation process. The service fetches records from the database, run rules on them and based on the rule it enqueues each record to another MSMQ based service. 

    WCF is most likely terminating itself and WCF service may have to be configured  to sit in an idle state. Or WCF service has to be configured to know that it is doing long running processing and not terminate itself if it thinks it's under some kind of Denial Of Service attack most likely, which can be addressed in the Web.config.

    I am talking beyond WCF settings for timeout. If WCF thinks it is under attack like a DoS attack, then it is going to terminate itself.

    I saw articles for WCF service when WCF service is to run a long running process. You'll have to hit Bing and Google and look this information up.

    Thursday, August 6, 2015 12:17 PM