1. prevent repeated creation of grpc connections and various command clients to avoid goroutine leaks and reduce the number of goroutines created.
before pr :
use go pprof tools
flyDB client start
run put test test 11 times
after run put test test 11 times
cause by :
The specified call for each gRPC client will create a gRPC connection using grpc.Dial. However, after the call is executed, the connection will not be closed.
// Put puts a key-value pair into the db by client api
func (c *Client) Put(key string, value interface{}) error {
client, err := newGrpcClient(c.Addr)
if err != nil {
return errors.New("new grpc client error: " + err.Error())
}
//...
return nil
}
after pr :
flyDB client start
run put test test 17 times
after run put test test 17 times
2. cli support zset
note : for ZAdds , Grumble does not support having multiple lists within multiple args,because no args can follow a list. Therefore, it is not possible to implement this functionality.
Thank you very much for solving potential security vulnerabilities in FlyDB. After we check that your code is correct, we will merge your pr into the main branch tomorrow.
1. prevent repeated creation of grpc connections and various command clients to avoid goroutine leaks and reduce the number of goroutines created.
before pr :
flyDB client start
run put test test 11 times
after run put test test 11 times
cause by :
example : string put
after pr :
flyDB client start
run put test test 17 times
after run put test test 17 times
2. cli support zset