zuul/zuul
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
..
ansible Safely add Ansible password lookup plugin 2019-06-12 15:40:35 +00:00
cmd Fix for yappi output 2019-04-17 16:16:39 -04:00
connection Annotate some logs in the scheduler with event id 2019-05-17 06:06:11 +02:00
driver Improve retry handling for github driver 2019-06-13 13:07:04 -07:00
execution_context Add wrapper driver execution context 2017-08-18 16:35:12 -07:00
executor Merge "executor: use node python path" 2019-06-12 22:08:57 +00:00
lib jsonutil: do not encode SourceContext or ZuulMark 2019-06-05 10:47:05 +00:00
manager Merge "Annotate logs around finished builds" 2019-06-11 06:33:05 +00:00
merger Annotate builds with event id 2019-05-30 19:18:00 +02:00
reporter Filter file comments for existing files 2018-10-25 06:21:01 -07:00
source Cache branches in connections/sources 2018-08-09 16:02:02 -07:00
sphinx Add zuul-sphinx as a requirement 2017-08-07 14:56:17 -07:00
trigger Annotate logs in the zuul driver with event ids 2019-05-17 06:06:11 +02:00
web Revert "Create zuul/web/static on demand" 2019-06-04 09:57:04 -07:00
__init__.py Initial commit. 2012-05-29 14:49:32 -07:00
_setup_hook.py Revert "Create zuul/web/static on demand" 2019-06-04 09:57:04 -07:00
change_matcher.py Fix wrong matched project template 2018-08-02 12:19:15 +02:00
configloader.py Support fail-fast in project pipelines 2019-04-29 08:26:58 +02:00
exceptions.py mqtt: add basic reporter 2018-05-02 07:20:46 +00:00
model.py Merge "Annotate logs around build completion and cancellation" 2019-06-10 20:07:08 +00:00
nodepool.py Annotate logs around finished builds 2019-05-30 19:21:31 +02:00
rpcclient.py Use gearman client keepalive 2018-12-11 21:28:59 +01:00
rpclistener.py web: remove SafeLoader left-over from ZuulJSONEncoder 2019-06-05 10:03:54 +00:00
scheduler.py Annotate logs around finished builds 2019-05-30 19:21:31 +02:00
version.py Report git sha in status page version 2018-04-27 10:21:43 -07:00
zk.py Ensure correct lexical sorting of node requests 2019-03-14 15:39:23 +01:00