Table of Contents

Class ResourceExhaustedException

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

Exception thrown when a bounded resource has reached its capacity limit.

public class ResourceExhaustedException : TyphonException, ISerializable
Inheritance
ResourceExhaustedException
Implements
Inherited Members

Remarks

This exception is thrown by components using the FailFast policy. It provides detailed information about which resource is exhausted and its current state.

if (_activeCount >= _options.MaxActiveTransactions)
{
    throw new ResourceExhaustedException(
        "DataEngine/TransactionPool",
        ResourceType.Service,
        _activeCount,
        _options.MaxActiveTransactions);
}

Constructors

ResourceExhaustedException(string, Exception, string, ResourceType, long, long)

Creates a new ResourceExhaustedException with a custom message and inner exception.

public ResourceExhaustedException(string message, Exception innerException, string resourcePath, ResourceType resourceType, long currentUsage, long limit)

Parameters

message string

Custom message describing the exhaustion.

innerException Exception

The exception that caused this exception.

resourcePath string

Full path of the exhausted resource.

resourceType ResourceType

Type of the resource.

currentUsage long

Current usage count.

limit long

Maximum allowed capacity.

ResourceExhaustedException(string, string, ResourceType, long, long)

Creates a new ResourceExhaustedException with a custom message.

public ResourceExhaustedException(string message, string resourcePath, ResourceType resourceType, long currentUsage, long limit)

Parameters

message string

Custom message describing the exhaustion.

resourcePath string

Full path of the exhausted resource.

resourceType ResourceType

Type of the resource.

currentUsage long

Current usage count.

limit long

Maximum allowed capacity.

ResourceExhaustedException(string, ResourceType, long, long)

Creates a new ResourceExhaustedException with full details.

public ResourceExhaustedException(string resourcePath, ResourceType resourceType, long currentUsage, long limit)

Parameters

resourcePath string

Full path of the exhausted resource.

resourceType ResourceType

Type of the resource.

currentUsage long

Current usage count.

limit long

Maximum allowed capacity.

Properties

CurrentUsage

Current usage count when the exception was thrown.

public long CurrentUsage { get; }

Property Value

long

IsTransient

Resource exhaustion is transient — the resource may self-heal (eviction, pool drain).

public override bool IsTransient { get; }

Property Value

bool

Limit

Maximum allowed capacity for this resource.

public long Limit { get; }

Property Value

long

ResourcePath

Full path of the exhausted resource in the resource tree.

public string ResourcePath { get; }

Property Value

string

Examples

"DataEngine/TransactionPool", "Storage/PageCache"

ResourceType

Type of the exhausted resource.

public ResourceType ResourceType { get; }

Property Value

ResourceType

Utilization

Current utilization as a ratio (0.0 to 1.0+).

public double Utilization { get; }

Property Value

double