pika: IndexError: pop from an empty deque
here is the bug report
QUANTAXIS>> _AsyncBaseTransport._produce() failed, aborting connection: error=IndexError('pop from an empty deque',); sock=<socket.socket fd=2044, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6, laddr=('::1', 3520, 0, 0), raddr=('::1', 5672, 0, 0)>; Caller's stack:
Traceback (most recent call last):
File "e:\pika\pika\adapters\utils\io_services_utils.py", line 1092, in _on_socket_writable
self._produce()
File "e:\pika\pika\adapters\utils\io_services_utils.py", line 817, in _produce
chunk = self._tx_buffers.popleft()
IndexError: pop from an empty deque
Traceback (most recent call last):
File "e:\pika\pika\adapters\utils\io_services_utils.py", line 1092, in _on_socket_writable
self._produce()
File "e:\pika\pika\adapters\utils\io_services_utils.py", line 817, in _produce
chunk = self._tx_buffers.popleft()
IndexError: pop from an empty deque
QUANTAXIS>> _AsyncTransportBase._initate_abort(): Initiating abrupt asynchronous transport shutdown: state=1; error=IndexError('pop from an empty deque',); <socket.socket fd=2044, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6, laddr=('::1', 3520, 0, 0), raddr=('::1', 5672, 0, 0)>
QUANTAXIS>> Deactivating transport: state=1; <socket.socket fd=2044, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6, laddr=('::1', 3520, 0, 0), raddr=('::1', 5672, 0, 0)>
QUANTAXIS>> connection_lost: StreamLostError: ("Stream connection lost: IndexError('pop from an empty deque',)",)
QUANTAXIS>> AMQP stack terminated, failed to connect, or aborted: error-arg=StreamLostError: ("Stream connection lost: IndexError('pop from an empty deque',)",); pending-error=None
QUANTAXIS>> Stack terminated due to StreamLostError: ("Stream connection lost: IndexError('pop from an empty deque',)",)
QUANTAXIS>> Closing transport socket and unlinking: state=2; <socket.socket fd=2044, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6, laddr=('::1', 3520, 0, 0), raddr=('::1', 5672, 0, 0)>
QUANTAXIS>> Unexpected connection close detected: StreamLostError: ("Stream connection lost: IndexError('pop from an empty deque',)",)
Stream connection lost: IndexError('pop from an empty deque',)
QUANTAXIS>> BlockingConnection.close(200, 'Normal shutdown') called on closed connection.
QUANTAXIS>> [QUANTAXIS REALTIME] connecting to ('::1', 5672, 0, 0)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 20 (8 by maintainers)
Commits related to this issue
- Move consumer definition inside ConsumerThread init to resolve errors on channel close (https://github.com/pika/pika/issues/1144#issuecomment-521026912) Add error_func to handle any exceptions raised ... — committed to NeonDaniel/neon_mq_connector by NeonDaniel 3 years ago
- Resolve errors closing connections, Add Error Handling (#16) * Move consumer definition inside ConsumerThread init to resolve errors on channel close (https://github.com/pika/pika/issues/1144#issueco... — committed to NeonGeckoCom/neon_mq_connector by NeonDaniel 3 years ago
@yutiansut @lukebakken Is this issue solved? In my case, the exception occured when the pika connection was shared across threads, which should have been avoided.
and I solved it when I created a new channel and connection:
hope it helps.
I solved my problem following this pika example, specifically using
connection.add_callback_threadsafe(cb).This allows to share a connection through threads.