Skip to content

Commit 9eeacac

Browse files
fix penalty def and comment
1 parent 8da5bc1 commit 9eeacac

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

server/ai_session.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ func NewAISessionSelector(cap core.Capability, modelID string, node *core.Livepe
187187
// The latency score in this context is just the latency of the last completed request for a session
188188
// The "good enough" latency score is set to 0.0 so the selector will always select unknown sessions first
189189
minLS := 0.0
190+
// Session pool suspender starts at 0. Suspension is 3 requests if there are errors from the orchestrator
190191
penalty := 3
191192
warmPool := NewAISessionPool(NewMinLSSelector(stakeRdr, minLS, node.SelectionAlgorithm, node.OrchPerfScore, warmCaps), suspender, penalty)
192193
coldPool := NewAISessionPool(NewMinLSSelector(stakeRdr, minLS, node.SelectionAlgorithm, node.OrchPerfScore, coldCaps), suspender, penalty)
@@ -234,8 +235,8 @@ func (sel *AISessionSelector) Select(ctx context.Context) *AISession {
234235
discoveryPoolSize := int(math.Min(float64(sel.node.OrchestratorPool.Size()), float64(sel.initialPoolSize)))
235236

236237
if (sel.warmPool.Size() + sel.coldPool.Size()) == 0 {
237-
//release all orchestrators from suspension and try refresh
238-
//if penalty in
238+
// release all orchestrators from suspension and try refresh
239+
// if there are no orchestrators in the pools
239240
clog.Infof(ctx, "refreshing sessions, no orchestrators in pools")
240241
for i := 0; i < sel.penalty; i++ {
241242
sel.suspender.signalRefresh()

0 commit comments

Comments
 (0)