다음을 통해 공유


FaultType Enum

  • java.lang.Object
    • java.lang.Enum<FaultType>
      • system.fabric.FaultType

public enum FaultType

Indicates the type of fault that a service reports: invalid, transient or permanent.

Remarks : Services can report faults during runtime by using the reportFault(FaultType faultType) method to indicate the type of fault.

Fields

Invalid

The type is invalid.

Permanent

A permanent fault is a fault that the replica cannot recover from. This type of fault indicates that the replica can make no further progress and should be removed and replaced.

Remarks : An example of a permanent fault would be a persistent stateful service that tries to write information to disk and determines that the disk had been removed or was unusable. Calling reportFault(FaultType faultType) and reporting a permanent fault result in the service to be Aborted via StatefulServiceReplica abort() or StatelessServiceInstance abort() without a chance to gracefully clean up state or complete operations. Therefore, if any cleanup or other long-running work is necessary, it should be performed before reportFault(FaultType faultType) is called. Note that the distinction between permanent and transient faults is useful mainly for persistent stateful services. Other than the call sequence, the effects on other service types are the same: the replica or instance is removed, all state at that replica or instance is lost, and the replica or instance is recreated, potentially in a different location.

Transient

A transient fault indicates that there is some temporary condition which prevents the replica from making further progress or from processing further user requests.

Remarks : An example of a transient fault is a service that determines that a portion of its state or some reference file is corrupted, but can be repaired if the service were to be re-initialized. In this case, the service uses the reportFault(FaultType faultType) method to report a transient fault. Reporting a transient fault closes the service via StatefulServiceReplica. closeAsync(CancellationToken cancellationToken) or StatelessServiceInstance closeAsync(CancellationToken cancellationToken). Note that for stateless and stateful services, volatile transient faults are not very useful because state is not preserved across the failure. For these services, whether to use transient or permanent faults is dependent on whether the service should be gracefully closed asynchronously with cleanup or ungracefully closed with a synchronous StatefulServiceReplica abort() or StatelessServiceInstance abort() method.

Methods

getValue()

public int getValue()

Gets the system.fabric.FaultType value.

Returns

int
Returns an integer representing system.fabric.FaultType

Applies to