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

Fix loop_stop() not clearing ._thread when called from same thread #809

Merged
merged 3 commits into from
Mar 27, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/paho/mqtt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2274,7 +2274,6 @@ def loop_stop(self) -> MQTTErrorCode:
self._thread_terminate = True
if threading.current_thread() != self._thread:
self._thread.join()
self._thread = None

return MQTTErrorCode.MQTT_ERR_SUCCESS

Expand Down Expand Up @@ -4420,6 +4419,7 @@ def _handle_on_connect_fail(self) -> None:

def _thread_main(self) -> None:
self.loop_forever(retry_first_connection=True)
self._thread = None
jiachin1995 marked this conversation as resolved.
Show resolved Hide resolved

def _reconnect_wait(self) -> None:
# See reconnect_delay_set for details
Expand Down
Loading