diff --git a/src/_ert/forward_model_runner/client.py b/src/_ert/forward_model_runner/client.py index a2a6b8ed2e8..56b2cc9cb37 100644 --- a/src/_ert/forward_model_runner/client.py +++ b/src/_ert/forward_model_runner/client.py @@ -130,8 +130,6 @@ async def send(self, message: str, retries: int | None = None) -> None: logger.debug( f"{self.dealer_id} connection to evaluator went down, reconnecting: {exc}" ) - await asyncio.sleep(1) - self.socket.connect(self.url) except asyncio.CancelledError: self.term() raise @@ -140,6 +138,8 @@ async def send(self, message: str, retries: int | None = None) -> None: if retries > 0: logger.info(f"Retrying... ({retries} attempts left)") await asyncio.sleep(backoff) + # this call is idempotent + self.socket.connect(self.url) backoff = min(backoff * 2, 10) # Exponential backoff raise ClientConnectionError( f"{self.dealer_id} Failed to send {message=} after {retries=}"