Skip to content

Occasional AssertionError exception #25

Open
@magnusbaeck

Description

@magnusbaeck

Description

I stumbled upon the following exception with eiffel-pythonlib 1.1.0:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/home/username/.pyenv/versions/3.6.9/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/home/username/.pyenv/versions/3.6.9/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/username/src/programname/.tox/py36/lib/python3.6/site-packages/eiffellib/lib/base_rabbitmq.py", line 183, in keep_alive
    self.run()
  File "/home/username/src/programname/.tox/py36/lib/python3.6/site-packages/eiffellib/lib/base_rabbitmq.py", line 173, in run
    self._connection.ioloop.start()
  File "/home/username/src/programname/.tox/py36/lib/python3.6/site-packages/pika/adapters/select_connection.py", line 543, in start
    self._poller.start()
  File "/home/username/src/programname/.tox/py36/lib/python3.6/site-packages/pika/adapters/select_connection.py", line 803, in start
    self.poll()
  File "/home/username/src/programname/.tox/py36/lib/python3.6/site-packages/pika/adapters/select_connection.py", line 1200, in poll
    self._dispatch_fd_events(fd_event_map)
  File "/home/username/src/programname/.tox/py36/lib/python3.6/site-packages/pika/adapters/select_connection.py", line 904, in _dispatch_fd_events
    handler(fileno, events)
  File "/home/username/src/programname/.tox/py36/lib/python3.6/site-packages/pika/adapters/utils/selector_ioloop_adapter.py", line 391, in _on_reader_writer_fd_events
    callbacks.writer()
  File "/home/username/src/programname/.tox/py36/lib/python3.6/site-packages/pika/diagnostic_utils.py", line 53, in log_exception_func_wrap
    return func(*args, **kwargs)
  File "/home/username/src/programname/.tox/py36/lib/python3.6/site-packages/pika/adapters/utils/io_services_utils.py", line 1093, in _on_socket_writable
    'but _tx_buffers is empty.', self._state)
AssertionError: ('_AsyncPlaintextTransport._on_socket_writable() called, but _tx_buffers is empty.', 1)

The program in question had consumed one messages and was about to publish two messages in response, but only one message ended up in the receiving queue and the consumed message was acked.

This happened when I was trying a new version of a program using eiffel-pythonlib and I couldn't see any similar cases in the production logs for the same program. Perhaps different timing since I was connecting to a RabbitMQ server on localhost? I have debug-level logs available if that would help.

pika/pika#1219 indicates that this is a usage bug but I haven't dug into the eiffel-pythonlib to confirm this.

Motivation

Exceptions like this shouldn't occur and messages should not be lost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions