Dan Kenigsberg has uploaded a new change for review.
Change subject: sampling.ImagePathStatus: drop dead thread ......................................................................
sampling.ImagePathStatus: drop dead thread
In pre-historic rhev-2.1 days, ImagePathStatus thread was used to collect and cache information about the image repository accessibility. However, this code was never used by ovirt-3.y.
By default, images_check_times is set to 0, meaning that the sampling.ImagePathStatus thread is never started. It is highly unlikely that there's a secret vdsm client out there that explicitly turns on this monitoring thread and read the 'storageDomains' element out of getVdsStats.
Change-Id: I682d9730ac087e0a24ba5c72dbac912c87a6452f Signed-off-by: Dan Kenigsberg danken@redhat.com --- M lib/vdsm/config.py.in M vdsm/sampling.py M vdsm_api/vdsmapi-schema.json 3 files changed, 0 insertions(+), 52 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/12/20812/1
diff --git a/lib/vdsm/config.py.in b/lib/vdsm/config.py.in index c0bdd53..c8ce7e6 100644 --- a/lib/vdsm/config.py.in +++ b/lib/vdsm/config.py.in @@ -194,9 +194,6 @@
('irsd', '%(images)s/irsd', None),
- ('images_check_times', '0', - 'Image repository check period (seconds).'), - ('volume_utilization_percent', '50', None),
('volume_utilization_chunk_mb', '1024', None), diff --git a/vdsm/sampling.py b/vdsm/sampling.py index 851034d..aafb942 100644 --- a/vdsm/sampling.py +++ b/vdsm/sampling.py @@ -36,7 +36,6 @@ from vdsm import utils from vdsm import netinfo from vdsm.constants import P_VDSM_RUN -from vdsm.config import config
_THP_STATE_PATH = '/sys/kernel/mm/transparent_hugepage/enabled' if not os.path.exists(_THP_STATE_PATH): @@ -478,12 +477,10 @@ def __init__(self, cif, log, ifids, ifrates): self.startTime = time.time() StatsThread.__init__(self, log, ifids, ifrates) - self._imagesStatus = ImagePathStatus(cif) self._pid = os.getpid() self._ncpus = max(os.sysconf('SC_NPROCESSORS_ONLN'), 1)
def stop(self): - self._imagesStatus.stop() StatsThread.stop(self)
def _updateIfRates(self, hs0, hs1): @@ -504,18 +501,7 @@ stats = StatsThread.get(self) stats['cpuSysVdsmd'] = stats['cpuUserVdsmd'] = 0.0 stats['storageDomains'] = {} - if self._imagesStatus._cif.irs: - self._imagesStatus._refreshStorageDomains() now = time.time() - for sd, d in self._imagesStatus.storageDomains.iteritems(): - stats['storageDomains'][sd] = { - 'code': d['code'], - 'delay': d['delay'], - 'lastCheck': d['lastCheck'], - 'valid': d['valid'], - 'version': d['version'], - 'acquired': d['acquired'], - } stats['elapsedTime'] = int(now - self.startTime) if len(self._samples) < 2: return stats @@ -539,35 +525,3 @@ stats['diskStats'] = hs1.diskStats stats['thpState'] = hs1.thpState return stats - - -class ImagePathStatus(threading.Thread): - def __init__(self, cif, interval=None): - if interval is None: - interval = config.getint('irs', 'images_check_times') - self._interval = interval - self._cif = cif - self.storageDomains = {} - self._stopEvent = threading.Event() - threading.Thread.__init__(self, name='ImagePathStatus') - if self._interval > 0: - self.start() - - def stop(self): - self._stopEvent.set() - - def _refreshStorageDomains(self): - self.storageDomains = self._cif.irs.repoStats() - del self.storageDomains["status"] - if "args" in self.storageDomains: - del self.storageDomains["args"] - - def run(self): - try: - while not self._stopEvent.isSet(): - if self._cif.irs: - self._refreshStorageDomains() - self._stopEvent.wait(self._interval) - except: - logging.error("Error while refreshing storage domains", - exc_info=True) diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json index 0281c4d..72848f8 100644 --- a/vdsm_api/vdsmapi-schema.json +++ b/vdsm_api/vdsmapi-schema.json @@ -1569,8 +1569,6 @@ # # @cpuUserVdsmd: Ratio of CPU time spent in userspace by vdsm # -# @storageDomains: Storage Domain vital statistics -# # @elapsedTime: The number of seconds that vdsm has been running # # @memUsed: The percentage of memory used (not including caches) @@ -1628,7 +1626,6 @@ 'network': 'HostNetworkInterfaceStatsMap', 'rxDropped': 'uint', 'txDropped': 'uint', 'cpuSysVdsmd': 'float', 'cpuUserVdsmd': 'float', - 'storageDomains': 'StorageDomainVitalsMap', 'elapsedTime': 'uint', 'memUsed': 'uint', 'anonHugePages': 'uint', 'cpuLoad': 'float', 'diskStats': 'PathStatsMap', 'thpState': 'THPStates',
oVirt Jenkins CI Server has posted comments on this change.
Change subject: sampling.ImagePathStatus: drop dead thread ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/4385/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/5189/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/5265/ : SUCCESS
oVirt Jenkins CI Server has posted comments on this change.
Change subject: sampling.ImagePathStatus: drop dead thread ......................................................................
Patch Set 2: Verified-1
Build Failed
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/4387/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/5191/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/5267/ : FAILURE
oVirt Jenkins CI Server has posted comments on this change.
Change subject: sampling.ImagePathStatus: drop dead thread ......................................................................
Patch Set 3:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/4388/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/5192/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/5268/ : SUCCESS
Nir Soffer has posted comments on this change.
Change subject: sampling.ImagePathStatus: drop dead thread ......................................................................
Patch Set 3:
(1 comment)
Looks good expect unused variable.
.................................................... File vdsm/sampling.py Line 363: """ Line 364: AVERAGING_WINDOW = 5 Line 365: SAMPLE_INTERVAL_SEC = 2 Line 366: Line 367: def __init__(self, cif, log): Isn't cif unused now? I would remove it as well. Line 368: self.startTime = time.time() Line 369: Line 370: threading.Thread.__init__(self) Line 371: self._log = log
Nir Soffer has posted comments on this change.
Change subject: sampling.ImagePathStatus: drop dead thread ......................................................................
Patch Set 3:
(1 comment)
Minor title edit.
.................................................... Commit Message Line 3: AuthorDate: 2013-11-02 21:37:33 +0000 Line 4: Commit: Dan Kenigsberg danken@redhat.com Line 5: CommitDate: 2013-11-02 22:47:39 +0000 Line 6: Line 7: sampling.ImagePathStatus: drop dead thread Maybe:
sampling: Drop unused ImagePathStatus thread Line 8: Line 9: In pre-historic rhev-2.1 days, ImagePathStatus thread was used to Line 10: collect and cache information about the image repository accessibility. Line 11: However, this code was never used by ovirt-3.y.
oVirt Jenkins CI Server has posted comments on this change.
Change subject: sampling.ImagePathStatus: drop unused code ......................................................................
Patch Set 4:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/4398/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/5202/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/5278/ : SUCCESS
Petr Šebek has posted comments on this change.
Change subject: sampling.ImagePathStatus: drop unused code ......................................................................
Patch Set 4: Verified+1 Code-Review+1
Installed without errors, getVdsStats returns statistics as expected.
Nir Soffer has posted comments on this change.
Change subject: sampling.ImagePathStatus: drop unused code ......................................................................
Patch Set 4: Code-Review+1
Dan Kenigsberg has posted comments on this change.
Change subject: sampling.ImagePathStatus: drop unused code ......................................................................
Patch Set 4: Code-Review+2
Thanks for the review and verification!
Dan Kenigsberg has submitted this change and it was merged.
Change subject: sampling.ImagePathStatus: drop unused code ......................................................................
sampling.ImagePathStatus: drop unused code
In pre-historic rhev-2.1 days, ImagePathStatus thread was used to collect and cache information about the image repository accessibility. However, this code was never used by ovirt-3.y.
By default, images_check_times is set to 0, meaning that the sampling.ImagePathStatus thread is never started. It is highly unlikely that there's a secret vdsm client out there that explicitly turns on this monitoring thread and read the 'storageDomains' element out of getVdsStats.
Change-Id: I682d9730ac087e0a24ba5c72dbac912c87a6452f Signed-off-by: Dan Kenigsberg danken@redhat.com Reviewed-on: http://gerrit.ovirt.org/20812 Reviewed-by: Petr Šebek psebek@redhat.com Tested-by: Petr Šebek psebek@redhat.com Reviewed-by: Nir Soffer nsoffer@redhat.com --- M lib/vdsm/config.py.in M vdsm/clientIF.py M vdsm/sampling.py M vdsm_api/vdsmapi-schema.json 4 files changed, 2 insertions(+), 57 deletions(-)
Approvals: Nir Soffer: Looks good to me, but someone else must approve Petr Šebek: Verified; Looks good to me, but someone else must approve Dan Kenigsberg: Looks good to me, approved
vdsm-patches@lists.fedorahosted.org