From 9cff2fc8b82508bf53eb3d9993c9013503960775 Mon Sep 17 00:00:00 2001 From: Edmund Higham Date: Tue, 17 Sep 2024 11:46:57 -0400 Subject: [PATCH] `stop` in python, closable only in scala --- hail/python/hail/backend/py4j_backend.py | 3 ++- hail/python/hail/context.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hail/python/hail/backend/py4j_backend.py b/hail/python/hail/backend/py4j_backend.py index 2b8449602f0..a8a2cc4db55 100644 --- a/hail/python/hail/backend/py4j_backend.py +++ b/hail/python/hail/backend/py4j_backend.py @@ -187,7 +187,7 @@ def decode_bytearray(encoded): self._jbackend = jbackend self._jhc = jhc - self._backend_server = self._hail_package.backend.BackendServer.apply(self._jbackend) + self._backend_server = self._hail_package.backend.BackendServer(self._jbackend) self._backend_server_port: int = self._backend_server.port() self._backend_server.start() self._requests_session = requests.Session() @@ -310,6 +310,7 @@ def _to_java_blockmatrix_ir(self, ir): def stop(self): self._backend_server.close() + self._jbackend.close() self._jhc.stop() self._jhc = None self._registered_ir_function_names = set() diff --git a/hail/python/hail/context.py b/hail/python/hail/context.py index 56897eec987..5258f27fbc1 100644 --- a/hail/python/hail/context.py +++ b/hail/python/hail/context.py @@ -151,7 +151,7 @@ def default_reference(self, value): def stop(self): assert self._backend - self._backend.close() + self._backend.stop() self._backend = None Env._hc = None Env._dummy_table = None