Skip to content

Commit

Permalink
Retire self.update_itp_task.schedule_now().
Browse files Browse the repository at this point in the history
update_itp() is a successor to code that also updated the
list of unfinished runs but the latter is now managed dynamically.

Itp values move slowly on the Fishtest time scale and there is
no need to micro-manage them.
  • Loading branch information
vdbergh authored and ppigazzini committed Jun 9, 2024
1 parent 219f3ff commit b262cbe
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 1 addition & 9 deletions server/fishtest/rundb.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ def schedule_tasks(self):
self.scheduler.create_task(1.0, self.flush_buffers)
self.scheduler.create_task(60.0, self.clean_cache)
self.scheduler.create_task(60.0, self.scavenge_dead_tasks)
self.scheduler.create_task(60.0, self.update_itp)
# short intial delay to make testing more pleasant
self.scheduler.create_task(180.0, self.validate_random_run, initial_delay=60.0)
self.scheduler.create_task(180.0, self.clean_wtt_map, initial_delay=60.0)
self.update_itp_task = self.scheduler.create_task(60.0, self.update_itp)

def update_itp(self):
with self.unfinished_runs_lock:
Expand All @@ -115,11 +115,6 @@ def update_itp(self):
self.calc_itp(run, user_active.count(run["args"].get("username")))
self.buffer(run, False)

print(
f"Update_itp: {len(unfinished_runs)} unfinished runs...",
f"{len(set(user_active))} authors have active runs..",
)

def clean_wtt_map(self):
with self.wtt_lock:
for short_worker_name in list(self.wtt_map):
Expand Down Expand Up @@ -1466,8 +1461,6 @@ def stop_run(self, run_id):
)
self.buffer(run, True)

self.update_itp_task.schedule_now()

# Auto-purge runs here. This may revive the run.
if run["args"].get("auto_purge", True) and "spsa" not in run["args"]:
message = self.purge_run(run)
Expand Down Expand Up @@ -1502,7 +1495,6 @@ def approve_run(self, run_id, approver):
run["approved"] = True
run["approver"] = approver
self.buffer(run, True)
self.update_itp_task.schedule_now()
return run, f"Run {str(run_id)} approved"
else:
return None, f"Run {str(run_id)} already approved!"
Expand Down
2 changes: 0 additions & 2 deletions server/fishtest/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,6 @@ def tests_modify(request):
):
run["args"]["info"] = request.POST["info"].strip()
request.rundb.buffer(run, True)
request.rundb.update_itp_task.schedule_now()

after = del_tasks(run)
message = []
Expand Down Expand Up @@ -1402,7 +1401,6 @@ def tests_delete(request):
message=message,
)
request.rundb.buffer(run, True)
request.rundb.update_itp_task.schedule_now()

request.actiondb.delete_run(
username=request.authenticated_userid,
Expand Down

0 comments on commit b262cbe

Please sign in to comment.