Skip to content
This repository has been archived by the owner on Jun 20, 2018. It is now read-only.

Concurrency issue? #100

Open
martino opened this issue Sep 22, 2015 · 4 comments
Open

Concurrency issue? #100

martino opened this issue Sep 22, 2015 · 4 comments

Comments

@martino
Copy link

martino commented Sep 22, 2015

Hi using gargoyle.is_active we've found in our sentry this exception:

Stacktrace (le chiamate più recenti alla fine):

  File "django/core/handlers/base.py", line 164, in get_response
    response = response.render()
  File "django/template/response.py", line 158, in render
    self.content = self.rendered_content
  File "django/template/response.py", line 135, in rendered_content
    content = template.render(context, self._request)
  File "django_jinja/backend.py", line 64, in render
    return self.template.render(context)
  File "jinja2/environment.py", line 989, in render
    return self.environment.handle_exception(exc_info, True)
  File "jinja2/environment.py", line 754, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "./yellow/our_template.html", line 83, in block "main_content"
    {{ render_company(company_name, switch_is_active("ourswith", request.user)) }}
  File "yellow/templatetags/tags.py", line 137, in switch_is_active
    return gargoyle.is_active(switch_slug, *instances)
  File "gargoyle/manager.py", line 58, in is_active
    switch = self[key]
  File "gargoyle/manager.py", line 34, in __getitem__
    return SwitchProxy(self, super(SwitchManager, self).__getitem__(key))
  File "modeldict/base.py", line 23, in __getitem__
    self._populate()
  File "modeldict/base.py", line 168, in _populate
    elif self.local_cache_has_expired():
  File "modeldict/base.py", line 108, in local_cache_has_expired
    recheck_at = self._last_checked_for_remote_changes + self.timeout

Seems to be a concurrency issue in the function local_cache_has_expired

105.  if not self._last_checked_for_remote_changes:
106.      return True  # Never checked before
107.
108.  recheck_at = self._last_checked_for_remote_changes + self.timeout
109.  return time.time() > recheck_at

We use:

django  1.8.4
gargoyle    0.11.0
@Fluxx
Copy link
Contributor

Fluxx commented Sep 22, 2015

What is the actual exception that is being thrown?

@adamchainz
Copy link
Contributor

Hi, the concurrency issue has been fixed in our fork django-modeldict-yplan (in this commit), please check it out at https://github.com/YPlan/django-modeldict .

@martino
Copy link
Author

martino commented Feb 3, 2016

Thank you!

@adamchainz
Copy link
Contributor

Forgot to say: we're also maintaining nexus and gargoyle - pip install nexus-yplan and gargoyle-yplan.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants