hyperledger-labs / orion-sdk-go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Too many open files error

tock-ibm opened this issue · comments

Problem:

we are encountering from time to time the following error:

Error:		Received unexpected error received error from remote [failed to process request: failed to write action: invalid transfer: failed getting state [ztoken4a8b637387db21a2a7181ec80ddb4e2a383efbab6602465935c72caaffa83ca81]: failed getting data: Get "http://127.0.0.1:22021/data/zkat/~ztoken~4a8b637387db21a2a7181ec80ddb4e2a383efbab6602465935c72caaffa83ca8~1~": dial tcp 127.0.0.1:22021: socket: too many open files]

This happens when doing a GET to http://127.0.0.1:22021/data/zkat/~ztoken~4a8b637387db21a2a7181ec80ddb4e2a383efbab6602465935c72caaffa83ca8~1~

where zkat is a db name and ~ztoken~4a8b637387db21a2a7181ec80ddb4e2a383efbab6602465935c72caaffa83ca8~1~ is a key.

In our integration tests, we also executes many token transactions, in parallel and not.
I’m wondering if this is because in the orion-sdk a new http client is created for each new DataTx instance.

Related:

check ulimit -n
see this discussion

check closing the http client in the DataTx or reusing it.