#27 Remove caching when querying PDC so that Gitolite ACLs are not generated with stale data
Merged 6 years ago by pingou. Opened 6 years ago by mprahl.
Unknown source remove-cache  into  master

file modified
-7
@@ -13,7 +13,6 @@

  import logging

  import os

  

- import dogpile.cache

  import pdc_client

  import werkzeug

  
@@ -31,11 +30,6 @@

  

  _log = logging.getLogger(__name__)

  

- cache = dogpile.cache.make_region().configure(

-     'dogpile.cache.memory',

-     expiration_time=600,

- )

- 

  

  _blacklist = '''  -    f[0-9][0-9] = @all

    -    epel[0-9] = @all
@@ -50,7 +44,6 @@

  }

  

  

- @cache.cache_on_arguments()

  def get_supported_branches(namespace, package):

      default_url = 'https://pdc.fedoraproject.org/rest_api/v1/'

      url = pagure.APP.config.get('PDC_URL', default_url)

file modified
-2
@@ -48,7 +48,6 @@

  BuildRequires:      %{py_prefix}-setuptools

  

  Requires:           %{py_prefix}-pdc-client

- Requires:           %{py_prefix}-dogpile-cache

  Requires:           pagure >= 3.5

  

  %description -n python2-%{modname}
@@ -68,7 +67,6 @@

  BuildRequires:      python3-setuptools

  

  Requires:           python3-pdc-client

- Requires:           python3-dogpile-cache

  Requires:           python3-pagure

  

  %description -n python3-%{modname}

file modified
-1
@@ -7,7 +7,6 @@

  

  install_requires = [

      'pdc_client',

-     'dogpile.cache',

      'pagure',

  ]

  tests_require = [

We came across this issue:
https://pagure.io/fedora-infrastructure/issue/6290

It seems that @robert has two branches that he requested, the first being "epel7" and the second being "el6". He was able to write to "epel7" but not "el6". What I think happened is that fedrepo-req-admin processed the "epel7" branch request first, this triggered Pagure over dist-git to regenerate it's ACLs on the "libburn1" project. These ACLs are determined based on the results of a query to PDC. This query is then cached for 600 seconds. Within seconds after the first request, fedrepo-req-admin processed the "el6" branch request, which again, triggered Pagure over dist-git to regenerate it's ACLs on the project. This time, it used the cached query from seconds ago, omitting the "el6" branch in PDC.

This PR simply removes the caching.

:thumbsup: for me, could you rebase?

rebased

6 years ago

@pingou just rebased. Thanks for the review!

Pull-Request has been merged by pingou

6 years ago

This has been hotfixed in prod