pool#
Warm standby sessions for failover.
Standbys are launched when the pool is created, so a failover does not wait for a product launch; the resilient controller keeps them up to date with the active session. Health is checked on demand (when a standby is needed) rather than by background polling. Replaced and retired sessions are exited on a background thread so that a failover never blocks on tearing down a dead server.
Classes:
|
One active session plus |
- class ansys.fluent.core.resilient.engine.pool.WarmSessionPool(active, *, size, launcher, adapter)#
Bases:
objectOne active session plus
size - 1warm standby sessions.- Parameters:
- active
object The session in use.
- size
int Total number of sessions, including the active one.
- launcher
callable() Zero-argument callable that launches a standby session.
- adapter
ResilientAdapter The product adapter.
- active
- Raises:
ResilientErrorIf a standby session cannot be launched.
Methods:
__init__(active, *, size, launcher, adapter)promote(standby, *[, retire_previous])Make
standbythe active session; return the previous active session.release(session)Put back a standby that was taken but not promoted.
shutdown(*[, keep])Exit every session of the pool except
keep.take_standby([prefer])Remove and return a healthy standby session.
Attributes:
Return the active session.
Called with each standby launched after the pool was created.
Return the configured number of sessions, including the active one.
Return the warm standby sessions.
- __init__(active, *, size, launcher, adapter)#
-
on_standby_added:
Optional[Callable[[Any],None]]# Called with each standby launched after the pool was created.
- promote(standby, *, retire_previous=True)#
Make
standbythe active session; return the previous active session.The previous session is exited in the background unless
retire_previousisFalse, and a replacement standby is launched in the background.
- release(session)#
Put back a standby that was taken but not promoted.
- shutdown(*, keep=None)#
Exit every session of the pool except
keep.
- take_standby(prefer=None)#
Remove and return a healthy standby session.
Unhealthy standbys found on the way are exited.
- Parameters:
- prefer
callable(),optional Called with each healthy standby; the first one for which it returns
Trueis taken. Otherwise the first healthy standby is taken.
- prefer
- Raises:
FailoverErrorIf no healthy standby is available.