nebula-python icon indicating copy to clipboard operation
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

Open daidai0235 opened this issue 2 years ago • 7 comments

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.

daidai0235 avatar Nov 02 '22 03:11 daidai0235

Would you mind sharing a detailed reproduce process so that others could try helping on this?

wey-gu avatar Nov 02 '22 03:11 wey-gu

    @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')

daidai0235 avatar Nov 02 '22 03:11 daidai0235

same as "https://discuss.nebula-graph.com.cn/t/topic/7857"

daidai0235 avatar Nov 02 '22 06:11 daidai0235

nebula3-python version=3.3.0 has no problem above

daidai0235 avatar Nov 02 '22 08:11 daidai0235

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.

wey-gu avatar Nov 02 '22 12:11 wey-gu

yes,I am using the session pool from 3.3.0

daidai0235 avatar Nov 02 '22 13:11 daidai0235

ok, it may be related to how session was created/shared among requests before? cc @Aiee

wey-gu avatar Nov 02 '22 15:11 wey-gu