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

Concurrency issue? #100

@martino

Description

@martino

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions