caliper icon indicating copy to clipboard operation
caliper copied to clipboard

Fabric 1.4 non gateway connector doesn't cleanup it's grpc connections

Open davidkel opened this issue 2 years ago • 2 comments

The fabric 1.4 non gateway connector doesn't clean up it's connections so when a benchmark terminates remote workers hang and don't terminate.

All connections should be closed on release context to ensure clean results for each round, looking at the code it should do this so may require some debugging to see what exactly is going on.

davidkel avatar Apr 21 '22 14:04 davidkel

Found out what is going on During prepare a context is obtained that will create connections to fabric which includes eventhubs. The prepare is really quick and releases the context which checks to see if the event hubs are connected and only disconnects if they are connected. In this case the fix is easy, the node sdk is happy for disconnect to be called while an event hub is in the process of connecting, so all we need to do is remove the

if (channelEventHub.isconnected()) {

test

Although what I don't know is what would happen if it was already disconnected or failed to connect but I would assume again that the node-sdk doesn't care (calling disconnect on something that isn't connected either by failure or a previous disconnect I would hope just results in a no-op)

If it did cause a problem then the alternative would be to use the callback option of the eventhub.connect call to wait for the connect to complete before exiting _createEventHubsForEachChannel()

davidkel avatar Apr 22 '22 08:04 davidkel