mirror of
https://github.com/codex-storage/bittorrent-benchmarks.git
synced 2025-02-12 11:06:55 +00:00
fix: tracker raeadiness check exception leak, decrease Vector flush interval
This commit is contained in:
parent
0acd2e3086
commit
72a6d2d6e1
@ -123,9 +123,12 @@ class BoundExperiment(Experiment, Generic[TExperiment]):
|
||||
class IteratedExperiment(Experiment, Generic[TExperiment]):
|
||||
"""An :class:`IteratedExperiment` will run a sequence of :class:`Experiment`s."""
|
||||
|
||||
def __init__(self, experiments: Iterable[TExperiment]):
|
||||
def __init__(
|
||||
self, experiments: Iterable[TExperiment], raise_when_failures: bool = True
|
||||
):
|
||||
self.successful_runs = 0
|
||||
self.failed_runs = 0
|
||||
self.raise_when_failures = raise_when_failures
|
||||
self.experiments = experiments
|
||||
|
||||
def run(self):
|
||||
@ -136,3 +139,8 @@ class IteratedExperiment(Experiment, Generic[TExperiment]):
|
||||
except Exception as ex:
|
||||
self.failed_runs += 1
|
||||
logger.error(ex)
|
||||
|
||||
if self.failed_runs > 0 and self.raise_when_failures:
|
||||
raise RuntimeError(
|
||||
"One or more experiments with an iterated experiment have failed."
|
||||
)
|
||||
|
@ -1,6 +1,7 @@
|
||||
import socket
|
||||
|
||||
import requests
|
||||
from urllib3.exceptions import RequestError
|
||||
from urllib3.util import Url
|
||||
|
||||
from benchmarks.core.experiments.experiments import ExperimentComponent
|
||||
@ -14,7 +15,7 @@ class Tracker(ExperimentComponent):
|
||||
try:
|
||||
requests.get(str(self.announce_url))
|
||||
return True
|
||||
except (ConnectionError, socket.gaierror):
|
||||
except (ConnectionError, RequestError, socket.gaierror):
|
||||
return False
|
||||
|
||||
def __str__(self) -> str:
|
||||
|
@ -193,3 +193,5 @@ def split_logs_in_source(
|
||||
parsed = log_parser.parse_single(raw_line)
|
||||
if parsed:
|
||||
splitter.split_single(parsed)
|
||||
|
||||
logger.info("Finished processing logs.")
|
||||
|
Loading…
x
Reference in New Issue
Block a user