Skip to content

Commit

Permalink
Add retries when creating benchmark runs
Browse files Browse the repository at this point in the history
  • Loading branch information
jietang committed Mar 8, 2017
1 parent 28913da commit 7c7d2f8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gym/scoreboard/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,14 @@ def _upload_benchmark(training_dir, algorithm_id, benchmark_id, benchmark_run_ta
if sorted(env_ids) != sorted(spec_env_ids):
logger.info("WARNING: Evaluations do not match spec for benchmark %s. In %s, we found evaluations for %s, expected %s", benchmark_id, training_dir, sorted(env_ids), sorted(spec_env_ids))

benchmark_run = resource.BenchmarkRun.create(benchmark_id=benchmark_id, algorithm_id=algorithm_id, tags=json.dumps(benchmark_run_tags))
tags = json.dumps(benchmark_run_tags)
_create_with_retries = util.retry_exponential_backoff(
resource.BenchmarkRun.create,
(error.APIConnectionError,),
max_retries=5,
interval=3,
)
benchmark_run = _create_with_retries(benchmark_id=benchmark_id, algorithm_id=algorithm_id, tags=tags)
benchmark_run_id = benchmark_run.id

# Actually do the uploads.
Expand Down

0 comments on commit 7c7d2f8

Please sign in to comment.