Skip to content

Commit

Permalink
[RPC] Add fail-guard for termination time exception (#13651)
Browse files Browse the repository at this point in the history
This PR adds fail-guard to reduce error messages thrown during
process termination time. Such error won't trigger test error
but will bring extra message during exit time.
  • Loading branch information
tqchen authored Dec 22, 2022
1 parent 36d89a2 commit 209845f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion python/tvm/rpc/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,10 @@ def terminate(self):
self.proc = None

def __del__(self):
self.terminate()
try:
self.terminate()
except ImportError:
pass


def websocket_proxy_server(url, key=""):
Expand Down
5 changes: 4 additions & 1 deletion python/tvm/rpc/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,4 +499,7 @@ def terminate(self):
self.proc = None

def __del__(self):
self.terminate()
try:
self.terminate()
except ImportError:
pass
5 changes: 4 additions & 1 deletion python/tvm/rpc/server_ios_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,10 @@ def terminate(self):
print(e)

def __del__(self):
self.terminate()
try:
self.terminate()
except ImportError:
pass

@staticmethod
def is_compatible_environment():
Expand Down

0 comments on commit 209845f

Please sign in to comment.