e501d39988
A BACKEND_EXHAUSTED classification (stage A) now puts that profile's credential into a BackendQuarantine for a configurable cooldown. A spawn onto a quarantined profile is refused naming the credential and roughly when it lifts; weighted/round-robin/fixed placement skip a quarantined candidate; the quarantine lifts itself on the injected clock; and it is visible on bridge_profiles. Keyed by credential, not by profile name, via the new Profile.credentialId (profiles sharing one credential quarantine together — e.g. two models on one account) and effectiveCredentialId() (unset ⇒ quarantines alone, today's behaviour unchanged). Fixed a related gap along the way: a reload changing exhaustedPattern was silently reported "applied" even though it's deferred — sameLaunchSettings() now catches it too.
24 lines
1.1 KiB
Java
24 lines
1.1 KiB
Java
package dev.ltms.bridged.placement;
|
|
|
|
import java.util.List;
|
|
import java.util.Set;
|
|
import java.util.function.Function;
|
|
|
|
/**
|
|
* Everything a {@link PlacementPolicy} needs to make one selection.
|
|
*
|
|
* @param defaultProfile profile a {@code fixed} policy should return (may be {@code null})
|
|
* @param candidates every configured candidate; the policy filters out those at cap or unreachable
|
|
* @param liveCount current live worker count per profile (from the session registry)
|
|
* @param unreachable profiles already known to have failed in this spawn attempt
|
|
* @param quarantined profiles whose credential is currently quarantined (CB-578 stage B) — a
|
|
* {@code BACKEND_EXHAUSTED} classification put it, or a profile it shares a
|
|
* credential with, on cooldown. Filtered the same way as {@code unreachable}.
|
|
*/
|
|
public record PlacementContext(String defaultProfile,
|
|
List<PlacementCandidate> candidates,
|
|
Function<String, Integer> liveCount,
|
|
Set<String> unreachable,
|
|
Set<String> quarantined) {
|
|
}
|