mirror of https://github.com/milvus-io/milvus.git
parent
a28b3c28d2
commit
2e4d64eca5
|
@ -769,12 +769,10 @@ func (node *QueryNode) Search(ctx context.Context, req *querypb.SearchRequest) (
|
|||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
if err != nil {
|
||||
failRet.Status.Reason = err.Error()
|
||||
failRet.Status.ErrorCode = commonpb.ErrorCode_UnexpectedError
|
||||
return err
|
||||
}
|
||||
if ret.GetStatus().GetErrorCode() != commonpb.ErrorCode_Success {
|
||||
failRet.Status.Reason = ret.Status.Reason
|
||||
failRet.Status.ErrorCode = ret.Status.ErrorCode
|
||||
return fmt.Errorf("%s", ret.Status.Reason)
|
||||
}
|
||||
|
@ -783,6 +781,8 @@ func (node *QueryNode) Search(ctx context.Context, req *querypb.SearchRequest) (
|
|||
})
|
||||
}
|
||||
if err := runningGp.Wait(); err != nil {
|
||||
// make fail reason comes from first err
|
||||
failRet.Status.Reason = err.Error()
|
||||
return failRet, nil
|
||||
}
|
||||
|
||||
|
@ -1144,12 +1144,10 @@ func (node *QueryNode) Query(ctx context.Context, req *querypb.QueryRequest) (*i
|
|||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
if err != nil {
|
||||
failRet.Status.Reason = err.Error()
|
||||
failRet.Status.ErrorCode = commonpb.ErrorCode_UnexpectedError
|
||||
return err
|
||||
}
|
||||
if ret.GetStatus().GetErrorCode() != commonpb.ErrorCode_Success {
|
||||
failRet.Status.Reason = ret.Status.Reason
|
||||
failRet.Status.ErrorCode = ret.Status.ErrorCode
|
||||
return fmt.Errorf("%s", ret.Status.Reason)
|
||||
}
|
||||
|
@ -1158,6 +1156,7 @@ func (node *QueryNode) Query(ctx context.Context, req *querypb.QueryRequest) (*i
|
|||
})
|
||||
}
|
||||
if err := runningGp.Wait(); err != nil {
|
||||
failRet.Status.Reason = err.Error()
|
||||
return failRet, nil
|
||||
}
|
||||
ret, err := mergeInternalRetrieveResultsAndFillIfEmpty(ctx, toMergeResults, req.GetReq().GetLimit(), req.GetReq().GetOutputFieldsId(), coll.Schema())
|
||||
|
|
Loading…
Reference in New Issue