mindlesscloud opened a new pull request, #1985:
URL: https://github.com/apache/incubator-devlake/pull/1985

   
   # Summary
   
   In the `ApiCollector.exec()`:
   ```go
   if collector.args.GetTotalPages != nil {
                err = collector.fetchAsync(reqData, 
collector.handleResponseWithPages(reqData))
        }
   ```
   
   the ` handleResponseWithPages` method
   ```go
   func (collector *ApiCollector) handleResponseWithPages(reqData *RequestData) 
ApiAsyncCallback {
        return func(res *http.Response, e error) error {
                ...
                for page := 2; page <= totalPages; page++ {
                        ...
                        e = collector.fetchAsync(reqDataTemp, 
collector.handleResponse(reqDataTemp))
                }
                return nil
        }
   }
   ```
   The `fetchAsync` will submit a task to the goroutine pool, if the goroutine 
pool is reached its capacity, the `Submit` will block until some earlier tasks 
are finished. Due to the FILO nature of recursive calls, tasks are waiting for 
each other, and deadlock occurs.
   
   The new method `pagerFetch` avoids recursively calling `fetchAsync`.
   
   ### Does this close any open issues?
   #1984 
   
   ### Screenshots
   
![middle_img_v2_f7fd5a64-392a-4aa6-9655-3e95f9d0311g](https://user-images.githubusercontent.com/8455907/169959334-2d177835-7d00-484b-85e2-9617e934d335.jpg)
   
   ### Other Information
   Any other information that is important to this PR.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to