mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-13 15:29:12 +01:00
wdclient: reinterpret only deadline errors against an elapsed caller deadline
This commit is contained in:
1 parent
a70f001e26
commit
c936959aaf
1 file changed
+4
-4
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user