Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7878#discussion_r36049673
  
    --- Diff: dev/run-tests.py ---
    @@ -283,16 +284,35 @@ def get_hadoop_profiles(hadoop_version):
             sys.exit(int(os.environ.get("CURRENT_BLOCK", 255)))
     
     
    +def get_zinc_port():
    +    """
    +    Get a randomized port on which to start Zinc
    +    """
    +
    +    return random.randrange(3030, 4030)
    +
    +
    +def kill_zinc_on_port(zinc_port):
    +    """
    +    Kill the Zinc process running on the given port, if one exists.
    +    """
    +
    +    cmd = ("/usr/sbin/lsof -P |grep %s | grep LISTEN "
    +           "| awk '{ print $2; }' | xargs kill") % zinc_port
    +    # TODO: Not sure what happens here if no process exists
    --- End diff --
    
    On a non-zero exit code, `run_cmd` will print an error message and will 
call `sys.exit()`, so we may want to ensure that this always returns a zero 
exit code.  If this is a concern, you could always just perform the underlying 
`subprocess` call yourself.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to