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

### 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]