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

Comments

@majekw
Copy link
Contributor

@majekw 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
Signed-off-by: Marek Wodzinski <majek@w7i.pl>
majekw added a commit to majekw/mosquitto that referenced this issue Oct 10, 2019
Signed-off-by: Marek Wodzinski <majek@w7i.pl>
@ralight ralight closed this Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.