Message3162

Author pjenvey
Recipients pjenvey
Date 2008-04-19.01:11:18
SpamBayes Score 0.07085314
Marked as misclassified No
Message-id <1208567480.22.0.665780025316.issue1026@psf.upfronthosting.co.za>
In-reply-to
Content
I've mentioned before that I thought our list object wasn't thread safe 
at all, but it somewhat is -- many PySequenceList methods are 
synchronized.

Some list operations apparently aren't going through PySequenceList and 
aren't thread safe. One I can reproduce somewhat occurs when I throw a 
bunch of connections/threads at a Pylons hello world app (ab -n 1000 -c 
20)

18:02:35,413 INFO  [paste.httpserver.ThreadPool] Cannot use 
kill_thread_limit as ctypes/killthread is not available
serving on 0.0.0.0:5000 view at http://127.0.0.1:5000
java.lang.IndexOutOfBoundsException: Index must be between 0 and 1, but 
was 5
        at org.python.core.AbstractArray.remove(AbstractArray.java:360)
        at org.python.core.PyObjectList.remove(PyObjectList.java:127)
        at 
org.python.core.PySequenceList.remove(PySequenceList.java:107)
        at org.python.core.PyList.del(PyList.java:100)
        at org.python.core.PyList.list_remove(PyList.java:579)
        at org.python.core.PyList$list_remove_exposer.__call__(Unknown 
Source)
        at org.python.core.PyObject.invoke(PyObject.java:2744)
        at 
paste.httpserver$py.worker_thread_callback$51(/Users/pjenvey/src/python/
pylons-related/Paste/paste/httpserver.py:859)
        at 
paste.httpserver$py.call_function(/Users/pjenvey/src/python/pylons-
related/Paste/paste/httpserver.py)
        at org.python.core.PyTableCode.call(PyTableCode.java:178)
        at org.python.core.PyTableCode.call(PyTableCode.java:399)
        at org.python.core.PyTableCode.call(PyTableCode.java:294)
        at org.python.core.PyFunction.__call__(PyFunction.java:212)
        at org.python.core.PyMethod.__call__(PyMethod.java:101)
        at org.python.core.PyObject._callextra(PyObject.java:395)
        at threading$py.run$40(/Users/pjenvey/src/java/jython-
trunk/dist/Lib/threading.py:200)
        at threading$py.call_function(/Users/pjenvey/src/java/jython-
trunk/dist/Lib/threading.py)
        at org.python.core.PyTableCode.call(PyTableCode.java:178)
        at org.python.core.PyTableCode.call(PyTableCode.java:399)
        at org.python.core.PyTableCode.call(PyTableCode.java:294)
        at org.python.core.PyFunction.__call__(PyFunction.java:212)
        at org.python.core.PyMethod.__call__(PyMethod.java:101)
        at org.python.core.PyObject.__call__(PyObject.java:254)
        at org.python.core.PyObject.invoke(PyObject.java:2731)
        at 
threading$py._Thread__bootstrap$41(/Users/pjenvey/src/java/jython-
trunk/dist/Lib/threading.py:209)
        at threading$py.call_function(/Users/pjenvey/src/java/jython-
trunk/dist/Lib/threading.py)
        at org.python.core.PyTableCode.call(PyTableCode.java:178)
        at org.python.core.PyTableCode.call(PyTableCode.java:399)
        at org.python.core.PyTableCode.call(PyTableCode.java:294)
        at org.python.core.PyFunction.__call__(PyFunction.java:212)
        at org.python.core.PyMethod.__call__(PyMethod.java:101)
        at org.python.core.PyObject.__call__(PyObject.java:244)
        at org.python.core.FunctionThread.run(FunctionThread.java:19)
Exception in thread worker 11:Traceback (most recent call last):
  File "/Users/pjenvey/src/java/jython-trunk/dist/Lib/threading.py", 
line 209, in _Thread__bootstrap
    self.run()
  File "/Users/pjenvey/src/java/jython-trunk/dist/Lib/threading.py", 
line 200, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/pjenvey/src/python/pylons-
related/Paste/paste/httpserver.py", line 859, in worker_thread_callback
    self.idle_workers.remove(thread_id)
java.lang.IndexOutOfBoundsException: 
java.lang.IndexOutOfBoundsException: Index must be between 0 and 1, but 
was 5
History
Date User Action Args
2008-04-19 01:11:20pjenveysetspambayes_score: 0.0708531 -> 0.07085314
recipients: + pjenvey
2008-04-19 01:11:20pjenveysetspambayes_score: 0.0708531 -> 0.0708531
messageid: <1208567480.22.0.665780025316.issue1026@psf.upfronthosting.co.za>
2008-04-19 01:11:19pjenveylinkissue1026 messages
2008-04-19 01:11:19pjenveycreate