-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Frodo Library version
v3.3.1
Describe the issue
We have a tenant with over 100 IDM config entities, and when we try to export the entities, either using frodo idm export -AD . host or frodo config export -AD . host Frodo terminates, and not only terminates but doesn't terminate with any sort of error indicating what happened.
I already debugged the issue and it appears to be caused by this line in the BaseApi.ts file that sets the max sockets to be 100. Since we are using Promise.all in the exportConfigEntities function in IdmConfigOps.ts, it opens a new socket per each request, and since there are over 100 of them Frodo just terminates without any reason.
As for the solution to the issue, a simple fix would be to just increase the limit, which I confirmed does work. By default the ProxyAgent allows for an infinite amount of sockets, so using the default would be the simplest fix for this issue if we don't want to worry about hitting the limit again. The other option could be to change anywhere in Frodo where we are using Promise.all (or Promise.allSettled) to use a custom promiseAll function that we create that automatically batches (or possibly pools the connections for) the requests so we never exceed the socket limit.
I'm open to other suggestions as well, especially if you have any @hfranklin or @vscheuber. I think upgrading the limit would be a good temporary fix, and then later we can refactor Frodo to batch requests or something so we don't run into issues using more sockets than the specified limit.