Skip to content

Commit e2fc0c8

Browse files
committed
Set client_id as thread name
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 <sautermoritz@gmx.de>
1 parent 625ad92 commit e2fc0c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/paho/mqtt/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1808,7 +1808,7 @@ def loop_start(self):
18081808

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

0 commit comments

Comments
 (0)