durusmail: durus-users: assert oid == oid2 AssertionError
assert oid == oid2 AssertionError
2006-11-13
2006-11-14
2006-11-16
2006-11-16
assert oid == oid2 AssertionError
Aïssa HAMMOUCHI
2006-11-13
i'm trying to make working a connection pooling in my app
(i'm using mod_scgi/apache/quixote/durus)

the firsts 40 requests (i call  db to get one object)  get a traceback, then
tracebacks disappear after this occured.
if i stop my app and restart durus/scgi and launch 200 requests with a load
test tool, i get the same scenario after that 40 or more requests are done,
tracebacks disappear and the next requests work fine with no tracebacks..

what's wrong ?

############################################################################
import Queue

class Pooler:
        def __init__(self):
                self.q = Queue.Queue()
                for i in xrange(30):
                    self.q.put( Connection(ClientStorage(host='127.0.0.1
',port=15000))

        def get(self):
            return self.q.get()

        def put(self,c):
            c.abort()
            self.q.put(c)


_pool = Pooler()

class MySession(Session):
    def __init__(self, id):
        Session.__init__(self, id)
        self.pooler = _pool
        self.objects = None
        user = User()
        user.set_name('Anonymous-'+generate_str(5,int))
        self.user = user
         ....

         .....

#########################################################################

[2006-11-13 19:53:31] exception caught
Traceback (most recent call last):
  File "/home/ah/src/alternate-modules/quixote/publish.py", line 278, in
process_request
    output = self.try_publish(request)
  File "/home/ah/src/alternate-modules/quixote/publish.py", line 253, in
try_publish
    output = self.root_directory._q_traverse(components)
  File "/home/ah/src/alternate-modules/quixote/directory.py", line 63, in
_q_traverse
    return obj._q_traverse(path)
  File "/home/ah/src/alternate-modules/quixote/directory.py", line 63, in
_q_traverse
    return obj._q_traverse(path)
  File "/home/ah/src/alternate-modules/quixote/directory.py", line 57, in
_q_traverse
    obj = self._q_lookup(component)
  File "/home/ah/pymods/fidji/ui/browse.ptl", line 122, in _q_lookup
    body(menu(), list_doc())
  File "/home/ah/pymods/fidji/ui/browse.ptl", line 117, in list_doc
    "
%s
"%(i.id,i.nom) File "/home/ah/src/alternate-modules/durus/persistent.py", line 92, in __getattribute__ self._p_load_state() File "/home/ah/src/alternate-modules/durus/persistent.py", line 135, in _p_load_state self._p_connection.load_state(self) File "/home/ah/src/alternate-modules/durus/connection.py", line 185, in load_state pickle = self.get_stored_pickle(oid) File "/home/ah/src/alternate-modules/durus/connection.py", line 105, in get_stored_pickle record = self.storage.load(oid) File "/home/ah/src/alternate-modules/durus/client_storage.py", line 43, in load return self._get_load_response(oid) File "/home/ah/src/alternate-modules/durus/client_storage.py", line 54, in _get_load_response raise ProtocolError('status=%r, oid=%r' % (status, oid)) ProtocolError: status='t', oid='\x00\x00\x00\x00\x00\x00\x02\xf9' Form: Cookies: QX_session 510363c7f1146fdb Environment: CONTENT_LENGTH 0 DOCUMENT_ROOT /usr/pkg/htdocs HTTP_ACCEPT */* HTTP_ACCEPT_ENCODING gzip HTTP_CONNECTION close HTTP_COOKIE QX_session="510363c7f1146fdb" HTTP_HOST 10.142.7.116 HTTP_USER_AGENT Limey The Bulldog PATH_INFO /browse/16/90 QUERY_STRING REMOTE_ADDR 10.142.7.54 REMOTE_PORT 61380 REMOTE_USER Anonymous-68816 None REQUEST_METHOD GET REQUEST_URI /browse/16/90 SCGI 1 SCRIPT_NAME SERVER_ADDR 10.142.7.116 SERVER_ADMIN you@example.com SERVER_NAME 10.142.7.116 SERVER_PORT 80 SERVER_PROTOCOL HTTP/1.1 SERVER_SOFTWARE Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.7d DAV/2 mod_scgi/1.12 UNIQUE_ID awWIbwqOB3QAAEXJldcAAAAC [2006-11-13 19:53:46] exception caught Traceback (most recent call last): File "/home/ah/src/alternate-modules/quixote/publish.py", line 278, in process_request output = self.try_publish(request) File "/home/ah/src/alternate-modules/quixote/publish.py", line 253, in try_publish output = self.root_directory._q_traverse(components) File "/home/ah/src/alternate-modules/quixote/directory.py", line 63, in _q_traverse return obj._q_traverse(path) File "/home/ah/src/alternate-modules/quixote/directory.py", line 63, in _q_traverse return obj._q_traverse(path) File "/home/ah/src/alternate-modules/quixote/directory.py", line 57, in _q_traverse obj = self._q_lookup(component) File "/home/ah/pymods/fidji/ui/browse.ptl", line 122, in _q_lookup body(menu(), list_doc()) File "/home/ah/pymods/fidji/ui/browse.ptl", line 117, in list_doc "
%s
"%(i.id,i.nom) File "/home/ah/src/alternate-modules/durus/persistent.py", line 92, in __getattribute__ self._p_load_state() File "/home/ah/src/alternate-modules/durus/persistent.py", line 135, in _p_load_state self._p_connection.load_state(self) File "/home/ah/src/alternate-modules/durus/connection.py", line 185, in load_state pickle = self.get_stored_pickle(oid) File "/home/ah/src/alternate-modules/durus/connection.py", line 111, in get_stored_pickle assert oid == oid2 AssertionError Form: Cookies: QX_session 7fde3d29c57c82bd Environment: CONTENT_LENGTH 0 DOCUMENT_ROOT /usr/pkg/htdocs HTTP_ACCEPT */* HTTP_ACCEPT_ENCODING gzip HTTP_CONNECTION close HTTP_COOKIE QX_session="7fde3d29c57c82bd" HTTP_HOST 10.142.7.116 HTTP_USER_AGENT Limey The Bulldog PATH_INFO /browse/23/48 QUERY_STRING REMOTE_ADDR 10.142.7.54 REMOTE_PORT 61326 REMOTE_USER Anonymous-75196 None REQUEST_METHOD GET REQUEST_URI /browse/23/48 SCGI 1 SCRIPT_NAME SERVER_ADDR 10.142.7.116 SERVER_ADMIN you@example.com SERVER_NAME 10.142.7.116 SERVER_PORT 80 SERVER_PROTOCOL HTTP/1.1 SERVER_SOFTWARE Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.7d DAV/2 mod_scgi/1.12 UNIQUE_ID a@wcYQqOB3QAABGM0dcAAAAH -- A.H
reply