[#1589] cache: Do not invalidate clients on context deadline exceeded

This error has almost the same meaning as context canceled. In most of cases
it is cuased by RPC timeout, so no need to invalidate cached clients.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-12-28 11:33:56 +03:00
parent fa08bfa553
commit a2249b981a
Signed by: dstepanov-yadro
GPG key ID: 237AF1A763293BC0

View file

@ -194,7 +194,8 @@ func (x *multiClient) ReportError(err error) {
return
}
if status.Code(err) == codes.Canceled || errors.Is(err, context.Canceled) {
if status.Code(err) == codes.Canceled || errors.Is(err, context.Canceled) ||
status.Code(err) == codes.DeadlineExceeded || errors.Is(err, context.DeadlineExceeded) {
return
}