diff --git a/internal/distributed/proxy/httpserver/timeout_middleware.go b/internal/distributed/proxy/httpserver/timeout_middleware.go index 97cbc81e5a..6e35c6f3e1 100644 --- a/internal/distributed/proxy/httpserver/timeout_middleware.go +++ b/internal/distributed/proxy/httpserver/timeout_middleware.go @@ -25,6 +25,7 @@ import ( "sync" "time" + "github.com/cockroachdb/errors" "github.com/gin-gonic/gin" mhttp "github.com/milvus-io/milvus/internal/http" @@ -81,7 +82,7 @@ func NewWriter(w gin.ResponseWriter, buf *bytes.Buffer) *Writer { // Write will write data to response body func (w *Writer) Write(data []byte) (int, error) { if w.timeout || w.body == nil { - return 0, nil + return 0, errors.New("Response writer closed") } w.mu.Lock()