Skip to content

Conversation

@alibozorgkhan
Copy link
Contributor

Sometimes pika raises an exception when tries publish a message:

Logged from file control.py, line 270
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/handlers.py", line 579, in emit
    self.send(s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/handlers.py", line 520, in send
    self.sock.sendall(s)
  File "/Users/palam/.virtualenvs/armoury/lib/python2.7/site-packages/logstash/handler_amqp.py", line 123, in sendall
    properties=self.spec)
  File "/Users/palam/.virtualenvs/armoury/lib/python2.7/site-packages/pika/adapters/blocking_connection.py", line 572, in basic_publish
    (properties, body), False)
  File "/Users/palam/.virtualenvs/armoury/lib/python2.7/site-packages/pika/adapters/blocking_connection.py", line 1159, in _send_method
    self.connection.send_method(self.channel_number, method_frame, content)
  File "/Users/palam/.virtualenvs/armoury/lib/python2.7/site-packages/pika/adapters/blocking_connection.py", line 274, in send_method
    self._send_method(channel_number, method_frame, content)
  File "/Users/palam/.virtualenvs/armoury/lib/python2.7/site-packages/pika/connection.py", line 1503, in _send_method
    self._send_frame(frame.Method(channel_number, method_frame))
  File "/Users/palam/.virtualenvs/armoury/lib/python2.7/site-packages/pika/adapters/blocking_connection.py", line 417, in _send_frame
    super(BlockingConnection, self)._send_frame(frame_value)
  File "/Users/palam/.virtualenvs/armoury/lib/python2.7/site-packages/pika/connection.py", line 1490, in _send_frame
    self._flush_outbound()
  File "/Users/palam/.virtualenvs/armoury/lib/python2.7/site-packages/pika/adapters/blocking_connection.py", line 377, in _flush_outbound
    if self._handle_write():
  File "/Users/palam/.virtualenvs/armoury/lib/python2.7/site-packages/pika/adapters/base_connection.py", line 360, in _handle_write
    self.socket.sendall(frame)
AttributeError: 'NoneType' object has no attribute 'sendall'

In this fix, pika socket tries to reconnect if any type of connection error happens.

@FrEaKmAn
Copy link

FrEaKmAn commented Nov 5, 2015

I'm looking for this feature. But in our case, sometimes connection dies for 30 minutes and then comes back. Is it possible to include this? To have some kind of setting to retry connection in defined intervals.

@matt-snider
Copy link
Contributor

@alibozorgkhan, @FrEaKmAn: Are you still looking for this feature? If so, take a look at #55 and let me know if it would work for you or if you have any feedback

@vklochan
Copy link
Owner

I'm closing the request due to a couple open questions. Feel free to reopen it when you're ready.

@vklochan vklochan closed this Aug 17, 2016
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

Successfully merging this pull request may close these issues.

4 participants