You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The internal logic that was supposed to limit the number of promises to be executed in parallel, the way it's implemented in the lib, it doesn't work.
Internal function batchExecutor accepts a list of promises, but the moment that list is built, all the promises are already launched and it starts to write all the documents and apply that recursively even before it reaches batchExecutor "launching" logic. batchExecutor just waits before all the promises are resolved, but that doesn't help as it doesn't limit the number of promises being executed at the same time.
That leads to random hangs or Bandwidth Exhausted when the database is big enough.
Instead batchExecutor should expect an array of factory functions that returns promises and unwrap only a batch of those functions, then wait till batch is completed and proceed to unwrapping the next batch etc
I'll fix it and send a pull request to @cuong0993, assuming you can accept and merge it.
Expected behavior
Actual behavior
Steps to reproduce the behavior
The text was updated successfully, but these errors were encountered: