Skip to content

Commit

Permalink
Explicitly disable pylint warning subprocess-popen-preexec-fn (apache…
Browse files Browse the repository at this point in the history
  • Loading branch information
mshawcroft authored and wweic committed Mar 12, 2019
1 parent 32959e1 commit 38ee955
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/tvm/rpc/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,15 @@ def __init__(self,
if silent:
cmd += ["--silent"]

# prexec_fn is not thread safe and may result in deadlock.
# python 3.2 introduced the start_new_session parameter as
# an alternative to the common use case of
# prexec_fn=os.setsid. Once the minimum version of python
# supported by TVM reaches python 3.2 this code can be
# rewritten in favour of start_new_session. In the
# interim, stop the pylint diagnostic.
#
# pylint: disable=subprocess-popen-preexec-fn
self.proc = subprocess.Popen(cmd, preexec_fn=os.setsid)
time.sleep(0.5)
elif not is_proxy:
Expand Down

0 comments on commit 38ee955

Please sign in to comment.