Skip to contentSkip to conversation

master - lvmdbusd: Give threads names

PATCH Tony Asleson 1 participant 1 message Sep 27, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=60e3dbd6d50ce2c28206c96f824a5afc9bb287e6
Commit:        60e3dbd6d50ce2c28206c96f824a5afc9bb287e6
Parent:        2074094e778bfc298fb4cb184b6005e40acd1159
Author:        Tony Asleson <[email protected]>
AuthorDate:    Mon Sep 25 15:18:43 2017 -0500
Committer:     Tony Asleson <[email protected]>
CommitterDate: Wed Sep 27 07:45:00 2017 -0500

lvmdbusd: Give threads names

This will allow easier debug.

---
 daemons/lvmdbusd/background.py |    3 ++-
 daemons/lvmdbusd/fetch.py      |    3 ++-
 daemons/lvmdbusd/main.py       |    3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)
daemons/lvmdbusd/background.py +2 -1
index 90e8b68..3b77a7c 100644
@@ -158,5 +158,6 @@ def _run_cmd(req):
 
 
 def cmd_runner(request):
-	t = threading.Thread(target=_run_cmd, args=(request,))
+	t = threading.Thread(target=_run_cmd, args=(request,),
+							name="cmd_runner %s" % str(request.method))
 	t.start()
daemons/lvmdbusd/fetch.py +2 -1
index c053685..69a4aae 100644
@@ -152,7 +152,8 @@ class StateUpdate(object):
 		load(refresh=False, emit_signal=False, need_main_thread=False)
 
 		self.thread = threading.Thread(target=StateUpdate.update_thread,
-										args=(self,))
+										args=(self,),
+										name="StateUpdate.update_thread")
 
 	def load(self, refresh=True, emit_signal=True, cache_refresh=True,
 					log=True, need_main_thread=True):
daemons/lvmdbusd/main.py +2 -1
index ff97683..dc31b6f 100644
@@ -138,7 +138,8 @@ def main():
 
 	# Using a thread to process requests, we cannot hang the dbus library
 	# thread that is handling the dbus interface
-	thread_list.append(threading.Thread(target=process_request))
+	thread_list.append(threading.Thread(target=process_request,
+										name='process_request'))
 
 	# Have a single thread handling updating lvm and the dbus model so we
 	# don't have multiple threads doing this as the same time