reportlab heisenbug故障排除 [英] Troubleshoot reportlab heisenbug

查看:131
本文介绍了reportlab heisenbug故障排除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Django 1.4 / Python 2.7 / reportlab(开源版本)生成pdf。

Using Django 1.4 / Python 2.7 / reportlab (open source version) to generate pdf.

到目前为止,事情一直很好。以前的pdf生成(如http所请求的返回/下载的生成的pdf文件)在Django 1.3上,不公开。已经升级并在许多页面上免费提供了功能,现在开始出现问题。

Things have worked really great up until now. Previously pdf generation (as in http requested returned/downloaded generated pdf file) was on Django 1.3 and not open for public. Have upgraded and made feature free on many pages and now starting to have problems.

我收到随机问题(因为我看到有一段时间有异常日志),但我从来没有能够重现自己的问题(事情大部分时间工作)。

I get 'random' problems (as in I see there are exceptions once in a while in logs) but I have never been able to reproduce problems myself (things works most of the time).

我得到的是以下类型的错误,总是发生在成对

What I get is the following type of errors that always happens in pairs

    Exception Value: ParaParser instance has no attribute '_seq'
    Exception Location: /home/tss/lib/python2.7/reportlab-2.5-py2.7-linux-i686.egg/reportlab/platypus/paraparser.py in _complete_parse, line 1061

$ b $。 b

然后

and then

    Exception Value: 'NoneType' object has no attribute 'close'
    Exception Location: /home/tss/lib/python2.7/reportlab-2.5-py2.7-linux-i686.egg/reportlab/lib/xmllib.py in close, line 521

鉴于我很难再现这一点,不知道是否有问题在我身边或reportlab - 我打开了关于如何解决这个问题的建议(可能是同步问题,如许多生成conccurently或只是一个明显的错误或...)

Given that I am having a hard time reproducing this and not sure if problem on my side or reportlab - I am open for suggestions on how to troubleshoot this (could it be sync issue as in many generating conccurently or just a plain bug or...)???

推荐答案

在reportlab邮件列表中发布了此问题,Reportlab不是线程安全的。

Posted this question on the reportlab mailing list and Reportlab is not thread-safe.

所以任何使用reportlab在哪里你最终会遇到间歇性的问题,并在一个多线程/网络应用程序环境中运行,你会得到真正非常奇怪的问题,由于这个。

So any usage of reportlab where you end up getting intermittent problems and are running in a multithread / web app environment you will get really really strange problems due to this.

现在我需要解决什么取代reportlab与,hmm ....

Now I need to work out what to replace reportlab with, hmm....

/ Jens

这篇关于reportlab heisenbug故障排除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆