mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 20:09:57 +08:00
fix: Fix frequent 'failed to get request info' log (#33334)
issue: https://github.com/milvus-io/milvus/issues/33333 --------- Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
parent
ee73e62202
commit
af71116499
@ -41,7 +41,7 @@ func RateLimitInterceptor(limiter types.Limiter) grpc.UnaryServerInterceptor {
|
||||
return func(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
|
||||
dbID, collectionIDToPartIDs, rt, n, err := getRequestInfo(ctx, req)
|
||||
if err != nil {
|
||||
log.RatedWarn(10, "failed to get request info", zap.Error(err))
|
||||
log.Warn("failed to get request info", zap.Error(err))
|
||||
return handler(ctx, req)
|
||||
}
|
||||
|
||||
@ -205,7 +205,7 @@ func getRequestInfo(ctx context.Context, req interface{}) (int64, map[int64][]in
|
||||
if req == nil {
|
||||
return util.InvalidDBID, map[int64][]int64{}, 0, 0, fmt.Errorf("null request")
|
||||
}
|
||||
return util.InvalidDBID, map[int64][]int64{}, 0, 0, fmt.Errorf("unsupported request type %T", req)
|
||||
return util.InvalidDBID, map[int64][]int64{}, 0, 0, nil
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -261,7 +261,7 @@ func TestRateLimitInterceptor(t *testing.T) {
|
||||
assert.Error(t, err)
|
||||
|
||||
_, _, _, _, err = getRequestInfo(context.Background(), &milvuspb.CalcDistanceRequest{})
|
||||
assert.Error(t, err)
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
|
||||
t.Run("test getFailedResponse", func(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user