summaryrefslogtreecommitdiff
path: root/buildstream/_scheduler/queues/queue.py
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-09-10 14:40:06 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-09-10 15:56:12 +0900
commit78499b7dfcaf962a6da221081be06760f7ea3637 (patch)
tree36a8fab6c37af17cc2d5773d366279c997a05bd3 /buildstream/_scheduler/queues/queue.py
parent303240abdcd01acad5e5daeeda16e2e9bc5aa28b (diff)
downloadbuildstream-tristan/fix-cache-exclusivity-1.2.tar.gz
_artifactcache: There shalt be only one cache sizetristan/fix-cache-exclusivity-1.2
This does a lot of house cleaning, finally bringing cache cleanup logic to a level of comprehensibility. Changes in this commit include: o _artifactcache/artifactcache.py: _cache_size, _cache_quota and _cache_lower_threshold are now all private variables. get_approximate_cache_size() is now get_cache_size() Added get_quota_exceeded() for the purpose of safely checking if we have exceeded the quota. set_cache_size() now asserts that the passed size is not None, it is not acceptable to set a None size cache anymore. o _artifactcache/cascache.py: No longer set the ArtifactCache 'cache_size' variable violently in the commit() method. Also the calculate_cache_size() method now unconditionally calculates the cache size, that is what it's for. o _scheduler/jobs/cachesizejob.py & _scheduler/jobs/cleanupjob.py: Now check the success status. Don't try to set the cache size in the case that the job was terminated. o _scheduler/jobs/elementjob.py & _scheduler/queues/queue.py: No longer passing around the cache size from child tasks, this happens only explicitly, not implicitly for all tasks. o _scheduler/queues/buildqueue.py & _scheduler/scheduler.py: Use get_quota_exceeded() accessor This is a part of #623
Diffstat (limited to 'buildstream/_scheduler/queues/queue.py')
-rw-r--r--buildstream/_scheduler/queues/queue.py5
1 files changed, 0 insertions, 5 deletions
diff --git a/buildstream/_scheduler/queues/queue.py b/buildstream/_scheduler/queues/queue.py
index c8e4457ec..2f875881f 100644
--- a/buildstream/_scheduler/queues/queue.py
+++ b/buildstream/_scheduler/queues/queue.py
@@ -31,7 +31,6 @@ from ..resources import ResourceType
# BuildStream toplevel imports
from ..._exceptions import BstError, set_last_task_error
from ..._message import Message, MessageType
-from ..._platform import Platform
# Queue status for a given element
@@ -301,10 +300,6 @@ class Queue():
# Update values that need to be synchronized in the main task
# before calling any queue implementation
self._update_workspaces(element, job)
- if job.child_data:
- platform = Platform.get_platform()
- artifacts = platform.artifactcache
- artifacts.cache_size = job.child_data.get('cache_size')
# Give the result of the job to the Queue implementor,
# and determine if it should be considered as processed