Skip to content

Commit

Permalink
Debugin connection error
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Dec 4, 2024
1 parent 73a5656 commit d2d871c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/_ert/forward_model_runner/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ async def reconnect(self) -> None:
)
if ack.decode() != "ACK":
raise ClientConnectionError("No Ack for connect")
print(f"{self.dispatch_id=} CONNECTED to {self.url=}")
except asyncio.TimeoutError as exc:
logger.warning("Failed to get acknowledgment on dealer connect!")
self.term()
Expand Down
2 changes: 2 additions & 0 deletions src/ert/ensemble_evaluator/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def __init__(self, ee_con_info: "EvaluatorConnectionInfo") -> None:
self._socket = self._zmq_context.socket(zmq.DEALER)
self._socket.setsockopt(zmq.LINGER, 0)
self._socket.setsockopt_string(zmq.IDENTITY, f"client-{self._id}")
print(f"{self._id=} wiith {ee_con_info.token=}")
if ee_con_info.token is not None:
client_public, client_secret = zmq.curve_keypair()
self._socket.curve_secretkey = client_secret
Expand Down Expand Up @@ -137,6 +138,7 @@ async def reconnect(self) -> None:
)
if ack.decode() != "ACK":
raise asyncio.TimeoutError("No Ack for connect")
print(f"{self._id=} MONITOR CONNECTED")
except asyncio.TimeoutError:
print("NO CONNECTION")
logger.warning(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def evaluate(self, config, _, __):
cert=config.cert,
token=config.token,
max_retries=1,
dealer_name="eval_dispatch",
dealer_name="dispatch_eval",
) as dispatch:
event = EnsembleStarted(ensemble=self.id_)
await dispatch._send(event_to_json(event))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ async def mock_done_prematurely(message, *args, **kwargs):
@pytest.fixture(name="evaluator_to_use")
async def evaluator_to_use_fixture(make_ee_config):
ensemble = TestEnsemble(0, 2, 2, id_="0")
evaluator = EnsembleEvaluator(ensemble, make_ee_config())
evaluator = EnsembleEvaluator(
ensemble, make_ee_config(use_token=False, generate_cert=False)
)
evaluator._batching_interval = 0.5 # batching can be faster for tests
run_task = asyncio.create_task(evaluator.run_and_get_successful_realizations())
await evaluator._server_started.wait()
Expand Down

0 comments on commit d2d871c

Please sign in to comment.