Instance.launch and Instance.find now always either return a connected
Instance or raise RipsError, so their return type narrows from
Optional[Instance] to Instance. In launch(), the unreachable `if pid:`
guard around the Popen result and the trailing `return None` are
removed; the only failure paths raise RipsError.
Update the PythonExamples that previously branched on a None return:
- Drop `if resinsight is None: exit(1)` style guards and `if resinsight
is not None:` wrappers; dedent the body where applicable.
- export_corner_point_grid.py used the None check as a fallback to
launch ResInsight; rewrite as try/except rips.RipsError so the
fallback still works.
- instance_example.py is repurposed as a try/except example for
reporting connection failure.
The heartbeat introduced in db871296c closed the gRPC channel after a
single missed ping (2s deadline). On Windows CI under load this fired
during normal operations, leaving every subsequent test stuck on a
dead channel.
Track consecutive failures inside the heartbeat loop and only declare
the connection lost after failure_threshold (default 3) consecutive
failures. A successful ping resets the counter. Per-ping deadline
raised from 2s to 5s, and below-threshold failures log a warning so
transient slowness is still visible.
Surface gRPC failure context to Python script authors instead of
silently returning sentinel values or raising bare gRPC errors.
- RipsError now carries code/details/location and a from_rpc_error()
helper. Existing single-arg construction stays valid.
- Stop swallowing grpc.RpcError in case.__grid_count for non-NOT_FOUND
failures and in instance._check_connection_and_version, so the
underlying status is propagated.
- pdmobject add_method decorator and _call_pdm_method_* attach
code/details to the raised RipsError; existing message text is
preserved so pytest match=... assertions keep working.
- Instance.start_heartbeat / stop_heartbeat / check_alive provide an
opt-in background ping that flips a sticky lost-connection flag and
raises a readable RipsError from check_alive() if the server dies.
- Server side: GetPdmObject in RiaGrpcAppService, RiaGrpcCaseService
and RiaGrpcProjectService no longer return Status::OK with an empty
reply when the underlying object is missing; they return NOT_FOUND
/ INTERNAL with a descriptive message. Other RiaGrpc*Service files
audited and already return non-OK with text on error paths.
Error conditions in launch() and find() now raise RipsError instead of
logging and returning None, making failures explicit. Updated test to
expect the exception.
Using ResInsight in a server environment when many multiple versions of ResInsight is launched, can cause the port assignment to fail. Change the default value for launch_port from -1 to 0, as this will improve the logic used to assign a port to a new ResInsight session.
Using 0 will ask GRPC to find an available port to be used.
* Python: avoid assigning same port number to multiple grpc sessions
* Add retry count when checking for port number file
* Use grpc to find and use port number
* Add test used to start several instances of resinsight at the same time
Testing up to 50 instances works well
* Python: allow launch_port == 0 to assign port by GRPC in Instance.launch().
Also allow longer wait before failing the port number file reading:
it can take some time to launch when launching lots of instances at
the same time.
* #7885 Update opm-common with optimized coordinate import
* #7885 Allow null as default result from a script method
* #7885 Propagate default parameter values to generated Python code
* #7885 Add CommandRouter as hub for worker methods
* #7885 Add support for use of CommadRouter from Python