Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mosquitto_pub -l hangs when stdin ends. #1448

Closed
majekw opened this issue Oct 6, 2019 · 0 comments
Closed

mosquitto_pub -l hangs when stdin ends. #1448

majekw opened this issue Oct 6, 2019 · 0 comments

Comments

@majekw
Copy link
Contributor

majekw commented Oct 6, 2019

Hello,

since 7d954fa mosquitto_pub -l fails frequently to exit after stdin ends. There must be some race condition as when I test it with strace -f it hangs every time.

It looks like old behavior was:

  1. stdin ends -> set status to STATUS_WAITING
  2. in next loop call mosquitto_disconnect_v5, sleep,
  3. wait for my_disconnect_callback to set connected to false
  4. exit loop
  5. stop mosquitto_loop

After 'fix' it changed to:

  1. stdin ends -> set status to STATUS_WAITING and stdin_finished to true
  2. loop ends without mosquitto_disconnect_v5 and sleep
  3. mosquitto_loop_stop is called, but it probably hangs here
majekw added a commit to majekw/mosquitto that referenced this issue Oct 6, 2019
majekw added a commit to majekw/mosquitto that referenced this issue Oct 10, 2019
@ralight ralight closed this as completed Nov 7, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants