Skip to content

Commit 0c1a6b7

Browse files
authored
Merge pull request #115 from doringeman/misc
models: avoid error response when request is canceled/timed out
2 parents 5056133 + 0eff85e commit 0c1a6b7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/inference/models/manager.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ func (m *Manager) handleCreateModel(w http.ResponseWriter, r *http.Request) {
163163
// Pull the model. In the future, we may support additional operations here
164164
// besides pulling (such as model building).
165165
if err := m.PullModel(request.From, r, w); err != nil {
166+
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
167+
m.log.Infof("Request canceled/timed out while pulling model %q", request.From)
168+
return
169+
}
166170
if errors.Is(err, registry.ErrInvalidReference) {
167171
m.log.Warnf("Invalid model reference %q: %v", request.From, err)
168172
http.Error(w, "Invalid model reference", http.StatusBadRequest)

0 commit comments

Comments
 (0)