We have been observing this same error.
If you want a testbed, run a simple script like this one:
from package import TimeLogger
Use 10 threads, each with a PythonInterpreter instance, to process in
paralel 1000 runs of the above script, at a rate of 100 per second.=20
In this conditions we have seen this happen ~30 times, with errors like
"Could not find the package" or "Could not resolve TimeLogger".
We are using Windows XP running in a PIV 2.8 HT with 1GB of RAM.
[mailto:jython-users-bounces@...] On Behalf Of Michael
Sent: quarta-feira, 6 de Junho de 2007 22:32
Subject: Re: [Jython-users] Using Jython in separate threads
I did search (via nabble) for (mail list) threads about (execution)=20
threads, and saw other posts describing what seem to be exactly the same
One of the replies mentioned using a separate PySystemState instance for
each interpreter object, but as is also mentioned in these threads, it=20
doesn't seem to help (it doesn't help us either). And one of them=20
mentions that restricting to a single thread makes the errors go away=20
(as we observe as well). They don't mention which platform they're=20
using, but I don't know that it's necessarily a platform-specific=20
problem, unless it's an issue with certain JVMs. What seems certain is=20
that ease of reproduction of the problem depends on your hardware, but=20
that doesn't mean that the problem doesn't always exist. It seems like=20
either we're all doing something wrong on Windows and you're doing it=20
correctly on Linux, or Linux is just a platform where it is hard to=20
reproduce the problem. Maybe I should try other JVMs or OSs...
olivier merlin wrote:
> don't you fall under win32 specific OS issues ? I saw several threads
> on problem with many threads on windows.
> i ran last week complex scripts with 2048 threads under Linux . I have
> to do some adjustments on the 32bit kernel and the JVM parameters.
> 2007/6/2, Oti <ohumbel@...>:
>> our team switched the machine a few days ago. It is now a 64-bit 'i
>> not know how many core' machine (sorry I have to check that first).
>> The strange coincidence is: Now I get error reports nobody can=20
>> explain, like:
>> A method call (calling a method of the Java super class) succeeds on
>> one line of a script, and the exact same method call fails on the
>> line (with an AttributeError). It is a simple one-line getter method
>> returning a reference to a private member.
>> 'instance' has no attribute X, on a line where X isn't involved at
>> all. But X is imported on top of the script.
>> Poeple say these scripts have been running successfully for a long
>> time on the old machine. These effects might have a completely
>> different reason, but who knows ?
>> I'll try to run your example on this machine, but I can't promise any
>> time frame.
>> I will post my findings here.
>> best wishes,
>> On 5/22/07, Michael Chisholm <chisholm@...> wrote:
>> > It's been a few months; other higher-priority tasks got in the way
>> > investigating this further. But it is again moving up the priority
>> > queue...
>> > Attached is the code we came up with the demonstrate the error. We
>> > been using XP and Jython 2.2b2 to show the error. Unfortunately,=20
>> it is
>> > rather difficult to reproduce on single-core computers. This code
>> > simply creates a bunch of threads that instantiate their own
>> > PythonInterpreter object and run the same simple python script.
>> > script does a lot of importing, to try to produce an import error.
>> > Output goes to a file, since we found that writing to stdout was
>> > error-prone. Sometimes the output just stops working. E.g. with
>> > threads, where the script prints to stdout, you might see only 3 or
>> > prints. But this is of secondary importance to us.
>> > The test program is set to create 500 threads (there's a variable=20
>> at the
>> > top you can change), and that doesn't even reliably produce it. If
>> > are watching the Task Manager's process list when you run it,=20
>> > the program will seem to hang, and memory usage will balloon...
>> > sometimes it seems to hang without ballooning memory usage.
>> > the program finishes successfully within seconds. But the error=20
>> that is
>> > hurting us is an import error. If you check the output file
>> > after running the program, sometimes you will see something like
>> > following:
>> > Traceback (innermost last):
>> > File "<string>", line 6, in ?
>> > ImportError: no module named n
>> > The module mentioned varies. I am told that on one of our high end
>> > multi-core machines (which I don't have access to; we are a
>> > geographically distributed team), this import error occurs reliably
>> > only 3 or 4 threads. And that's what kills us. Our back-end may
>> > need to spawn 500 threads, but 3-4 is routine. If you have any
>> > multi-core machines to test with, that would be ideal.
>> > I don't suppose fixing this is easy... but it will be interesting=20
>> to at
>> > least see whether others can reproduce the error and acknowledge=20
>> that it
>> > exists. Or maybe find a more reliable way to produce it.
>> > Andy
>> > Charlie Groves wrote:
>> > > It looks like the setOut and setErr problems in that message have
>> > > fixed in the current code, but I'm not sure if it's fixed in the
>> > > alpha. Why are you using the alpha instead of the beta? I know=20
>> > > fixed a few other threading problems that were present in the
>> > >
>> > > In any case, there are a number of threading problems mentioned
>> > > http://jython.org/patches/898709 that still exist as far as I
>> > > That information needs review and integration with the current
>> > > which is outside of the scope of the work I'm planning for the
>> > > release. However, if you can provide more information about the
>> > > threading errors you're seeing or a way to reproduce them, that=20
>> > > get some work on this moved into 2.2. I definitely want Jython
>> > > have the ability to use multiple interpreters in multiple
>> > > it's a question of how broken it is and how much work it would=20
>> take to
>> > > fix it that determines when it'll get attention.
>> > >
>> > > Charlie
>> > >
>> > > On 2/20/07, Michael Chisholm <chisholm@...> wrote:
>> > >> At =
>> is an
>> > >> old message stating that multiple instances of the Jython=20
>> > >> may not be usable from different threads, due to static data
>> > >> among the instances. We have a system which uses Jython from=20
>> > >> threads (one instance per thread) and are seeing significant=20
>> > >> which resolve themselves when we remove the multithreading. We
>> > >> trying to understand the root cause of these issues.
>> > >>
>> > >> Are the issues mentioned in the above link still relevant for=20
>> the 2.2
>> > >> alpha version? (We still must use the alpha for reasons which I
>> > >> sincerely hope will resolve themselves once 2.2 final is out.)
>> > >>
>> > >> Andy
>> > >>
>> > >>
>> > >>
>> > >>=20
>> > >>
>> > >> Take Surveys. Earn Cash. Influence the Future of IT
>> > >> Join SourceForge.net's Techsay panel and you'll get the chance
>> > >> share your
>> > >> opinions on IT & business topics through brief surveys-and earn=20
>> > >>=20
>> > >>
>> > >> _______________________________________________
>> > >> Jython-users mailing list
>> > >> Jython-users@...
>> > >> https://lists.sourceforge.net/lists/listinfo/jython-users
>> > >>
>> > >
>> > import os
>> > import shutil
>> > import glob
>> > import sys
>> > import socket
>> > import time
>> > import math
>> > import urllib
>> > import popen2
>> > import re
>> > import types
>> > from xml.sax.saxutils import escape
>> > import Test
>> > from java.util import List
>> > from java.io import File
>> > from javax.swing import JButton
>> > from java.awt import Dimension
>> > from java.util import Date
>> > from java.lang import Float
>> > from org.w3c.dom import Document
>> > #print "Running test"
>> > Test.n +=3D 1
>> > This SF.net email is sponsored by DB2 Express
>> > Download DB2 Express C - the FREE version of DB2 express and take
>> > control of your XML. No limits. Just data. Click to get it now.
>> > http://sourceforge.net/powerbar/db2/
>> > _______________________________________________
>> > Jython-users mailing list
>> > Jython-users@...
>> > https://lists.sourceforge.net/lists/listinfo/jython-users
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> Jython-users mailing list
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
Jython-users mailing list