Skip to content

Commit 02a3b4e

Browse files
committed
Enforce max concurrency = 1 for blocking predict
1 parent 0d8a5af commit 02a3b4e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/server/runner.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"bufio"
55
"bytes"
66
"encoding/json"
7+
"errors"
78
"fmt"
89
"io"
910
"net/http"
@@ -377,6 +378,10 @@ func (r *Runner) handleSignals() {
377378
r.updateSetupResult()
378379
if _, err := os.Stat(path.Join(r.workingDir, "async_predict")); err == nil {
379380
r.asyncPredict = true
381+
382+
} else if errors.Is(err, os.ErrNotExist) && r.maxConcurrency > 1 {
383+
log.Warnw("max concurrency > 1 for blocking predict, reset to 1", "max_concurrency", r.maxConcurrency)
384+
r.maxConcurrency = 1
380385
}
381386
if err := r.handleReadinessProbe(); err != nil {
382387
log.Errorw("fail to write ready file", "err", err)

0 commit comments

Comments
 (0)