Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WB-7432] reduce pyagent heartbeat rate #2923

Merged
merged 3 commits into from
Nov 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions wandb/agents/pyagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,17 @@ def _heartbeat(self):
if status in (RunStatus.QUEUED, RunStatus.RUNNING)
}
commands = self._api.agent_heartbeat(self._agent_id, {}, run_status)
if not commands:
continue
job = Job(commands[0])
logger.debug("Job received: {}".format(job))
if job.type in ["run", "resume"]:
self._queue.put(job)
self._run_status[job.run_id] = RunStatus.QUEUED
elif job.type == "stop":
self._stop_run(job.run_id)
elif job.type == "exit":
self._exit()
return
if commands:
job = Job(commands[0])
logger.debug("Job received: {}".format(job))
if job.type in ["run", "resume"]:
self._queue.put(job)
self._run_status[job.run_id] = RunStatus.QUEUED
elif job.type == "stop":
self._stop_run(job.run_id)
elif job.type == "exit":
self._exit()
return
time.sleep(5)

def _run_jobs_from_queue(self): # noqa:C901
Expand Down