screwdriver
screwdriver copied to clipboard
Circuit breaker of GitHub should use each requests response time when use paginate
What happened:
Circuit breaker of GitHub is not good when get changed files of pull request.
Circuit breaker restricts request from screwdriver api to github when a response time is too long (default is 10sec).
But screwdriver api sends requests for the count of pages when use octokit.paginate
and use sum of these response times as circuit breaker's response time.
Example:
Given a pull request having 3000 changed files, and all response times are 0.5sec. Then
(sum of response time) = 0.5sec x 30 times = 15sec
(We can get up to 100 changed files per page from GitHub API. (ref))
Thus circuit breaker's response time is greater than default timeout, so circuit breaker throws a timeout error.
What you expected to happen:
Circuit breaker uses each requests response time.
How to reproduce it: