0
votes

I am receiving an error ‘Socket closed when connection was open’ when sending a large message on an SSL connection to RabbitMq using Pika.

The connection is a SelectConnection with TLSv1_2 protocol configuration

It fails for messages bigger than 130kB. Smaller messages go through fine. Without SSL, the same code works for much larger messages, even tens of megabytes are passed around flawlessly.

Environment:

  • pika 0.10.0
  • rabbitmq 3.6.9, erlang 19.2
  • sender, receiver, and rabbitmq server on the same physical machine
  • linux or macos

Any suggestion on what is happening and how to fix it?

thanks a lot

1
I assume error you posted is from the client side. Are there corresponding entries in RabbitMQ log files?Alex Buyny
No data is reaching the server. Log shows:=WARNING REPORT==== 23-May-2017::20:31:12 === closing AMQP connection <0.773.0> (******:10707 -> ******:5671): client unexpectedly closed TCP connectiontjean
The size of the message is right at the frame_max limit. Could there be an issue with pika spreading a message on multiple frames with SSL?tjean
@tjean That is likely, but shouldn't be a problem. I had similar issues with my own amqp library, and ended up having to enforce the order of frames for SSL.eandersson
@tjean what if you increase the frame_max on both client and server?Alex Buyny

1 Answers

0
votes

Had exactly the same issue - fixed it by using monkey patching from gevent

from gevent import monkey
monkey.patch_all()