1

我试图找出导致我们的 Zope 实例越来越频繁地锁定的问题的根源。我已经安装了Products.signalstackLogger以试图深入了解它,当我们在 Plone 中定义的内容规则之一试图发送电子邮件时,它似乎正在发生。

例如:

Thread 46447504 (GET /VirtualHostBase/https/xxx.xxx.xxx:443/plone/VirtualHostRoot/news/portal_factory/News Item/news_item.2012-09-18.0763501726/edit):
  File "/home/zope/home/parts/zope2/lib/python/ZServer/PubCore/ZServerPublisher.py", line 31, in __init__
    response=b)
  File "/home/zope/home/parts/zope2/lib/python/ZPublisher/Publish.py", line 401, in publish_module
    environ, debug, request, response)
  File "/home/zope/home/parts/zope2/lib/python/ZPublisher/Publish.py", line 202, in publish_module_standard
    response = publish(request, module_name, after_list, debug=debug)
  File "/home/zope/home/parts/zope2/lib/python/ZPublisher/Publish.py", line 119, in publish
    request, bind=1)
  File "/home/zope/home/parts/zope2/lib/python/ZPublisher/mapply.py", line 88, in mapply
    if debug is not None: return debug(object,args,context)
  File "/home/zope/home/parts/zope2/lib/python/ZPublisher/Publish.py", line 42, in call_object
    result=apply(object,args) # Type s<cr> to step into published object.
  File "/home/zope/home/eggs/Plone-3.3.6-py2.4.egg/Products/CMFPlone/FactoryTool.py", line 375, in __call__
    temp_obj = tempFolder.__getitem__(id)
  File "/home/zope/home/eggs/Plone-3.3.6-py2.4.egg/Products/CMFPlone/FactoryTool.py", line 155, in __getitem__
    self.invokeFactory(id=id, type_name=type_name)
  File "/home/zope/home/eggs/Plone-3.3.6-py2.4.egg/Products/CMFPlone/PloneFolder.py", line 348, in invokeFactory
    new_id = pt.constructContent(*args, **kw)
  File "/home/zope/home/eggs/Products.CMFCore-2.1.3-py2.4.egg/Products/CMFCore/TypesTool.py", line 716, in constructContent
    ob = info.constructInstance(container, id, *args, **kw)
  File "/home/zope/home/eggs/Products.CMFCore-2.1.3-py2.4.egg/Products/CMFCore/TypesTool.py", line 276, in constructInstance
    ob = self._constructInstance(container, id, *args, **kw)
  File "/home/zope/home/eggs/Products.CMFCore-2.1.3-py2.4.egg/Products/CMFCore/TypesTool.py", line 450, in _constructInstance
    newid = m(id, *args, **kw)
  File "<string>", line 7, in addATNewsItem
  File "/home/zope/home/parts/zope2/lib/python/OFS/ObjectManager.py", line 349, in _setObject
    notifyContainerModified(self)
  File "/home/zope/home/parts/zope2/lib/python/zope/app/container/contained.py", line 365, in notifyContainerModified
    notify(ContainerModifiedEvent(object, *descriptions))
  File "/home/zope/home/parts/zope2/lib/python/zope/event/__init__.py", line 23, in notify
    subscriber(event)
  File "/home/zope/home/parts/zope2/lib/python/zope/component/event.py", line 26, in dispatch
    for ignored in zope.component.subscribers(event, None):
  File "/home/zope/home/parts/zope2/lib/python/zope/component/_api.py", line 130, in subscribers
    return sitemanager.subscribers(objects, interface)
  File "/home/zope/home/parts/zope2/lib/python/zope/component/registry.py", line 290, in subscribers
    return self.adapters.subscribers(objects, provided)
  File "/home/zope/home/parts/zope2/lib/python/zope/interface/adapter.py", line 535, in subscribers
    subscription(*objects)
  File "/home/zope/home/eggs/plone.app.contentrules-1.1.7-py2.4.egg/plone/app/contentrules/handlers.py", line 174, in modified
    execute(aq_parent(aq_inner(event.object)), event)
  File "/home/zope/home/eggs/plone.app.contentrules-1.1.7-py2.4.egg/plone/app/contentrules/handlers.py", line 97, in execute
    executor(event, bubbled=True, rule_filter=rule_filter)
  File "/home/zope/home/eggs/plone.contentrules-1.1.0-py2.4.egg/plone/contentrules/engine/executor.py", line 27, in __call__
    executable()
  File "/home/zope/home/eggs/plone.contentrules-1.1.0-py2.4.egg/plone/contentrules/rule/rule.py", line 48, in __call__
    if not executable():
  File "/home/zope/home/eggs/plone.app.contentrules-1.1.7-py2.4.egg/plone/app/contentrules/actions/mail.py", line 103, in __call__
    From=source)
  File "/home/zope/home/eggs/Products.SecureMailHost-1.1.2-py2.4.egg/Products/SecureMailHost/SecureMailHost.py", line 246, in secureSend
    return self._send(mfrom, all_recipients, msg, debug=debug)
  File "/home/zope/home/eggs/Products.SecureMailHost-1.1.2-py2.4.egg/Products/SecureMailHost/SecureMailHost.py", line 276, in _send
    mail.send()
  File "/home/zope/home/eggs/Products.SecureMailHost-1.1.2-py2.4.egg/Products/SecureMailHost/mail.py", line 102, in send
    smtpserver = smtplib.SMTP(self.host, self.port)
  File "/usr/local/lib/python2.4/smtplib.py", line 244, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/local/lib/python2.4/smtplib.py", line 311, in connect
    (code, msg) = self.getreply()
  File "/usr/local/lib/python2.4/smtplib.py", line 352, in getreply
    line = self.file.readline()
  File "/usr/local/lib/python2.4/socket.py", line 332, in readline
    data = self._sock.recv(self._rbufsize)

这些通知通常可以正常工作(每天发送许多电子邮件),并且已配置超过 12 个月,问题仅在最近 2 个月内出现。导致问题的唯一主要变化是从 Apache 负载均衡器切换到 Haproxy

我们正在使用:

  • Linux
  • 本地 qmail 服务器 (localhost:25)
  • Python 2.4.6
  • 克隆 3.3.6
4

1 回答 1

1

这似乎是我们的 qmail 服务器达到其外部连接限制的结果。我们将其配置为 30,其中一个 IP(可能是垃圾邮件机器人)占用了其中的 20 个。

我们的 Zope 实例通过同一虚拟服务器上的 qmail 发送电子邮件,但这也是我们面向外部的邮件服务器。一旦达到连接限制,似乎来自 smtplib 的连接尝试将等待且没有超时。

现在我已经关闭了违规内容规则。从长远来看,我们可能会修补 ucspi-tcp以通过 IP 限制连接,并切换到使用单独的邮件服务器来处理本地和外部电子邮件。

于 2012-09-19T09:19:36.860 回答