Skip to content
Snippets Groups Projects
Commit f4fe6b6a authored by Tiago Gomes's avatar Tiago Gomes
Browse files

elementjob: stop calculating cache size

Calculating the cache size on the child_process_data() is racy, as this
runs in the main process which does not obtain exclusive access to the
cache resource.

This calculation also seems unnecessary, as it will triggered when
BuildQueue.done() is called.
parent c4248e22
No related branches found
No related tags found
No related merge requests found
......@@ -109,13 +109,11 @@ class ElementJob(Job):
data = {}
workspace = self._element._get_workspace()
artifact_size = self._element._get_artifact_size()
cache_size = self._element._get_artifact_cache().calculate_cache_size()
if workspace is not None:
data['workspace'] = workspace.to_dict()
artifact_size = self._element._get_artifact_size()
if artifact_size is not None:
data['artifact_size'] = artifact_size
data['cache_size'] = cache_size
return data
......@@ -300,8 +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:
element._get_artifact_cache().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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment