tarantool / tarantool-python

Python client library for Tarantool
https://www.tarantool.io
BSD 2-Clause "Simplified" License
100 stars 48 forks source link

Problem after reconnect #177

Closed vadim-shadrin closed 2 years ago

vadim-shadrin commented 3 years ago

File "/usr/local/lib/python3.8/site-packages/tarantool/connection.py", line 380, in call api-flask-v1_1 | response = self._send_request(request) api-flask-v1_1 | File "/usr/local/lib/python3.8/site-packages/tarantool/connection.py", line 348, in _send_request api-flask-v1_1 | return self._send_request_wo_reconnect(request) api-flask-v1_1 | File "/usr/local/lib/python3.8/site-packages/tarantool/connection.py", line 263, in _send_request_wo_reconnect api-flask-v1_1 | response = Response(self, self._read_response()) api-flask-v1_1 | File "/usr/local/lib/python3.8/site-packages/tarantool/response.py", line 67, in init api-flask-v1_1 | self._sync = header.get(IPROTO_SYNC, 0) api-flask-v1_1 | AttributeError: 'int' object has no attribute 'get'

memclutter commented 3 years ago

Same problem

Totktonada commented 3 years ago

Looks like a problem around navigation within the msgpack stream. However I don't see an obvious problem in the code. How can I reproduce the issue?

memclutter commented 3 years ago

Looks like a problem around navigation within the msgpack stream. However I don't see an obvious problem in the code. How can I reproduce the issue?

make very many requests

memclutter commented 3 years ago

I found the problem, I used one instance of the Connection in different threads, I create separate instances in each thread and the problem was solved :) @vadim-shadrin I hope this help you)

Totktonada commented 3 years ago

@memclutter Thanks for spotting the problem!

The README warns about this:

This driver is synchronous, so connection mustn't be shared between threads/processes.

Totktonada commented 2 years ago

Closing as invalid so.