jasonrbriggs / stomp.py

“stomp.py” is a Python client library for accessing messaging servers (such as ActiveMQ or RabbitMQ) using the STOMP protocol (versions 1.0, 1.1 and 1.2). It can also be run as a standalone, command-line client for testing.
Apache License 2.0
491 stars 167 forks source link

BrokenPipe error during long in on_message operation #432

Closed maciejpuzianowski closed 4 months ago

maciejpuzianowski commented 4 months ago
2024-04-15 10:51:05,334 - stomp.py - ERROR - error sending frame
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/stomp/transport.py", line 622, in send
    self.socket.sendall(encoded_frame)
BrokenPipeError: [Errno 32] Broken pipe

I get BrokenPipeError everytime when operations in on_message() last more than 5 minutes and are really heavy when it comes to CPU and memory usage. The error appears every 5 seconds until the connection is lost, then it reconnects and the loop goes on. I am using Artemis ActveMQ.

maciejpuzianowski commented 4 months ago

I have managed to avoid this error by changing heartbeats from (5000, 0) to (35000, 0).