ServiceFabric StatefulService Application auto restart slow

33 views Asked by At

After I upgraded the project version of Application to net 6.0, I found that the automatic restart becomes very slow with long intervals (and the retry interval becomes longer with the number of retries). Before the upgrade the retry interval does not get longer with the number of retries and usually the restart is done quickly. Can I set the restart speed and attempt time of Application by adjusting some configurations?

(When I manually delete the Application and start it, it will start successfully with very fast speed.)

Here are some of my current configuration files.

<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="xxx" ApplicationTypeVersion="1.3.9" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <Parameters>
    <Parameter Name="TankCollectionActorService_PartitionCount" DefaultValue="1" />
    <Parameter Name="TankCollectionActorService_MinReplicaSetSize" DefaultValue="1" />
    <Parameter Name="TankCollectionActorService_TargetReplicaSetSize" DefaultValue="2" />
  </Parameters>
  <ServiceManifestImport>
    <ServiceManifestRef ServiceManifestName="xxx" ServiceManifestVersion="1.3.9" />
  </ServiceManifestImport>
  <DefaultServices>
    <Service Name="TankCollectionActorService" GeneratedIdRef="5a8b426a-ca42-44de-8c85-fa3b5f496e0d|Persisted">
      <StatefulService ServiceTypeName="TankActorServiceType" TargetReplicaSetSize="[TankCollectionActorService_TargetReplicaSetSize]" MinReplicaSetSize="[TankCollectionActorService_MinReplicaSetSize]">
        <UniformInt64Partition PartitionCount="[TankCollectionActorService_PartitionCount]" LowKey="-9223372036854775808" HighKey="9223372036854775807" />
        <PlacementConstraints>(NodeTypeName==NodeType1)</PlacementConstraints>
      </StatefulService>
    </Service>
  </DefaultServices>
</ApplicationManifest>
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="xxx" Version="1.3.9" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <ServiceTypes>
    <StatefulServiceType ServiceTypeName="xxx" HasPersistedState="true">
      <Extensions>
        <Extension Name="__GeneratedServiceType__" GeneratedId="5a8b426a-ca42-44de-8c85-fa3b5f496e0d|Persisted">
          <GeneratedNames xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema">
            <DefaultService Name="TankCollectionActorService" />
            <ReplicatorEndpoint Name="TankActorServiceReplicatorEndpoint" />
            <ReplicatorConfigSection Name="TankActorServiceReplicatorConfig" />
            <ReplicatorSecurityConfigSection Name="TankActorServiceReplicatorSecurityConfig" />
            <ServiceEndpointV2_1 Name="TankActorServiceEndpointV2_1" />
          </GeneratedNames>
        </Extension>
      </Extensions>
    </StatefulServiceType>
  </ServiceTypes>
  <CodePackage Name="Code" Version="1.3.9">
    <EntryPoint>
      <ExeHost>
        <Program>Tank.CC.exe</Program>
        <WorkingFolder>CodePackage</WorkingFolder>
        <ConsoleRedirection FileRetentionCount="5" FileMaxSizeInKb="2048" />
      </ExeHost>
    </EntryPoint>
  </CodePackage>
  <ConfigPackage Name="Config" Version="1.3.9" />
  <Resources>
    <Endpoints>
      <Endpoint Name="TankActorServiceEndpointV2_1" />
      <Endpoint Name="TankActorServiceReplicatorEndpoint" />
    </Endpoints>
  </Resources>
</ServiceManifest>

The expectation is that the Application will attempt to restart at regular intervals after exiting, until the restart is successful. (This problem occurred after the project was upgraded to net 6.0, and it seems that the restart interval becomes longer as the number of retries increases).

0

There are 0 answers