Class ResourceExhaustedException
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
messagestringCustom message describing the exhaustion.
innerExceptionExceptionThe exception that caused this exception.
resourcePathstringFull path of the exhausted resource.
resourceTypeResourceTypeType of the resource.
currentUsagelongCurrent usage count.
limitlongMaximum 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
messagestringCustom message describing the exhaustion.
resourcePathstringFull path of the exhausted resource.
resourceTypeResourceTypeType of the resource.
currentUsagelongCurrent usage count.
limitlongMaximum 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
resourcePathstringFull path of the exhausted resource.
resourceTypeResourceTypeType of the resource.
currentUsagelongCurrent usage count.
limitlongMaximum allowed capacity.
Properties
CurrentUsage
Current usage count when the exception was thrown.
public long CurrentUsage { get; }
Property Value
IsTransient
Resource exhaustion is transient — the resource may self-heal (eviction, pool drain).
public override bool IsTransient { get; }
Property Value
Limit
Maximum allowed capacity for this resource.
public long Limit { get; }
Property Value
ResourcePath
Full path of the exhausted resource in the resource tree.
public string ResourcePath { get; }
Property Value
Examples
"DataEngine/TransactionPool", "Storage/PageCache"
ResourceType
Type of the exhausted resource.
public ResourceType ResourceType { get; }
Property Value
Utilization
Current utilization as a ratio (0.0 to 1.0+).
public double Utilization { get; }