我的服务器上出现了一个问题,事情会突然锁定,所以我在 SO 上找到了一些漂亮的代码,并在服务器再次锁定时使用它来打印所有服务器线程的堆栈跟踪。
大多数线程都在做他们应该做的事情,但这一个看起来真的很奇怪。它似乎正在调用一个同情测试。我根本无法理解它是如何从模板标签变成 sympy 的。
File: "/opt/django-live1.0/django/core/handlers/wsgi.py", line 248, in __call__
response = self.get_response(request)
File: "/opt/django-live1.0/django/core/handlers/base.py", line 80, in get_response
response = middleware_method(request)
File: "/opt/django-live1.0/protected/middleware.py", line 16, in process_request
login_url = reverse('protected-login')
File: "/opt/django-live1.0/django/core/urlresolvers.py", line 351, in reverse
*args, **kwargs)))
File: "/opt/django-live1.0/django/core/urlresolvers.py", line 272, in reverse
possibilities = self.reverse_dict.getlist(lookup_view)
File: "/opt/django-live1.0/django/core/urlresolvers.py", line 194, in _get_reverse_dict
self._populate()
File: "/opt/django-live1.0/django/core/urlresolvers.py", line 162, in _populate
for pattern in reversed(self.url_patterns):
File: "/opt/django-live1.0/django/core/urlresolvers.py", line 244, in _get_url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File: "/opt/django-live1.0/django/core/urlresolvers.py", line 239, in _get_urlconf_module
self._urlconf_module = import_module(self.urlconf_name)
File: "/opt/django-live1.0/django/utils/importlib.py", line 35, in import_module
__import__(name)
File: "/var/www/site/urls.py", line 12, in <module>
from sitelib.urls import initialize_urls
File: "/opt/django-live1.0/utils/urls.py", line 11, in <module>
admin.autodiscover()
File: "/opt/django-live1.0/utils/default_settings.py", line 178, in init_defaults
logging.error("Error setting up logging: %s" % ex)
File: "/opt/django-live1.0/django/template/__init__.py", line 1049, in add_to_builtins
builtins.append(import_library(module))
File: "/opt/django-live1.0/django/template/__init__.py", line 997, in import_library
return mod.register
File: "/opt/django-live1.0/django/utils/importlib.py", line 36, in import_module
return sys.modules[name]
File: "/opt/django-live1.0/misc/templatetags/misc_tags.py", line 427, in <module>
@make_tag
File: "/usr/local/lib/python2.6/dist-packages/sympy-0.6.7-py2.6.egg/sympy/__init__.py", line 44, in <module>
evalf._create_evalf_table()
File: "/usr/local/lib/python2.6/dist-packages/sympy-0.6.7-py2.6.egg/sympy/core/__init__.py", line 22, in <mod
ule>
exec '%s = _cls()' % (_n)
File: "/usr/local/lib/python2.6/dist-packages/sympy-0.6.7-py2.6.egg/sympy/core/basic.py", line 2505, in <modu
le>
from numbers import Rational, Integer
File: "/usr/local/lib/python2.6/dist-packages/sympy-0.6.7-py2.6.egg/sympy/mpmath/__init__.py", line 385, in <
module>
doctests()
File: "/usr/local/lib/python2.6/dist-packages/sympy-0.6.7-py2.6.egg/sympy/mpmath/ctx_fp.py", line 12, in <mod
ule>
class FPContext(StandardBaseContext):
File: "/usr/local/lib/python2.6/dist-packages/sympy-0.6.7-py2.6.egg/sympy/mpmath/ctx_base.py", line 31, in <m
odule>
VisualizationMethods):
File: "/usr/local/lib/python2.6/dist-packages/sympy-0.6.7-py2.6.egg/sympy/mpmath/identification.py", line 840
, in <module>
doctest.testmod()
File: "/usr/local/lib/python2.6/dist-packages/sympy-0.6.7-py2.6.egg/sympy/mpmath/libmp/__init__.py", line 63,
in <module>
from backend import (gmpy, sage, BACKEND, STRICT, MPZ, MPZ_TYPE,
File: "/usr/local/lib/python2.6/dist-packages/sympy-0.6.7-py2.6.egg/sympy/mpmath/libmp/libmpf.py", line 1317,
in <module>
pass
File: "/usr/local/lib/python2.6/dist-packages/sympy-0.6.7-py2.6.egg/sympy/mpmath/libmp/libintmath.py", line 4
25, in <module>
def eulernum(m, _cache={0:MPZ_ONE}):
File: "/usr/local/lib/python2.6/dist-packages/sympy-0.6.7-py2.6.egg/sympy/mpmath/libmp/libintmath.py", line 6
5, in python_trailing
return t
@make_tag 只是将函数转换为模板标签的片段
有谁知道这怎么会发生?