forked from miguelgrinberg/python-socketio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to reuse already established and created connection and channel w…
…hile emitting from external processes
- Loading branch information
1 parent
5b91346
commit 4ff70fb
Showing
1 changed file
with
18 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4ff70fb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was having the problem, that my script, that was emitting socketio messages from an external process, started to hang after ~832 messages.
The rabbitmq log showed:
Apparently the maximum number of connections configured in the rabbitmq server was reached.
Then I modified the asyncio_aiopika_manager.py to reuse an old connection, if possible. Then the script hang after emitting 2047 messages.
[erro] <0.25229.47> operation none caused a connection exception not_allowed: "number of channels opened (2047) has reached the negotiated channel_max (2047)"
Now the script also tries to reuse the channel and the exchange. Not entirely sure, whether the latter is necessary.
This commit contains my first attempt to fix the issue of opening many connections and channels without closing or reusing them. Any suggestions are welcome.
Additionally, it would probably be a good idea to use the same methods to reuse existing connections for the listener_connection and the connection used in write_only mode.