Skip to content

Only write to socket pair in threaded mode#3062

Open
erikrk wants to merge 1 commit intoeclipse-mosquitto:fixesfrom
erikrk:socketpair-write-threaded
Open

Only write to socket pair in threaded mode#3062
erikrk wants to merge 1 commit intoeclipse-mosquitto:fixesfrom
erikrk:socketpair-write-threaded

Conversation

@erikrk
Copy link

@erikrk erikrk commented Jun 7, 2024

Otherwise it is possible to write to the socket pair when there is no consumer resulting in the buffer growing indefinitely. This issue manifests itself when an external event loop is used together with mosquitto_loop_read/mosquitto_loop_write/mosquitto_loop_misc instead of using mosquitto_loop, mosquitto_loop_forever or threaded mode with mosquitto_loop_start/mosquitto_loop_stop

Thank you for contributing your time to the Mosquitto project!

Before you go any further, please note that we cannot accept contributions if
you haven't signed the Eclipse Contributor Agreement.
If you aren't able to do that, or just don't want to, please describe your bug
fix/feature change in an issue. For simple bug fixes it is can be just as easy
for us to be told about the problem and then go fix it directly.

Then please check the following list of things we ask for in your pull request:

  • Have you signed the Eclipse Contributor Agreement, using the same email address as you used in your commits?
  • Do each of your commits have a "Signed-off-by" line, with the correct email address? Use "git commit -s" to generate this line for you.
  • If you are contributing a new feature, is your work based off the develop branch?
  • If you are contributing a bugfix, is your work based off the fixes branch?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run make test with your changes locally?

@erikrk
Copy link
Author

erikrk commented Jan 27, 2025

@ralight What do you think about this?

@erikrk
Copy link
Author

erikrk commented Oct 6, 2025

@ralight Any opinions about this?

Otherwise it is possible to write to the socket pair when there is no
consumer resulting in the buffer growing indefinitely. This issue
manifests itself when an external event loop is used together with
mosquitto_loop_read/mosquitto_loop_write/mosquitto_loop_misc instead
of using mosquitto_loop, mosquitto_loop_forever or threaded mode with
mosquitto_loop_start/mosquitto_loop_stop

Signed-off-by: Erik Karlsson <erik.karlsson@iopsys.eu>
@erikrk erikrk force-pushed the socketpair-write-threaded branch from f2ce539 to 2e5b0d3 Compare January 16, 2026 14:48
@erikrk
Copy link
Author

erikrk commented Jan 16, 2026

@ralight Rebased, would you have a look at this?

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