Skip to content

Исключение при попытке записать большой объем данных в очередь #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
marrrvin opened this issue Apr 6, 2015 · 3 comments

Comments

@marrrvin
Copy link

marrrvin commented Apr 6, 2015

Пример кода для воспроизведения проблемы

from tarantool_queue import Queue

queue = Queue("localhost", 33013, 0)
tube = queue.tube("name_of_tube")
tube.put({'x': 'x' * 10000000})

Получаем ошибку:

Traceback (most recent call last):
  File "ex.py", line 6, in <module>
    tube.put({'x': 'x' * 10000000})
  File "/usr/local/lib/python2.7/site-packages/tarantool_queue/tarantool_queue.py", line 260, in put
    self.serialize(data))
  File "/usr/local/lib/python2.7/site-packages/tarantool/connection.py", line 283, in call
    default_type=default_type)
  File "/usr/local/lib/python2.7/site-packages/tarantool/connection.py", line 236, in _send_request
    request, space_name, field_defs, default_type)
  File "/usr/local/lib/python2.7/site-packages/tarantool/connection.py", line 175, in _send_request_wo_reconnect
    self, header, body, space_name, field_defs, default_type)
  File "/usr/local/lib/python2.7/site-packages/tarantool/response.py", line 138, in __init__
    self._unpack_body(body)
  File "/usr/local/lib/python2.7/site-packages/tarantool/response.py", line 237, in _unpack_body
    "<%ds" % (tuple_size), buff, offset + 4)[0]
struct.error: unpack_from requires a buffer of at least 1948279913 bytes

Хотелось бы, чтобы записи подобного размера поддерживались. Была реальная проблема на бою.

Версии библиотек:

tarantool==0.3.6
tarantool-queue==0.1.4

@bigbes
Copy link
Contributor

bigbes commented Apr 6, 2015

tube.put({'x': 'x' * 10000000})

Формируется пакет размером ~ 9.5 мегабайт, тарантул 1.5 поддерживает пакеты размером не больше 1мб.
Чем я могу попытаться в данном случае помочь - попытаться выплёвывать нормальный exception при этом.

@marrrvin
Copy link
Author

marrrvin commented May 7, 2015

Проверять объем сообщения при вставке и падать явно?

@marrrvin
Copy link
Author

marrrvin commented May 7, 2015

  • лучше добавить в документацию про ограничение на размер кортежа.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants