diff options
author | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2019-10-22 11:57:33 +0100 |
---|---|---|
committer | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2019-10-22 11:58:44 +0100 |
commit | c6c9b2a09cd5fb389f96382003d9c769d21f3c97 (patch) | |
tree | 202c12e97ff6e3aee5d5c1a0f4b065246632036a | |
parent | 8edd70b635bf12a1ab2e9a2fa73ccd7c5e67960c (diff) | |
download | buildstream-aevri/no_mark_run_in_subprocess.tar.gz |
cascache: don't need create_cas_usage_monitor nowaevri/no_mark_run_in_subprocess
Now that we don't use mark.in_suprocess in our tests anymore, we don't
need to suppress creating _CASCacheUsageMonitor.
This was introduced in 9c2bbe3c3871db3a33f81e48987f6d473f97b136
-rw-r--r-- | src/buildstream/_cas/cascache.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/buildstream/_cas/cascache.py b/src/buildstream/_cas/cascache.py index 2a2313097..93f180c90 100644 --- a/src/buildstream/_cas/cascache.py +++ b/src/buildstream/_cas/cascache.py @@ -113,7 +113,7 @@ class CASCache(): self._casd_process = subprocess.Popen( casd_args, cwd=path, stdout=logfile_fp, stderr=subprocess.STDOUT) - self._cache_usage_monitor = _CASCacheUsageMonitor.create_cas_usage_monitor(self) + self._cache_usage_monitor = _CASCacheUsageMonitor(self) else: self._casd_process = None @@ -1047,6 +1047,9 @@ class CASCache(): # (CASCacheUsage): The current status # def get_cache_usage(self): + if not self._cache_usage_monitor: + self._cache_usage_monitor = _CASCacheUsageMonitor(self) + return self._cache_usage_monitor.get_cache_usage() # get_casd_process() @@ -1099,15 +1102,6 @@ class _CASCacheUsage(): # buildbox-casd. # class _CASCacheUsageMonitor: - - # FIXME: SemaphoreTracker crashes when triggered via spawn and used in - # tests using fork. - @classmethod - def create_cas_usage_monitor(cls, cas): - if multiprocessing.get_start_method() == 'spawn': - return None - return cls(cas) - def __init__(self, cas): self.cas = cas |