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.
  • Loading branch information
mosauter committed Nov 3, 2021
1 parent 9782ab8 commit c837276
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 @@ -1794,7 +1794,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=self._client_id.decode())
self._thread.daemon = True
self._thread.start()

Expand Down

0 comments on commit c837276

Please sign in to comment.