Skip to content

adding mqtt user feature that works around the paho mqtt 340 connections limit issue#3268

Merged
cyberw merged 2 commits intolocustio:masterfrom
ionutab:feature/mqtt_experimental
Feb 12, 2026
Merged

adding mqtt user feature that works around the paho mqtt 340 connections limit issue#3268
cyberw merged 2 commits intolocustio:masterfrom
ionutab:feature/mqtt_experimental

Conversation

@ionutab
Copy link
Copy Markdown
Contributor

@ionutab ionutab commented Nov 16, 2025

Hello,

There's a limitation caused by the use of select in the paho.mqtt.python library.

eclipse-paho/paho.mqtt.python#697

The purpose of this PR is to provide an implementation of MqttClient that has an overriden _loop method that uses selectors instead of select.

The implementation was initially posted on the solution above, by @j04n-f

Please advise on:
🤔 I'm not sure about the Experimental name.
📌 Code placement in a separate file.
🧀 If any specific tests are desired and or necessary.
🩻 What better example I could provide.

After the implementation is confirmed I will add documentation and README file updates.

Thanks!

@ionutab ionutab changed the title adding experimental mqtt user that works around the paho mqtt 340 connections issue adding experimental mqtt user that works around the paho mqtt 340 connections limit issue Nov 16, 2025
@cyberw
Copy link
Copy Markdown
Collaborator

cyberw commented Nov 16, 2025

Code placement in a separate file.

Maybe make it a flag in MqttUser instead (passed on to MqttClient triggering a replace of the _loop method in its constructor)? If this is a good fix, maybe it should even be the default?

Perhaps we should log a warning if someone tries to launch >340 connections with the default setup?

@ionutab
Copy link
Copy Markdown
Contributor Author

ionutab commented Nov 17, 2025

Good ideas. I'll see what I can do. Thanks!

@ionutab ionutab force-pushed the feature/mqtt_experimental branch from 4ebb94b to 879b84c Compare November 25, 2025 21:19
@ionutab ionutab changed the title adding experimental mqtt user that works around the paho mqtt 340 connections limit issue adding mqtt user feature that works around the paho mqtt 340 connections limit issue Nov 25, 2025
@ionutab
Copy link
Copy Markdown
Contributor Author

ionutab commented Nov 26, 2025

I've made the update.
Need to test it.

I'm not sure where to add the validation for the 340 warning message.
Is it in the start method in the runners.py file?

@github-actions
Copy link
Copy Markdown

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 20 days.

@github-actions github-actions bot added the stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it label Jan 26, 2026
@ionutab
Copy link
Copy Markdown
Contributor Author

ionutab commented Feb 6, 2026

commenting this so that it does not get closed.

@cyberw cyberw removed the stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it label Feb 6, 2026
@cyberw
Copy link
Copy Markdown
Collaborator

cyberw commented Feb 6, 2026

Hey, sorry for the slow response, I must have misunderstood and thought you were going to do something more.

I guess we can merge this as-is. But isnt it better to always ues the custom loop implementation?

@cyberw
Copy link
Copy Markdown
Collaborator

cyberw commented Feb 12, 2026

@ionutab ?

@ionutab
Copy link
Copy Markdown
Contributor Author

ionutab commented Feb 12, 2026

Hi,
To be honest, I'm a little hesitant to set _use_loop_selectors to True in this pull request in order not to break things for other users.
In the long term the correct solution would be to always use the custom loop implementation, indeed.
I would be more confident to set it as the default in a couple of weeks, maybe by then others will have used the implementation as well.
How does that sound?

@cyberw cyberw merged commit 78570a2 into locustio:master Feb 12, 2026
17 of 18 checks passed
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.

2 participants