Change in vdsm[master]: lib: set system name for threads
fromani at redhat.com
fromani at redhat.com
Fri May 22 07:44:35 UTC 2015
Francesco Romani has posted comments on this change.
Change subject: lib: set system name for threads
......................................................................
Patch Set 8:
(3 comments)
https://gerrit.ovirt.org/#/c/41057/8/lib/vdsm/executor.py
File lib/vdsm/executor.py:
Line 211: def _set_system_name(self):
Line 212: if len(self._thread.name) <= pthread.NAME_MAX_LENGTH:
Line 213: pthread.setname(self._thread.name)
Line 214: else:
Line 215: pthread.setname('executor.worker')
> Having different names in vdsm log and htop make it harder to debug.
I agree, but what's the best course of action then?
the python-level thread name is already too long, but it is also among the shortest meaningful (we could have more executor pools in the feature)
I can't think how to shorter it even further without becoming unixy-cryptic like
prdc.wrk.01
:)
Line 216:
Line 217:
Line 218: class _TaskQueue(object):
Line 219: """
https://gerrit.ovirt.org/#/c/41057/8/lib/vdsm/libvirtconnection.py
File lib/vdsm/libvirtconnection.py:
Line 55: self.__thread = None
Line 56:
Line 57: @utils.traceback(on=log.name)
Line 58: def __run(self):
Line 59: pthread.setname("libvirt.events")
> Lets use same name for python thread name.
Unfortunately 'libvirtEventLoop' is 16 ASCII chars long.
Should I change them both?
Line 60: try:
Line 61: libvirt.virEventRegisterDefaultImpl()
Line 62: while self.run:
Line 63: libvirt.virEventRunDefaultImpl()
https://gerrit.ovirt.org/#/c/41057/8/lib/vdsm/schedule.py
File lib/vdsm/schedule.py:
Line 188: def _set_system_name(self):
Line 189: if len(self._name) <= pthread.NAME_MAX_LENGTH:
Line 190: pthread.setname(self._name)
Line 191: else:
Line 192: pthread.setname('scheduler')
> Duplicate code.
Which is the best place to factor it out?
Line 193:
Line 194:
Line 195: class ScheduledCall(object):
Line 196: """
--
To view, visit https://gerrit.ovirt.org/41057
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I9e8ffe2c598221d93ca154e4ee4f345568c5b35f
Gerrit-PatchSet: 8
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list