Commit 4b3836b3 authored by AlexStocks's avatar AlexStocks

Fix: double unlock

parent 82715a2e
...@@ -106,8 +106,7 @@ func (c *Client) Call(typ CodecType, addr, service, method string, args, reply i ...@@ -106,8 +106,7 @@ func (c *Client) Call(typ CodecType, addr, service, method string, args, reply i
return jerrors.Trace(c.call(ct, typ, addr, service, method, args, reply, nil, copts)) return jerrors.Trace(c.call(ct, typ, addr, service, method, args, reply, nil, copts))
} }
func (c *Client) AsyncCall(typ CodecType, addr, service, method string, func (c *Client) AsyncCall(typ CodecType, addr, service, method string, args, reply interface{}, handler AsyncHandler, opts ...CallOption) error {
args, reply interface{}, handler AsyncHandler, opts ...CallOption) error {
var copts CallOptions var copts CallOptions
for _, o := range opts { for _, o := range opts {
...@@ -193,7 +192,7 @@ func (c *Client) heartbeat(session getty.Session, typ CodecType) error { ...@@ -193,7 +192,7 @@ func (c *Client) heartbeat(session getty.Session, typ CodecType) error {
return c.transfer(session, typ, nil, NewPendingResponse(), CallOptions{}) return c.transfer(session, typ, nil, NewPendingResponse(), CallOptions{})
} }
func (c *Client) transfer(session getty.Session, typ CodecType,req *GettyRPCRequest, func (c *Client) transfer(session getty.Session, typ CodecType, req *GettyRPCRequest,
rsp *PendingResponse, opts CallOptions) error { rsp *PendingResponse, opts CallOptions) error {
var ( var (
......
...@@ -309,7 +309,6 @@ func (p *gettyRPCClientPool) release(conn *gettyRPCClient, err error) { ...@@ -309,7 +309,6 @@ func (p *gettyRPCClientPool) release(conn *gettyRPCClient, err error) {
connArray := p.connMap[key] connArray := p.connMap[key]
if len(connArray) >= p.size { if len(connArray) >= p.size {
p.Unlock()
conn.close() conn.close()
return return
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment