Merge pull request #77 from doringeman/defunct-runners

loader: trigger idle runner eviction immediately if a runner is defunct
This commit is contained in:
Dorin-Andrei Geman 2025-06-13 11:52:52 +03:00 committed by GitHub
commit 6d3a7aca16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -253,6 +253,12 @@ func (l *loader) idleCheckDuration() time.Duration {
// Compute the oldest usage time for any idle runner.
var oldest time.Time
for _, slot := range l.runners {
select {
case <-l.slots[slot].done:
// Check immediately if a runner is defunct
return 0
default:
}
if l.references[slot] == 0 {
timestamp := l.timestamps[slot]
if oldest.IsZero() || timestamp.Before(oldest) {