Skip to content

Commit

Permalink
Set client_id as thread name
Browse files Browse the repository at this point in the history
Helps when debugging in the resulting threads as the name is shown in
the possible exception that can come up.

Signed-off-by: Moritz Sauter <[email protected]>
  • Loading branch information
mosauter committed Dec 24, 2023
1 parent 625ad92 commit e2fc0c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/paho/mqtt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1808,7 +1808,7 @@ def loop_start(self):

self._sockpairR, self._sockpairW = _socketpair_compat()
self._thread_terminate = False
self._thread = threading.Thread(target=self._thread_main)
self._thread = threading.Thread(target=self._thread_main, name=f"paho-mqtt-client-{self._client_id.decode()}")
self._thread.daemon = True
self._thread.start()

Expand Down

0 comments on commit e2fc0c8

Please sign in to comment.