FabricObjectClosedException Class

Definition

The exception that is thrown when the Service Fabric object is currently in a closed state due to one of the following conditions: 1. The Service Fabric object is being deleted. 2. The Service Fabric object is not reachable due to a failover.

[System.Serializable]
public class FabricObjectClosedException : System.Fabric.FabricException
[<System.Serializable>]
type FabricObjectClosedException = class
    inherit FabricException
Public Class FabricObjectClosedException
Inherits FabricException
Inheritance
FabricObjectClosedException
Attributes

Remarks

For example, this exception can be observed when a service attempts to perform an operation on a Service Fabric or FabricReplicator object while it is in the closed state. Another example is when an API is invoked on a FabricClient object when it is in the closed state.

Handling FabricObjectClosedException for FabricClient calls: If a FabricClient call sees FabricObjectClosedException, see FabricClient Exception Handling for handling common FabricClient failures.

Handling FabricObjectClosedException for Reliable Collections : 1. If the service sees FabricObjectClosedException in RunAsync, it should catch the exception and return from RunAsync. The CancellationToken passed to RunAsync would be signalled. All background tasks should complete execution when this cancellation is signalled. 2. If the service sees FabricObjectClosedException while processing a client request (e.g. via their communication listener), the service should throw the exception to the client to signal the client that it should re-resolve the service in order to locate the new Primary.

[NOTE] If an IReliableState was removed via IReliableStateManager.RemoveAsync(), any calls trying to access this IReliableState would see FabricObjectClosedException. These calls needs to be synchronized with the IReliableStateManager.RemoveAsync() call and should know that the IReliableState has been removed. Possible ways to handle this case are: 1. Recreate the IReliableState if it was removed and retry the operation. 2. Ignore the IReliableState and process other IReliableState in the service. 3. Use locks to avoid the race. Hence if a remove call comes in, the user can stop processing the IReliableState further.

Constructors

FabricObjectClosedException()

Initializes a new instance of FabricObjectClosedException class with error code Unknown.

FabricObjectClosedException(FabricErrorCode)

Initializes a new instance of FabricObjectClosedException class with a specified error code.

FabricObjectClosedException(SerializationInfo, StreamingContext)

Initializes a new instance of FabricObjectClosedException class from a serialized object data, with a specified context.

FabricObjectClosedException(SerializationInfo, StreamingContext, FabricErrorCode)

Initializes a new instance of FabricObjectClosedException class from a serialized object data, with specified context and error code.

FabricObjectClosedException(String)

Initializes a new instance of FabricObjectClosedException class with error code Unknown and a specified error message.

FabricObjectClosedException(String, Exception)

Initializes a new instance of FabricObjectClosedException class with a specified error message and a reference to the inner exception that is the cause of this exception.

FabricObjectClosedException(String, Exception, FabricErrorCode)

Initializes a new instance of FabricObjectClosedException class with a specified error message, a reference to the inner exception that is the cause of this exception, and a specified error code.

FabricObjectClosedException(String, FabricErrorCode)

Initializes a new instance of FabricObjectClosedException class.

Properties

ErrorCode

Gets the error code parameter.

(Inherited from FabricException)

Applies to