cache

package
v0.0.0-...-1a76267 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTTL = time.Minute
	// InstanceTypesAndZonesTTL is the time before we refresh instance types and zones at Oci instance
	InstanceTypesAndZonesTTL = 5 * time.Minute

	// UnavailableOfferingsTTL is the time before offerings that were marked as unavailable
	// are removed from the cache and are available for launch again
	UnavailableOfferingsTTL = 3 * time.Minute
)
View Source
const (
	// DefaultCleanupInterval triggers cache cleanup (lazy eviction) at this interval.
	DefaultCleanupInterval = time.Minute

	// UnavailableOfferingsCleanupInterval triggers cache cleanup (lazy eviction) at this interval.
	// We drop the cleanup interval down for the ICE cache to get quicker reactivity to offerings
	// that become available after they get evicted from the cache
	UnavailableOfferingsCleanupInterval = time.Second * 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type UnavailableOfferings

type UnavailableOfferings struct {
	SeqNum uint64
	// contains filtered or unexported fields
}

UnavailableOfferings stores any offerings that return ICE (insufficient capacity errors) when attempting to launch the capacity. These offerings are ignored as long as they are in the cache on GetInstanceTypes responses

func NewUnavailableOfferings

func NewUnavailableOfferings() *UnavailableOfferings

func (*UnavailableOfferings) Delete

func (u *UnavailableOfferings) Delete(instanceType string, zone string, capacityType string)

func (*UnavailableOfferings) Flush

func (u *UnavailableOfferings) Flush()

func (*UnavailableOfferings) IsUnavailable

func (u *UnavailableOfferings) IsUnavailable(instanceType, zone, capacityType string) bool

IsUnavailable returns true if the offering appears in the cache

func (*UnavailableOfferings) MarkUnavailable

func (u *UnavailableOfferings) MarkUnavailable(ctx context.Context, unavailableReason, instanceType, zone, capacityType string)

MarkUnavailable communicates recently observed temporary capacity shortages in the provided offerings

func (*UnavailableOfferings) MarkUnavailableForLaunchInstanceErr

func (u *UnavailableOfferings) MarkUnavailableForLaunchInstanceErr(ctx context.Context, err error, capacityType string, instanceType string, zone string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL