[#596] engine: Consider context errors as logical #614
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
package engine
|
package engine
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
@ -196,7 +197,7 @@ func (e *StorageEngine) reportShardErrorWithFlags(
|
||||||
}
|
}
|
||||||
|
|
||||||
func isLogical(err error) bool {
|
func isLogical(err error) bool {
|
||||||
return errors.As(err, &logicerr.Logical{})
|
return errors.As(err, &logicerr.Logical{}) || errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Option represents StorageEngine's constructor option.
|
// Option represents StorageEngine's constructor option.
|
||||||
|
|
Loading…
Reference in a new issue