wdclient: reinterpret only deadline errors against an elapsed caller deadline

This commit is contained in:
chrislusf committed 2026-10-28 00:32:23 -07:00
1 parent a70f001e26
commit c936959aaf
1 file changed
+4 -4
+4 -4
View File
@@ -788,11 +788,11 @@ func (p *filerVolumeProvider) LookupVolumeIds(ctx context.Context, volumeIds []s
}()
if err != nil {
// a caller that gave up says nothing about this filer; check the
// deadline too since gRPC can report its own DeadlineExceeded a
// tick before ctx.Err() becomes visible
// a caller that gave up says nothing about this filer; gRPC can
// surface its own DeadlineExceeded a tick before ctx.Err()
// becomes visible, so reinterpret only deadline errors this way
ctxErr := ctx.Err()
if ctxErr == nil {
if ctxErr == nil && status.Code(err) == codes.DeadlineExceeded {
if dl, ok := ctx.Deadline(); ok && !dl.After(time.Now()) {
ctxErr = context.DeadlineExceeded
}