tarantool / tarantool-python

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

Reconnection occurs when a stored procedure raises an error #110

Closed Totktonada closed 5 years ago

Totktonada commented 5 years ago

Sadly it lacks a certain test case.

I tried to define a function in tarantool which raises an error:

function give_me_error()
    error('foo')
end

And tried to call it from tarantool-python. Got the following trace:

$ python
Python 3.7.3 (default, May 29 2019, 04:28:06) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tarantool
>>> c = tarantool.Connection('localhost', 3301)
>>> c.ping()
0.0008437633514404297
>>> c.call('give_me_error')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/alex/projects/tarantool-meta/tarantool-python/tarantool/connection.py", line 380, in call
    response = self._send_request(request)
  File "/home/alex/projects/tarantool-meta/tarantool-python/tarantool/connection.py", line 348, in _send_request
    return self._send_request_wo_reconnect(request)
  File "/home/alex/projects/tarantool-meta/tarantool-python/tarantool/connection.py", line 263, in _send_request_wo_reconnect
    response = Response(self, self._read_response())
  File "/home/alex/projects/tarantool-meta/tarantool-python/tarantool/response.py", line 97, in __init__
    raise DatabaseError(self._return_code, self._return_message)
tarantool.error.DatabaseError: (32, '[string "function give_me_error() error(\'foo\') end"]:1: foo')
>>> c.ping()
0.0007073879241943359

But no warnings re reconnection were shown. So it seems the issue is not reproducible now or was filed due to some mistake.