orientechnologies / pyorient

OrientDB driver for Python that uses the binary protocol.
Apache License 2.0
119 stars 38 forks source link

db.command hanging with 100% CPU #2

Closed omgold closed 9 years ago

omgold commented 9 years ago

For some sequences of calls to db.command() I encounter the problem of the function call hanging forever, with the client process using 100% CPU. Below is an example with reproduces the issue for me.

I am using OrientDB 2.0.8 and pyorient 1.4.


!/usr/bin/python2

from pyorient.orient import OrientDB

user = "root" passwd = "abcdefg" host = "localhost"

db = OrientDB()

db.connect( user, passwd )

if db.db_exists( "remote:%s/demo" % host ): db.db_drop( "remote:%s/demo" % host, "plocal" ) db.db_create( "remote:%s/demo" % host, "document", "plocal", "document" )

db.db_open( "demo", user, passwd )

db.command( "create class obj" ) db.command( "create property obj._KEY string" ) db.command( "alter property obj._KEY mandatory true" ) print "before create index" db.command( "create index KEY on obj _KEY unique" ) print "after create index"


Traceback (most recent call last): File "LxClient/bug.py", line 21, in db.command( "create index KEY on obj _KEY unique" ) File "/usr/lib/python2.7/site-packages/pyorient/orient.py", line 242, in command .prepare(( QUERY_CMD, ) + args).send().fetch_response() File "/usr/lib/python2.7/site-packages/pyorient/messages/commands.py", line 149, in fetch_response return self._read_sync() File "/usr/lib/python2.7/site-packages/pyorient/messages/commands.py", line 215, in _read_sync m = self._orientSocket.read(1) File "/usr/lib/python2.7/site-packages/pyorient/orient.py", line 95, in read select.select( [self._socket, ], [self._socket, ], [], 30 ) KeyboardInterrupt

Ostico commented 9 years ago

Moved here: https://github.com/mogui/pyorient/issues/68