aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-08-14 05:06:44 -0700
committerChris Lu <chris.lu@gmail.com>2021-08-14 05:06:44 -0700
commit4909bd968405e33b0250a582081586d804a190a4 (patch)
tree82a0fd369c14d1d2094db78d7290d1c2c132fe34
parent8126ab4b5d7204ffcba364e14e857c498e4afe55 (diff)
downloadseaweedfs-4909bd968405e33b0250a582081586d804a190a4.tar.xz
seaweedfs-4909bd968405e33b0250a582081586d804a190a4.zip
gRpc connection error on filer when no volume left #2243
fix https://github.com/chrislusf/seaweedfs/issues/2243 grpc do not cache connections only when connection problem happens. Normal error results should not close the shared grpc connection.
-rw-r--r--weed/pb/grpc_client_server.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/weed/pb/grpc_client_server.go b/weed/pb/grpc_client_server.go
index 15dc917e9..53935858e 100644
--- a/weed/pb/grpc_client_server.go
+++ b/weed/pb/grpc_client_server.go
@@ -119,9 +119,7 @@ func WithCachedGrpcClient(fn func(*grpc.ClientConn) error, address string, opts
}
executionErr := fn(vgc.ClientConn)
if executionErr != nil {
- vgc.errCount++
- if vgc.errCount > 3 ||
- strings.Contains(executionErr.Error(), "transport") ||
+ if strings.Contains(executionErr.Error(), grpc.ErrServerStopped) ||
strings.Contains(executionErr.Error(), "connection closed") {
grpcClientsLock.Lock()
if t, ok := grpcClients[address]; ok {