Open 1170300722 opened 2 years ago
I was intended to write like
gw, err := gateway.Connect(
gateway.WithConfig(config.FromFile(filepath.Clean(ccpPath))),
gateway.WithUser(userid),
)
defer gw.Close()
but as we know ,it wont be closed, it hasnt been implement ,and nothing will happen
now it is :
after connect gateway ,get network and submit Transaction, I cannot break the tcp connection.
I can read the leadger by doing this ,the var
result
is expected, but I notice the connection is still active, I cannot close the gateway connection, after invoking chaincode some times ,the connection is getting moremore and more memory and cpu is occupied ,and I cannot close the sdk in gateway because it is not leaked, it is in lower case
after some time, the gateway will write log as "error from discovery request...."so many times ,I think it is reported by
https://github.com/hyperledger/fabric-sdk-go/blob/main/pkg/client/common/discovery/dynamicdiscovery/chservice.go#L120
besides ,I can find many tcp connection and I can hardly query ledger ,peer will response like "context deadline exceeded". nothing i can do, i just restart my client, and it will work fine for some time ,and the same problem will appear again. How can I Close the gateway connection and all associated resources?