finn pushed to branch finn/scheduler-race-fix at BuildGrid / buildgrid
Commits:
-
28eb0650
by finnball at 2018-09-10T14:59:23Z
2 changed files:
Changes:
... | ... | @@ -82,13 +82,10 @@ class Scheduler: |
82 | 82 |
job.n_tries += 1
|
83 | 83 |
self.queue.appendleft(job)
|
84 | 84 |
|
85 |
- self.jobs[name] = job
|
|
86 |
- |
|
87 | 85 |
def job_complete(self, name, result):
|
88 | 86 |
job = self.jobs[name]
|
89 | 87 |
job.result = result
|
90 | 88 |
job.update_execute_stage(ExecuteStage.COMPLETED)
|
91 |
- self.jobs[name] = job
|
|
92 | 89 |
if not job.do_not_cache and self._action_cache is not None:
|
93 | 90 |
self._action_cache.update_action_result(job.action_digest, result)
|
94 | 91 |
|
... | ... | @@ -101,7 +98,6 @@ class Scheduler: |
101 | 98 |
def update_job_lease_state(self, name, state):
|
102 | 99 |
job = self.jobs[name]
|
103 | 100 |
job.lease.state = state
|
104 |
- self.jobs[name] = job
|
|
105 | 101 |
|
106 | 102 |
def get_job_lease(self, name):
|
107 | 103 |
return self.jobs[name].lease
|
... | ... | @@ -118,5 +114,4 @@ class Scheduler: |
118 | 114 |
job.update_execute_stage(ExecuteStage.EXECUTING)
|
119 | 115 |
job.lease = job.create_lease()
|
120 | 116 |
job.lease.state = LeaseState.PENDING.value
|
121 |
- self.jobs[job.name] = job
|
|
122 | 117 |
yield job.lease
|
... | ... | @@ -113,8 +113,8 @@ class BotsInterface: |
113 | 113 |
pass
|
114 | 114 |
|
115 | 115 |
elif client_state == LeaseState.COMPLETED:
|
116 |
- self._scheduler.job_complete(client_lease.id, client_lease.result)
|
|
117 | 116 |
self._scheduler.update_job_lease_state(client_lease.id, client_lease.state)
|
117 |
+ self._scheduler.job_complete(client_lease.id, client_lease.result)
|
|
118 | 118 |
return None
|
119 | 119 |
|
120 | 120 |
else:
|