global group can deadlock requests if auth is not already cached #754
Labels
Status: Up for grabs
Issues that are ready to be worked on by anyone
Type: Bug
Something isn't working as documented
When running Octokit with auth, and trying to concurrently perform 10+ operations, a deadlock will happen.
The reason: https://github.com/octokit/plugin-throttling.js/blob/main/src/index.ts#L30
10 concurrent in global. If this buffer is filled with 10 requests, and no auth token is present, the auth request will end up as number 11, and never run, again causing the 10 requests in the queue to wait forever.
Example code to reproduce:
This will hang forever.
By reducing the array to 9 elements, it works.
By awaiting a single request before looping, it works (remove the comment before the loop, this will get a token and cache it).
By changing maxConcurrent to 11, it works.
I think it would be a good idea to let auth requests have its own queue, and not end up in the global one.
The text was updated successfully, but these errors were encountered: