Paul
Paul

Reputation: 3815

How to increase timeout for an Azure Service Fabric Actor?

I found in our error logs that our Azure Service Fabric stateless service encountered a Microsoft.ServiceFabric.Actors.Runtime.DuplicateMessageException while trying to invoke a method on an Actor proxy after a period of time. The actor can take a while to run. The full message of the exception was:

Actor Microsoft.ServiceFabric.Actors.Runtime.ActorConcurrencyLock got same request more than once. This might happen for a request which takes more processing time than configured OperationTimeout on Client side as client retries on TimeoutException.

I do not see anywhere that I can configure this value. I see a reference to it in the documentation for the FabricTransportSettings class but I can't tell where that type is being used.

Since our actor method is expected to take a while to run (often minutes), if this error is indeed related to a timeout, how do I increase the OperationTimeout?

Upvotes: 1

Views: 3781

Answers (3)

Tiago Colombo
Tiago Colombo

Reputation: 11

Maybe you should consider putting the section below into your Settings.xml file:

<Section Name="TransportSettings">
    <Parameter Name="MaxMessageSize" Value="1073741824" />
    <Parameter Name="OperationTimeoutInSeconds" Value="6000" />
</Section>

Source: https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-reliable-actors-fabrictransportsettings

Upvotes: 0

callee.args
callee.args

Reputation: 439

You can set the Timeout value at the assembly level.

using Microsoft.ServiceFabric.Services.Remoting.FabricTransport;
[assembly: FabricTransportServiceRemotingProvider(MaxMessageSize = int.MaxValue,OperationTimeoutInSeconds =2000)]

Upvotes: 2

Ryan Durham
Ryan Durham

Reputation: 331

I would consider changing how the actor works in that you initialize and "seed" the actor with the needed parameters. Then fire a timer to execute the long running work. Then re-query the actor until the work is complete and retrieve result.

We have a couple long running workloads using actors in our system that we setup to work this way

Upvotes: 3

Related Questions