From 47f323bbb3f386614b99f7c8aa99292b556b1b86 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 18 Sep 2026 10:57:14 -0700 Subject: [PATCH] pb: stop exiting the process on malformed server addresses ServerToGrpcAddress and GrpcAddressToServerAddress called glog.Fatalf when hostAndPort could not parse the port, which os.Exit(255)ed the whole process. A caller-supplied copy or tail source address reached this path synchronously in the serving goroutine, so one anonymous VolumeCopy with a non-numeric port terminated the volume server. Log the parse error and return the input unchanged instead: the dial or request that consumes the address then fails as an ordinary error. --- weed/pb/grpc_client_server.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/weed/pb/grpc_client_server.go b/weed/pb/grpc_client_server.go index b508effb4..30e5d63e9 100644 --- a/weed/pb/grpc_client_server.go +++ b/weed/pb/grpc_client_server.go @@ -551,7 +551,8 @@ func ServerToGrpcAddress(server string) (serverGrpcAddress string) { host, port, parseErr := hostAndPort(server) if parseErr != nil { - glog.Fatalf("server address %s parse error: %v", server, parseErr) + glog.Errorf("server address %s parse error: %v", server, parseErr) + return server } grpcPort := int(port) + 10000 @@ -562,7 +563,8 @@ func ServerToGrpcAddress(server string) (serverGrpcAddress string) { func GrpcAddressToServerAddress(grpcAddress string) (serverAddress string) { host, grpcPort, parseErr := hostAndPort(grpcAddress) if parseErr != nil { - glog.Fatalf("server grpc address %s parse error: %v", grpcAddress, parseErr) + glog.Errorf("server grpc address %s parse error: %v", grpcAddress, parseErr) + return grpcAddress } port := int(grpcPort) - 10000