Issue1026

classification
Title: list not totally thread safe
Type: crash Severity: major
Components: Core Versions:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: fwierzbicki, pjenvey, zyasoft
Priority: Keywords:

Created on 2008-04-19.01:11:19 by pjenvey, last changed 2008-11-18.21:49:48 by zyasoft.

Messages
msg3162 (view) Author: Philip Jenvey (pjenvey) Date: 2008-04-19.01:11:18
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
msg3163 (view) Author: Philip Jenvey (pjenvey) Date: 2008-04-19.01:11:48
I meant I can reproduce it somewhat easily
History
Date User Action Args
2008-11-18 21:49:48zyasoftsetnosy: + zyasoft
2008-04-20 13:17:59fwierzbickisetnosy: + fwierzbicki
2008-04-19 01:11:49pjenveysetmessages: + msg3163
2008-04-19 01:11:20pjenveycreate