Skip to content

Commit

Permalink
Fix bug about can not join current thread during graph unloading (#177)
Browse files Browse the repository at this point in the history
* Fix bug about can not join current thread during graph unloading
* format code
  • Loading branch information
lidongze0629 authored Mar 4, 2021
1 parent e5b5e09 commit 6a0e5a3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/graphscope/framework/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,13 @@ def unload(self):
self._interactive_instance_launching_thread is not None
and self._interactive_instance_launching_thread.is_alive()
):
self._interactive_instance_launching_thread.join()
# join raises a RuntimeError if an attempt is made to join the current thread.
# this exception occurs when a object collected by gc mechanism contains a running thread.
if (
threading.current_thread()
!= self._interactive_instance_launching_thread
):
self._interactive_instance_launching_thread.join()
self._close_interactive_instances()
except Exception as e:
logger.error("Failed to close interactive instances: %s" % e)
Expand Down

0 comments on commit 6a0e5a3

Please sign in to comment.