Skip to content

Commit

Permalink
Use local metadata backend to avoid the requirements of etcd for loca…
Browse files Browse the repository at this point in the history
…l sessions (#2889)

Mitigate #2887.

Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
  • Loading branch information
sighingnow committed Jun 14, 2023
1 parent 7ef0e4d commit 79cd577
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
3 changes: 3 additions & 0 deletions analytical_engine/core/launcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ void VineyardServer::Start() {
" --size " + FLAGS_vineyard_shared_mem +
" --etcd_endpoint " + FLAGS_etcd_endpoint +
" --etcd_prefix vineyard.gsa." + std::to_string(ts);
if (comm_spec_.worker_num() == comm_spec_.local_num()) {
cmd += " --meta local";
}
auto env = boost::this_process::environment();
// Set verbosity level to 2 can get rid of most of vineyard server's
// debugging output
Expand Down
20 changes: 16 additions & 4 deletions coordinator/gscoordinator/local_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,12 @@ def launch_etcd(self):
else:
self._etcd_peer_port = get_free_port()

if isinstance(self._hosts, (list, tuple)):
hosts = self._hosts
else:
hosts = self._hosts.split(",")
local_hostname = "127.0.0.1"
if len(self._hosts) > 1:
if len(hosts) > 1:
try:
local_hostname = socket.gethostname()
socket.gethostbyname(
Expand Down Expand Up @@ -452,8 +456,11 @@ def launch_vineyard(self):
cmd.extend(["--socket", self.vineyard_socket])
cmd.extend(["--rpc_socket_port", str(self._vineyard_rpc_port)])
cmd.extend(["--size", self._shared_mem])
cmd.extend(["-etcd_endpoint", self._etcd_endpoint])
cmd.extend(["-etcd_prefix", f"vineyard.gsa.{ts}"])
if len(hosts) == 1:
cmd.extend(["--meta", "local"])
else:
cmd.extend(["-etcd_endpoint", self._etcd_endpoint])
cmd.extend(["-etcd_prefix", f"vineyard.gsa.{ts}"])
env = os.environ.copy()
env["GLOG_v"] = str(self._glog_level)
env.update(mpi_env)
Expand Down Expand Up @@ -550,7 +557,12 @@ def configure_etcd_endpoint(self):
def start(self):
try:
# create etcd
self.configure_etcd_endpoint()
if isinstance(self._hosts, (list, tuple)):
hosts = self._hosts
else:
hosts = self._hosts.split(",")
if len(hosts) > 1:
self.configure_etcd_endpoint()
# create vineyard
self.launch_vineyard()
except Exception: # pylint: disable=broad-except
Expand Down
5 changes: 4 additions & 1 deletion python/graphscope/nx/classes/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,10 @@ def __del__(self):
return

if self.cache.enable_iter_cache:
self.cache.shutdown()
try:
self.cache.shutdown()
except: # noqa: E722, pylint: disable=bare-except
pass
self.cache.shutdown_executor()

if not self._is_client_view and self._unload_op is not None:
Expand Down

0 comments on commit 79cd577

Please sign in to comment.