nebula-python
nebula-python copied to clipboard
when I use nebula3-python(version:3.1.0) to connect nebula3.2.0 "Unexpected type for skipping xxx" happened
This Exception raised from nebula3.fbthrift.TProtocol.TProtocolBase,TTYPE has attrs 0-19,but "xxx" can be 34、58、44、123、92、117、34、108、116 and more.
Would you mind sharing a detailed reproduce process so that others could try helping on this?
@awaitable
def initialize(self, conf):
self.conf = conf
configer = Config()
configer.max_connection_pool_size = self.conf.get('max_size', 1)
self._pool = ConnectionPool()
self._pool.init(self.conf['addresses'], configer)
@awaitable
def execute(self, command, method=None):
begin_time = time.time()
try:
self.session = self._pool.get_session(self.conf['user'], self.conf['password'])
while True:
resultset = self.session.execute(command) # raised from
err_code, result = self.parseResultSet(resultset, method)
if err_code:
if err_code == -1009:
self.session.execute('use frfr;')
else:
raise Exception(result)
else:
break
return result
except Exception as e:
raise e
async def _get_frame_info(self, frames_str):
command = f'FETCH PROP ON frame {frames_str} YIELD id(vertex) as id, properties(vertex).ip as ip, ' \
f'properties(vertex).type_statistics as type_statistics'
result = await self.execute(command, method='frame')
same as "https://discuss.nebula-graph.com.cn/t/topic/7857"
nebula3-python version=3.3.0 has no problem above
Strange, are you using the session pool from 3.3.0 or everything is the same but for the version of nebula-python?
Also, plz be noted that nebula-python is not thread-safe.
yes,I am using the session pool from 3.3.0
ok, it may be related to how session was created/shared among requests before? cc @Aiee