fix: tracker raeadiness check exception leak, decrease Vector flush interval

This commit is contained in:
gmega 2025-01-12 07:16:54 -03:00
parent 0acd2e3086
commit 72a6d2d6e1
No known key found for this signature in database
GPG Key ID: 6290D34EAD824B18
3 changed files with 13 additions and 2 deletions

View File

@ -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."
)

View File

@ -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:

View File

@ -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.")