Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a lock to protect the coordinator to avoid data race condtions. #1445

Merged
merged 3 commits into from
Apr 8, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions python/graphscope/client/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,9 @@ def __init__(
# networkx module
self._nx = None

# a lock that protects the coordinator
self._lock = threading.Lock()

def __repr__(self):
return str(self.info)

Expand Down Expand Up @@ -937,6 +940,10 @@ def _wrapper(self, dag_node):
return dag_node

def run(self, fetches, debug=False):
with self._lock:
return self.run_fetches(fetches, debug)

def run_fetches(self, fetches, debug=False):
"""Run operations of `fetch`.
Args:
fetch: :class:`Operation`
Expand Down