mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-13 23:39:33 +01:00
wdclient: treat an elapsed caller deadline as caller-gave-up on lookup errors
gRPC can surface its own DeadlineExceeded a tick before ctx.Err() becomes visible, so a lookup that died on the caller's deadline was sporadically recorded as a filer failure (seen in the linux/386 job).
This commit is contained in:
1 parent
3b65169d6c
commit
a70f001e26
1 file changed
+10
-2
@@ -788,8 +788,16 @@ func (p *filerVolumeProvider) LookupVolumeIds(ctx context.Context, volumeIds []s
|
||||
}()
|
||||
|
||||
if err != nil {
|
||||
// a caller that gave up says nothing about this filer
|
||||
if ctxErr := ctx.Err(); ctxErr != 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
|
||||
ctxErr := ctx.Err()
|
||||
if ctxErr == nil {
|
||||
if dl, ok := ctx.Deadline(); ok && !dl.After(time.Now()) {
|
||||
ctxErr = context.DeadlineExceeded
|
||||
}
|
||||
}
|
||||
if ctxErr != nil {
|
||||
if lastErr != nil {
|
||||
return nil, fmt.Errorf("%w (earlier filer error: %v)", ctxErr, lastErr)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user