SSL Error when trying to create a new BrokerConnection after connection loss

24 views
Skip to first unread message

ceelian

unread,
Nov 19, 2009, 11:11:42 AM11/19/09
to carrot-users
Hi,

In QAM (AMQP RPC Library) we tried to manage a reconnect after network
loss. We closed the old connection after we catched Exception when
doing a fetch() and created a totally new connection (not just calling
connect()).

But all we get is this:
2009-11-19 17:03:25,193|qam.qam_proxy|ERROR|qam_proxy.py|run| #674:
Exception: Lost Connection during Fetch in Consumer Thread
Traceback (most recent call last):
File "build/bdist.linux-i686/egg/qam/qam_proxy.py", line 661, in run
message = self.consumer.fetch()
File "/usr/local/lib/python2.6/dist-packages/carrot-0.6.0-py2.6.egg/
carrot/messaging.py", line 282, in fetch
message = self.backend.get(self.queue, no_ack=no_ack)
File "/usr/local/lib/python2.6/dist-packages/carrot-0.6.0-py2.6.egg/
carrot/backends/pyamqplib.py", line 171, in get
raw_message = self.channel.basic_get(queue, no_ack=no_ack)
File "build/bdist.linux-i686/egg/amqplib/client_0_8/channel.py",
line 2029, in basic_get
self._send_method((60, 70), args)
File "build/bdist.linux-i686/egg/amqplib/client_0_8/
abstract_channel.py", line 70, in _send_method
method_sig, args, content)
File "build/bdist.linux-i686/egg/amqplib/client_0_8/
method_framing.py", line 233, in write_method
self.dest.write_frame(1, channel, payload)
File "build/bdist.linux-i686/egg/amqplib/client_0_8/transport.py",
line 125, in write_frame
frame_type, channel, size, payload, 0xce))
File "build/bdist.linux-i686/egg/amqplib/client_0_8/transport.py",
line 172, in _write
n = self.sslobj.write(s)
File "/usr/lib/python2.6/ssl.py", line 148, in write
return self._sslobj.write(data)
SSLError: [Errno 1] _ssl.c:1209: error:1409F07F:SSL
routines:SSL3_WRITE_PENDING:bad write retry

We cannot get any new connection working unless we restart the whole
python app.

Maybe there are wrong parameters passed to the python ssl part?

Anyone any Ideas how we could achieve the reconnect?

Note: It works well in a non SSL Environment

thx,
Christian

ceelian

unread,
Nov 20, 2009, 5:11:01 AM11/20/09
to carrot-users


On Nov 19, 5:11 pm, ceelian <christian.hai...@gmail.com> wrote:
> Hi,
>
> In QAM (AMQP RPC Library) we tried to manage a reconnect after network
> loss. We closed the old connection after we catched Exception when
> doing a fetch() and created a totally new connection (not just calling
> connect()).
>
> But all we get is this:
> [...]
> We cannot get any new connection working unless we restart the whole
> python app.
>
> Maybe there are wrong parameters passed to the python ssl part?
>
> Anyone any Ideas how we could achieve the reconnect?
>
> Note: It works well in a non SSL Environment
>
> thx,
> Christian

Well, we found the bug. It is not enough to just recreate the
BrokerConnection, you must also recreate the Consumer/Publisher
instances to reestablish the connection.

Thanks again for the great carrot library!

Regards,
Christian
Reply all
Reply to author
Forward
0 new messages