zuul/zuul/driver
Paul Belanger 46ac8a6ad2 Improve retry handling for github driver
It seems that a 1 second sleep for our 'retry' logic for github events
might not be long enough. This was raising an abuse expection from
github:

  2019-06-13 15:55:34,132 ERROR zuul.GithubEventProcessor: [e: ad668d74-8df3-11e9-93ab-4ff1818b4f8e] Exception when handling event:
  Traceback (most recent call last):
    File "/usr/local/lib/python3.5/dist-packages/zuul/driver/github/githubconnection.py", line 265, in _process_event
      event = method()
    File "/usr/local/lib/python3.5/dist-packages/zuul/driver/github/githubconnection.py", line 427, in _event_status
      self.body['sha'], project, self.zuul_event_id)
    File "/usr/local/lib/python3.5/dist-packages/zuul/driver/github/githubconnection.py", line 1312, in getPullBySha
      repo = github.repository(owner, repository)
    File "/usr/local/lib/python3.5/dist-packages/github3/github.py", line 1981, in repository
      json = self._json(self._get(url), 200)
    File "/usr/local/lib/python3.5/dist-packages/github3/models.py", line 156, in _json
      raise exceptions.error_for(response)
  github3.exceptions.ForbiddenError: 403 You have triggered an abuse detection mechanism. Please wait a few minutes before you try again.

Read documentation, github _should_ return the 'Retry-After' headers but
to be safe, we now default to 60 seconds if missing. 60 seconds was a
best guess on a default value for github, based on manual testing.

Change-Id: Ie1da348291b48e9f68336b20510830351402a343
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-06-13 13:07:04 -07:00
..
bubblewrap bubblewrap: bind mount /etc/subuid 2019-05-16 09:33:16 +02:00
gerrit Annotate logs around reporting 2019-05-30 19:18:01 +02:00
git git: only list heads and tags references 2019-05-24 07:31:48 +00:00
github Improve retry handling for github driver 2019-06-13 13:07:04 -07:00
mqtt Annotate logs around reporting 2019-05-30 19:18:01 +02:00
nullwrap Log cpu times of ansible executions 2018-07-14 10:32:06 +02:00
smtp Annotate logs around reporting 2019-05-30 19:18:01 +02:00
sql Annotate logs around reporting 2019-05-30 19:18:01 +02:00
timer Add event id to timer events 2019-05-17 06:06:12 +02:00
zuul Annotate logs in the zuul driver with event ids 2019-05-17 06:06:11 +02:00
__init__.py Status branch protection checking for github 2018-06-04 15:47:01 +02:00
util.py Add driver-specific pipeline requirements 2017-05-19 13:24:00 -07:00